[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#813232: debootstrap: Two-staged bootstrapping with --second-stage broken



On Jan 30, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:

> Since the upgrade to version 1.0.76 it's no longer possible to create chroots
> with --foreign and a consequential --second-stage which is particularly useful
> when creating a base system for a foreign architecture. Downgrading to 1.0.75
> fixes the issue.
This is a fun case of a change exposing a totally unrelated old bug.

The real bug is that debootstrap runs "dpkg --print-architecture >/dev/null"
at the very beginning of the program, and if you are using --second-stage 
then this happens long before /dev is populated and then an empty 
regular file is created as /dev/null. 
This makes mknod fail later, and then more stuff fails and then you get 
a meaningless error.
The old code hid this bug by extracting the /dev tarball over whatever 
may have already been there.

I think that the current design is broken because it is not reasonable 
anyway to chroot in a tree with an empty /dev and expect that everything 
will work.
Since the content of /dev is architecture independent, a possible fix 
would be to move the call to setup_devices() in every release script 
from the very beginning of the second stage to the very end of the first 
stage.
But if you believe that this would be too much invasive then we can just 
add "rm -f $TARGET/dev/*" to the top of setup_devices_simple() and hope 
that nothing else will be broken in the future by the empty /dev.

Please let me know what I should do.

-- 
ciao,
Marco

Attachment: signature.asc
Description: PGP signature


Reply to: