#!/bin/execlineb -P # mount /dev through fstab foreground { if -n { mountpoint -q /dev } if -t { fstabinfo -q /dev } fstabinfo -q --mount /dev } # or manually foreground { if -n { mountpoint -q /dev } ifelse -n { grep -q devtmpfs /proc/filesystems } { echo "This kernel doesn't have support for devtmpfs! This means /dev will not be mounted." } mount -n -t devtmpfs dev /dev -o mode=0755,noexec,nosuid,size=10M } # creating console, tty1 and tty to be able to write to console # with/without bootsplash before udevd creates it foreground { if -n { test -c /dev/console } mknod -m 600 /dev/console c 5 1 } foreground { if -n { test -c /dev/tty1 } mknod -m 620 /dev/tty1 c 4 1 } foreground { if -n { test -c /dev/tty } mknod -m 666 /dev/tty c 5 0 } # udevd will dup it's std{in,out,err} to /dev/null # and we don't want a file which gets buffered in ram foreground { if -n { test -c /dev/null } mknod -m 666 /dev/null c 1 3 } # so udev can add it's start message to dmesg foreground { if -n { test -c /dev/kmesg } mknod -m 660 /dev/kmesg c 1 11 } # extra symlinks foreground { ln -snf /proc/self/fd /dev/fd } foreground { ln -snf /proc/self/fd/0 /dev/stdin } foreground { ln -snf /proc/self/fd/1 /dev/stdout } foreground { ln -snf /proc/self/fd/2 /dev/stderr } foreground { ln -snf /proc/kcore /dev/core } # mount required dirs that may not be in /etc/fstab foreground { mkdir -m 1777 -p /dev/mqueue } foreground { if -n { mountpoint -q /dev/mqueue } mount -n -t mqueue mqueue /dev/mqueue -o nosuid,noexec,nodev } foreground { mkdir -m 0755 -p /dev/pts } foreground { if -n { mountpoint -q /dev/pts } mount -n -t devpts devpts /dev/pts -o gid=5,mode=0620,nosuid,noexec } foreground { mkdir -m 1777 -p /dev/shm } foreground { if -n { mountpoint -q /dev/shm } mount -n -t tmpfs shm /dev/shm -o mode=1777,nosuid,noexec,nodev }