summaryrefslogtreecommitdiff
path: root/packages/slugos-init/files/functions
diff options
context:
space:
mode:
authorMichael Lauer <mickey@vanille-media.de>2008-08-25 12:35:41 +0000
committerMichael Lauer <mickey@vanille-media.de>2008-08-25 12:35:41 +0000
commit64ff4d57e39e9fad1385c00b4665afa5d66c75f3 (patch)
treead51678b0114a7afc784507cc686efa5a5980fd3 /packages/slugos-init/files/functions
parent170632400a39c176bb6678cfaa63f12c2b28d9ab (diff)
parentad284adbc15624a03ffa9d912bcd59d7ac5c4a0a (diff)
merge of '19345cff74205f76f6a9f18a8cbd4dd6bb2f4298'
and 'ae7c41d4de5eda76de5c1cb6a2a4fe160fbc9a1d'
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 /