Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | PATH=/sbin:/bin:/usr/sbin:/usr/bin |
| 4 | |
| 5 | do_mount_fs() { |
| 6 | grep -q "$1" /proc/filesystems || return |
| 7 | test -d "$2" || mkdir -p "$2" |
| 8 | mount -t "$1" "$1" "$2" |
| 9 | } |
| 10 | |
| 11 | do_mknod() { |
| 12 | test -e "$1" || mknod "$1" "$2" "$3" "$4" |
| 13 | } |
| 14 | |
| 15 | mkdir -p /proc |
| 16 | mount -t proc proc /proc |
| 17 | |
| 18 | do_mount_fs sysfs /sys |
| 19 | do_mount_fs debugfs /sys/kernel/debug |
| 20 | do_mount_fs devtmpfs /dev |
| 21 | do_mount_fs devpts /dev/pts |
| 22 | do_mount_fs tmpfs /dev/shm |
| 23 | |
| 24 | mkdir -p /run |
| 25 | mkdir -p /var/run |
| 26 | |
| 27 | do_mknod /dev/console c 5 1 |
| 28 | do_mknod /dev/null c 1 3 |
| 29 | do_mknod /dev/zero c 1 5 |
| 30 | |
| 31 | exec sh </dev/console >/dev/console 2>/dev/console |