[oe-commits] org.oe.dev SlugOS 5 - replace "mount -U" with "mount UUID=" which works with both mount

mwester commit oe at amethyst.openembedded.net
Mon Sep 1 18:25:31 UTC 2008


SlugOS 5 - replace "mount -U" with "mount UUID=" which works with both mount
and busybox mount; also update boot/disk script to ensure that some key
devices exist in the new /dev which will enable booting to a virgin nfsroot.

Author: mwester at openembedded.org
Branch: org.openembedded.dev
Revision: 7bd228fcb04f96a616bd3711f0d5df582a2a71ec
ViewMTN: http://monotone.openembedded.org/revision/info/7bd228fcb04f96a616bd3711f0d5df582a2a71ec
Files:
1
packages/slugos-init/files/boot/disk
packages/slugos-init/files/functions
packages/slugos-init/files/turnup
packages/slugos-init/slugos-init_5.0.bb
Diffs:

#
# mt diff -r96a6a5f366caf638f404c9883f1342ca8d92c8e2 -r7bd228fcb04f96a616bd3711f0d5df582a2a71ec
#
#
#
# patch "packages/slugos-init/files/boot/disk"
#  from [0853a98ec96963dcaf9f81f162c4bf2900366c46]
#    to [2812a8e183761c88f764ab143d6e65cf1bfc8290]
# 
# patch "packages/slugos-init/files/functions"
#  from [68db6b5c8036845c4660e107be5b5c6a9a1c0cad]
#    to [3a8a43e4f47ba0bc13a780d41ba39abc0a55d2e5]
# 
# patch "packages/slugos-init/files/turnup"
#  from [8eb7efd8fbaf4a131d1e25e012806db17e21eb37]
#    to [d94a8247eae67fe247bce151f90da0b92e8c9617]
# 
# patch "packages/slugos-init/slugos-init_5.0.bb"
#  from [77db73d4a4c178a7a01dd6a1bfafc30334a7c0dd]
#    to [5c3b2fe18a30d3510095f7868b4e32f248080492]
#
============================================================
--- packages/slugos-init/files/boot/disk	0853a98ec96963dcaf9f81f162c4bf2900366c46
+++ packages/slugos-init/files/boot/disk	2812a8e183761c88f764ab143d6e65cf1bfc8290
@@ -38,12 +38,13 @@ then
 	# is attempted.
 	if	test -n "$UUID" &&
 		mount "$@" UUID="$UUID" /mnt ||
-		mount "$@" -U "$UUID" /mnt ||
 		mount "$@" "$device" /mnt
 	then
-		# checkmount checks for sh, chroot, init
-		# and /mnt (i.e. /mnt/mnt in this case)
-		if checkmount /mnt
+		# checkmount checks for sh, chroot, init, /dev
+		# and /mnt (i.e. /mnt/mnt in this case).
+		# minimaldevnodes checks (and creates if required)
+		# a few mandatory /dev nodes we may need.
+		if checkmount /mnt && minimaldevnodes /mnt
 		then
 			# pivot to /initrd if available, else /mnt
 			cd /
============================================================
--- packages/slugos-init/files/functions	68db6b5c8036845c4660e107be5b5c6a9a1c0cad
+++ packages/slugos-init/files/functions	3a8a43e4f47ba0bc13a780d41ba39abc0a55d2e5
@@ -173,6 +173,7 @@ checkmount(){
 	# basic test for init (the kernel will try to load this)
 	# but require a shell in bin/sh too
 	test	\( -d "$1/mnt" \) -a \
+		\( -d "$1/dev" \) -a \
 		\( -x "$1/bin/sh" -o -h "$1/bin/sh" \) -a \
 		\( -x "$1/usr/sbin/chroot" -o -h "$1/usr/sbin/chroot" -o \
 		   -x "$1/sbin/chroot" -o -h "$1/sbin/chroot" \) -a \
@@ -181,6 +182,18 @@ checkmount(){
 		   -x "$1/bin/init" -o -h "$1/bin/init" \)
 }
 #
+# minimaldevnodes "mountpoint"
+#  tests an already mounted mountpoint to see if a very minimal
+#  set of devices exists or can be created in dev, and returns
+#  failure if not.  This is required for booting to an nfsroot
+#  with an empty dev directory, as commonly occurs when the rootfs
+#  is created from a tar.gz image.  This is also required for mdev.
+minimaldevnodes(){
+	[ -c "$1/dev/console" ] || mknod -m 600 "$1/dev/console" c 5 1 || return 1
+	[ -c "$1/dev/null"    ] || mknod -m 666 "$1/dev/null"    c 1 3 || return 1
+	return 0
+}
+#
 # swivel "new root" "old root"
 #  NOTE: the arguments must be paths relative to /, bad things
 #  will happen if the arguments themselves start with /
============================================================
--- packages/slugos-init/files/turnup	8eb7efd8fbaf4a131d1e25e012806db17e21eb37
+++ packages/slugos-init/files/turnup	d94a8247eae67fe247bce151f90da0b92e8c9617
@@ -578,7 +578,7 @@ disk() {
 	fso="$(fsoptions "$@")"
 	if	if test -n "$uuid"
 		then
-			mount "$@" UUID="$uuid" "$new" || mount "$@" -U "$uuid" "$new"
+			mount "$@" UUID="$uuid" "$new"
 		else
 			mount "$@" "$device" "$new"
 		fi
@@ -591,7 +591,7 @@ disk() {
 	if test -n "$fst" &&
 		if test -n "$uuid"
 		then
-			mount -t "$fst" -o "$fso" UUID="$uuid" "$new" || mount -t "$fst" -o "$fso" -U "$uuid" "$new"
+			mount -t "$fst" -o "$fso" UUID="$uuid" "$new"
 		else
 			mount -t "$fst" -o "$fso" "$device" "$new"
 		fi
@@ -633,7 +633,7 @@ disk() {
 		then
 			echo "  options used: -t $fst -o $fso [error in this script]" >&2
 			test -n "$uuid" &&
-				echo "  uuid: $uuid (passed with UUID= or -U)" >&2
+				echo "  uuid: $uuid (passed with UUID=<uuid>)" >&2
 		fi
 	fi
 
============================================================
--- packages/slugos-init/slugos-init_5.0.bb	77db73d4a4c178a7a01dd6a1bfafc30334a7c0dd
+++ packages/slugos-init/slugos-init_5.0.bb	5c3b2fe18a30d3510095f7868b4e32f248080492
@@ -4,7 +4,7 @@ RDEPENDS = "busybox devio"
 LICENSE = "GPL"
 DEPENDS = "base-files devio"
 RDEPENDS = "busybox devio"
-PR = "r0"
+PR = "r1"
 
 SRC_URI = "file://boot/flash \
 	   file://boot/disk \






More information about the Openembedded-commits mailing list