2 # Copyright (C) 2006 OpenWrt.org
3 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
11 mount none /proc -t proc
12 mount none /sys -t sysfs
14 size=$(awk '/MemTotal:/ {l=5242880;mt=($2*1024);print((s=mt/2)<l)?mt-l:s}' /proc/meminfo)
15 mount none /tmp -t tmpfs -o size=$size,nosuid,nodev,mode=1777
17 if grep devfs /proc/filesystems > /dev/null; then
18 mount none /dev -t devfs
21 HOTPLUG=/sbin/hotplug-call
23 mount -t tmpfs tmpfs /dev -o size=512K
24 mknod /dev/console c 5 1
26 /sbin/hotplug2 --coldplug --set-rules-file /etc/hotplug2-init.rules
27 /sbin/hotplug2 --no-coldplug --persistent --set-rules-file /etc/hotplug2-init.rules &
33 mkdir -p /dev/pts /dev/shm
34 mount none /dev/pts -t devpts
36 # the shell really doesn't like having stdin/out closed
37 # that's why we use /dev/pty/m0 and m1 as replacement
38 # for /dev/console if there's no serial console available
39 dd if=/dev/console of=/dev/null bs=1 count=0 >/dev/null 2>/dev/null && {
48 [ -e /etc/preinit.arch ] && . /etc/preinit.arch
50 echo "$HOTPLUG" > /proc/sys/kernel/hotplug
51 eval ${FAILSAFE:+failsafe}
52 lock -w /tmp/.failsafe