[Pkg-sysvinit-devel] Bug#697002: [PATCH initramfs-tools 1/5] init: Decide what the real init is immediately before mounting /usr

Ben Hutchings ben at decadent.org.uk
Mon Sep 29 00:46:16 UTC 2014


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 at decadent.org.uk>
---
 init | 68 ++++++++++++++++++++++++++++++++++----------------------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/init b/init
index 90a2ba1..05394c2 100755
--- a/init
+++ b/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
+
+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
 
-	# No init on rootmount
-	if ! validate_init "${init}" ; then
-		panic "No init found. Try passing init= bootarg."
+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


-- 
Ben Hutchings
Logic doesn't apply to the real world. - Marvin Minsky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 811 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20140929/09eb4cc0/attachment.sig>


More information about the Pkg-sysvinit-devel mailing list