Package: mmdebstrap Version: 0.4.1-6 Tags: patch Hi Josch,
I found yet another corner case with foreign chrootless: | $ dpkg --print-architecture | amd64 | $ mmdebstrap --variant=extract --mode=chrootless --architectures=armhf --include=ncurses-base -v sid target http://deb.debian.org/debian | I: armhf cannot be executed, falling back to qemu-user | I: running apt-get update... | Get:1 http://deb.debian.org/debian sid InRelease [139 kB] | Get:2 http://deb.debian.org/debian sid/main armhf Packages [8152 kB] | Fetched 8290 kB in 1s (5605 kB/s) | Reading package lists... | I: downloading packages with apt... | Reading package lists... | Building dependency tree... | The following NEW packages will be installed: | ncurses-base | 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. | Need to get 263 kB of archives. | After this operation, 387 kB of additional disk space will be used. | Get:1 http://deb.debian.org/debian sid/main armhf ncurses-base all 6.1+20190803-1 [263 kB] | Fetched 263 kB in 0s (21.3 MB/s) | Download complete and in download only mode | I: extracting archives... | I: installing packages... | I: cleaning package lists and apt cache... | Reading package lists... | E: cannot unlink /usr/bin/qemu-arm-static: No such file or directory | $ echo $? | 1 | $ This time around, mmdebstrap fails during cleanup. Close to the end around line 1688 it checks whether we use qemu. Unless the mode is proot or fakechroot, it cleans up the qemu binary. It turns out that chrootless is neither proot nor fakechroot, so qemu gets cleaned up. However it was never set up, because qemu is not needed for the chrootless mode. The qemu cleanup should also be skipped for chrootless. Please consider applying the attached patch. Helmut
--- a/mmdebstrap +++ b/mmdebstrap @@ -1685,7 +1685,7 @@ rmdir "$options->{root}/var/lib/apt/lists/auxfiles" or die "cannot rmdir /var/lib/apt/lists/auxfiles: $!"; } - if (defined $options->{qemu} and $options->{mode} ne 'proot' and $options->{mode} ne 'fakechroot') { + if (defined $options->{qemu} and $options->{mode} ne 'proot' and $options->{mode} ne 'fakechroot' and $options->{mode} ne 'chrootless') { unlink "$options->{root}/usr/bin/qemu-$options->{qemu}-static" or error "cannot unlink /usr/bin/qemu-$options->{qemu}-static: $!"; }