• weird interaction (bug?) between two-stage debootstrap and dpkg-divert

    From Thorsten Glaser@21:1/5 to All on Mon Nov 27 05:40:01 2023
    Hi,

    I ran into this because I have an elaborate chroot script¹ that
    handles start-stop-daemon, initctl, policy-rc.d, etc. and can
    reproduce this as follows:

    I’ve debootstrapped bullseye up to first stage, then entered
    the chroot and:

    # dpkg-divert --local --quiet --rename --divert /sbin/start-stop-daemon.REAL --add /sbin/start-stop-daemon

    Then I created a new /sbin/start-stop-daemon. Running
    “ls -l /sbin/start-stop-daemon*” confirms both exist and are
    executable. Also:

    0|I have no name!@tglase:/# dpkg-divert --list
    local diversion of /sbin/start-stop-daemon to /sbin/start-stop-daemon.REAL

    Then I did:

    # /debootstrap/debootstrap --second-stage
    […]
    I: Configuring libc-bin...
    I: Base system installed successfully.
    0|I have no name!@tglase:/# ls -l /sbin/start-stop-daemon*
    -rwxr-xr-x 1 root root 94 Nov 27 04:06 /sbin/start-stop-daemon
    0|I have no name!@tglase:/# dpkg-divert --list
    diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash
    local diversion of /sbin/start-stop-daemon to /sbin/start-stop-daemon.REAL diversion of /bin/sh to /bin/sh.distrib by dash

    So, the diversion is retained but the *diverted* file is, for
    some reason, removed.

    Did I stumble upon a bug or is this to be expected?


    https://evolvis.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=shellsnippets/shellsnippets.git;a=blob;f=posix/sysadmin/debchroot.sh;hb=HEAD

    bye,
    //mirabilos
    --
    16:47⎜«mika:#grml» .oO(mira ist einfach gut....) 23:22⎜«mikap:#grml»
    mirabilos: und dein bootloader ist geil :) 23:29⎜«mikap:#grml» und ich finds saugeil dass ich ein bsd zum booten mit grml hab, das muss ich dann gleich mal auf usb-stick installieren -- Michael Prokop über MirOS bsd4grml

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)