summaryrefslogtreecommitdiff
path: root/packages/initscripts/initscripts-openmoko/mountkernfs.sh
diff options
context:
space:
mode:
authorChia-I Wu <olv@openmoko.com>2008-10-28 16:49:38 +0800
committerJohn Lee <john_lee@openmoko.org>2009-01-12 14:29:03 +0800
commit321b7dc88878ff24a48065048e01957d440a81c5 (patch)
treebcc1f0efb06afb662e250a45b83585870413eb30 /packages/initscripts/initscripts-openmoko/mountkernfs.sh
parent0cd7f559c01c45f5fc287e533b7456fc2ba79cb9 (diff)
fastboot: initscripts-openmoko: Replacement for initscripts.
Move the common files into 'files' dir and keep Openmoko specific files under initscripts-openmoko. 'finish' was renamed to 'finish.sh', so various recipes have to be modified as well.
Diffstat (limited to 'packages/initscripts/initscripts-openmoko/mountkernfs.sh')
-rw-r--r--packages/initscripts/initscripts-openmoko/mountkernfs.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/initscripts/initscripts-openmoko/mountkernfs.sh b/packages/initscripts/initscripts-openmoko/mountkernfs.sh
new file mode 100644
index 0000000000..1ed09fcf05
--- /dev/null
+++ b/packages/initscripts/initscripts-openmoko/mountkernfs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+supported_kernel() {
+ case "$(uname -r)" in
+ 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;;
+ 2.6.1[0-7]|2.6.1[0-7][!0-9]*) return 1 ;;
+ esac
+ return 0
+}
+
+check_kernel() {
+ if ! supported_kernel; then
+ echo "WARNING: kernel < 2.6.18"
+ fi
+
+ if ! grep -qs devpts /proc/filesystems; then
+ echo "WARNING: kernel does not support devpts"
+ fi
+
+ if ! grep -qs tmpfs /proc/filesystems; then
+ echo "WARNING: kernel does not support tmpfs"
+ fi
+}
+
+if [ -d /proc ]; then
+ mount -n -t proc proc /proc
+fi
+
+check_kernel
+
+if [ -d /sys ]; then
+ mount -n -t sysfs sysfs /sys
+fi