init: Validate the real init after devtmpfs is mounted under the real root

Currently 'run-init -n' will fail if there's no static /dev/console on
the real root.  We have to run it after udev's init-bottom script has
moved /dev to ${rootmnt}/dev.

Closes: #811479
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Ben Hutchings 2016-01-19 18:32:05 +00:00
parent 280d461722
commit 4fa3fe4d7d

27
init
View File

@ -236,6 +236,20 @@ if read_fstab_entry /usr; then
log_end_msg
fi
# Mount cleanup
mount_bottom
nfs_bottom
local_bottom
maybe_break bottom
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
# We expect udev's init-bottom script to move /dev to ${rootmnt}/dev
run_scripts /scripts/init-bottom
[ "$quiet" != "y" ] && log_end_msg
# Move /run to the root
mount -n -o move /run ${rootmnt}/run
validate_init() {
run-init -n "${rootmnt}" "${1}"
}
@ -252,19 +266,6 @@ if ! validate_init "$init"; then
done
fi
# Mount cleanup
mount_bottom
nfs_bottom
local_bottom
maybe_break bottom
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
run_scripts /scripts/init-bottom
[ "$quiet" != "y" ] && log_end_msg
# Move /run to the root
mount -n -o move /run ${rootmnt}/run
# No init on rootmount
if ! validate_init "${init}" ; then
panic "No init found. Try passing init= bootarg."