summaryrefslogtreecommitdiff
path: root/recipes/shr/initscripts-shr/mountkernfs.sh
blob: 1ed09fcf05add44cdd50c732b920cd8bba0fe82c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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