stage-1-init: Use mount --move to move /sys etc. to the target root

This fixes warnings about /sys/kernel/security during shutdown and
cleans up /proc/mounts.
This commit is contained in:
Eelco Dolstra 2012-07-24 22:04:28 -04:00
parent fb15b1894e
commit a0721ad2b3

View file

@ -362,10 +362,10 @@ fi
mkdir -m 0755 -p $targetRoot/proc $targetRoot/sys $targetRoot/dev $targetRoot/run
mount --bind /proc $targetRoot/proc
mount --bind /sys $targetRoot/sys
mount --bind /dev $targetRoot/dev
mount --bind /run $targetRoot/run
mount --move /proc $targetRoot/proc
mount --move /sys $targetRoot/sys
mount --move /dev $targetRoot/dev
mount --move /run $targetRoot/run
exec switch_root "$targetRoot" "$stage2Init"