Ticket #1403 (new defect)

Opened 7 years ago

Last modified 7 years ago

make-chroot needs to create policy-rc.d first

Reported by: jdreed Owned by: jdreed
Priority: high Milestone: Current Semester
Component: -- Keywords:
Cc: Fixed in version:
Upstream bug:


Creating policy-rc.d after debootstrap is pointless, because then everything in debootstrap has ignored it. In Saucy, this means udev has started with the chroot's /run as its cwd, and so the umount fails. I have this in a local commit and need to push it.

Change History

comment:1 Changed 7 years ago by geofft

Can you post your patch for this? I think I'm running into something similar using mk-sbuild, and it'd be good to land a fix there.

comment:2 Changed 7 years ago by jdreed

Hrm, apparently my local checkout is also completely out of skew, so I'll fix it up and push it, but basically, the patch is:

--- a/build-server/make-chroot
+++ b/build-server/make-chroot
@@ -121,8 +121,9 @@ if [ "$TYPE" = "overlayfs" ]; then
-debootstrap --variant=buildd --include=apt,apt-utils,gnupg,build-essential,fakeroot --arch "$ARCH" "$SUITE" "$TARGET" "$MIRROR"
+mkdir -p "$TARGET/usr/sbin"
 install -m a=rx,u+w "$DATA/policy-rc.d" "$TARGET/usr/sbin/"
+debootstrap --variant=buildd --include=apt,apt-utils,gnupg,build-essential,fakeroot --arch "$ARCH" "$SUITE" "$TARGET" "$MIRROR"
 mkdir -p "$TARGET/dev/pts"
 # /dev/shm is a symlink to /run/shm on modern distros 
 # So if it's not a symlink, then mkdir (and fail if it's something

comment:3 Changed 7 years ago by jdreed

Adam notes that sbuild-createchroot appears to DTRT so maybe we should look into tweaking make-chroot to use more standard utilities. In particular, I bet someone else has already solved the problem of "The chroot uses /run and the host uses /var/run" or vice-versa, and I'd love for that not to be our problem. (Though the last of the /var/run distros are dying anyway.)

comment:4 Changed 7 years ago by geofft

Oh, yeah, you should absolutely be using either sbuild-createchroot or mk-sbuild. Separately, mk-sbuild should be using sbuild-createchroot, but that's a bug for the Debian bugtracker or something.

comment:5 Changed 7 years ago by jdreed

Unless I'm missing something, sbuild-createchroot only takes care of debootstrap and some schroot setup. It notes that the schroot config will need to be tweaked, and we will of course continue to need make-chroot to deal with our specific LVM config.

Note: See TracTickets for help on using tickets.