summaryrefslogtreecommitdiff
path: root/packages/slugos-init/files/functions
diff options
context:
space:
mode:
authorMike Westerhof <mwester@dls.net>2008-08-24 23:49:44 +0000
committerMike Westerhof <mwester@dls.net>2008-08-24 23:49:44 +0000
commitfb1cee2982dbd566111e6dcd5766b7721583513b (patch)
treee079ceebf24b03251c5a029fdac595d2ce4ba488 /packages/slugos-init/files/functions
parent2a3a5812f4a2752fefc847d65d0a1b3ede3f0b4f (diff)
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.
Diffstat (limited to 'packages/slugos-init/files/functions')
-rw-r--r--packages/slugos-init/files/functions13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/slugos-init/files/functions b/packages/slugos-init/files/functions
index 18f4009ee7..5b6b40b091 100644
--- a/packages/slugos-init/files/functions
+++ b/packages/slugos-init/files/functions
@@ -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 /