summaryrefslogtreecommitdiff
path: root/packages/slugos-init/files/functions
diff options
context:
space:
mode:
authorMike Westerhof <mwester@dls.net>2008-08-25 06:28:23 +0000
committerMike Westerhof <mwester@dls.net>2008-08-25 06:28:23 +0000
commit3e3b5554c3f5b45dde906d51e0c603e82e4bc1f8 (patch)
tree9bf40f82b79b464ad8daf864f797db34d3713b0e /packages/slugos-init/files/functions
parentc765bc47121d95e8cbc0a6ad71a850e2bcb8f082 (diff)
parent36c64170765ecb2b2437e9b58d9ff5e262b186a8 (diff)
merge of '65908f491852a7129b196ced660449bcc1933f90'
and 'a7b7d4700cc3ecf7ecb70b8c6056d4e2dd721550'
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 /