mirror of
https://salsa.debian.org/kernel-team/initramfs-tools.git
synced 2026-01-26 15:39:08 +00:00
init: Decide what the real init is immediately before mounting /usr
Unfortunately, it appears we will need to know this to decide whether or not to mount /usr. Related-to: #763157 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
parent
36693bec70
commit
52abbfb314
68
init
68
init
@ -220,37 +220,6 @@ mount_premount
|
||||
mountroot
|
||||
log_end_msg
|
||||
|
||||
if read_fstab_entry /usr; then
|
||||
log_begin_msg "Mounting /usr file system"
|
||||
mountfs /usr
|
||||
log_end_msg
|
||||
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
|
||||
|
||||
# Preserve information on old systems without /run on the rootfs
|
||||
if [ -d ${rootmnt}/run ]; then
|
||||
mount -n -o move /run ${rootmnt}/run
|
||||
else
|
||||
# The initramfs udev database must be migrated:
|
||||
if [ -d /run/udev ] && [ ! -d /dev/.udev ]; then
|
||||
mv /run/udev /dev/.udev
|
||||
fi
|
||||
# The initramfs debug info must be migrated:
|
||||
if [ -d /run/initramfs ] && [ ! -d /dev/.initramfs ]; then
|
||||
mv /run/initramfs /dev/.initramfs
|
||||
fi
|
||||
umount /run
|
||||
fi
|
||||
|
||||
validate_init() {
|
||||
checktarget="${1}"
|
||||
|
||||
@ -292,11 +261,42 @@ if [ ! -x "${rootmnt}/sbin/init" ]; then
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
# No init on rootmount
|
||||
if ! validate_init "${init}" ; then
|
||||
panic "No init found. Try passing init= bootarg."
|
||||
if read_fstab_entry /usr; then
|
||||
log_begin_msg "Mounting /usr file system"
|
||||
mountfs /usr
|
||||
log_end_msg
|
||||
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
|
||||
|
||||
# Preserve information on old systems without /run on the rootfs
|
||||
if [ -d ${rootmnt}/run ]; then
|
||||
mount -n -o move /run ${rootmnt}/run
|
||||
else
|
||||
# The initramfs udev database must be migrated:
|
||||
if [ -d /run/udev ] && [ ! -d /dev/.udev ]; then
|
||||
mv /run/udev /dev/.udev
|
||||
fi
|
||||
# The initramfs debug info must be migrated:
|
||||
if [ -d /run/initramfs ] && [ ! -d /dev/.initramfs ]; then
|
||||
mv /run/initramfs /dev/.initramfs
|
||||
fi
|
||||
umount /run
|
||||
fi
|
||||
|
||||
# No init on rootmount
|
||||
if ! validate_init "${init}" ; then
|
||||
panic "No init found. Try passing init= bootarg."
|
||||
fi
|
||||
|
||||
maybe_break init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user