Bug#660297: initramfs-tools: busybox's switch_root doesn't handle /proc or /sys moving
Package: initramfs-tools
Version: 0.100
Severity: normal
Tags: patch
Greetings.
the change to using switch_root leaves /sys and /proc in an unmounted state.
busybox's switch_root doesn't appear to handle the /sys and /proc moving the
way that util-linux's switch_root does.
either busybox's switch_root should be fixed, initramfs-tools uses util-linux's
switch_root, or manually handle mounting the dirs, just like how it's done with
run-init. the following patch implements the last approach.
Work around busybox's switch_root, which doesn't handle moving /proc and /sys
into the root before switching, by moving the /proc and /sys directories
directly.
+# Move virtual filesystems over to the real filesystem
+mount -n -o move /sys ${rootmnt}/sys
+mount -n -o move /proc ${rootmnt}/proc
+
# Chain to real filesystem
if command -v switch_root >/dev/null 2>&1; then
exec switch_root ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console
elif command -v run-init >/dev/null 2>&1; then
- # Move virtual filesystems over to the real filesystem
- mount -n -o move /sys ${rootmnt}/sys
- mount -n -o move /proc ${rootmnt}/proc
exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console
fi
--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120218002313.GU3372@talon.fglan">http://lists.debian.org/20120218002313.GU3372@talon.fglan