move firstboot to preinit for now (until a better solution is implemented), required...
[openwrt.git] / openwrt / package / base-files / default / etc / preinit
1 #!/bin/sh
2 . /etc/nvram.sh
3 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
4 mount none /proc -t proc
5 insmod diag
6 [ -f /proc/sys/diag ] && echo 0x01 > /proc/sys/diag
7 sleep 1
8 if [ -f /proc/sys/reset ] && [ $(cat /proc/sys/reset) = 1 -o "$(nvram get failsafe)" = 1 ]; then
9 export FAILSAFE=true
10 [ -x /usr/sbin/nvram -a "$(nvram get boot_wait)" != "on" ] && {
11 nvram set boot_wait=on
12 nvram commit
13 }
14 while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
15 fi
16
17 mount_root ${FAILSAFE:+failsafe}
18
19 # automagically run firstboot
20 [ -z "$FAILSAFE" -a -z "$(nvram get no_root_swap)" ] && {
21 { mount|grep "on / type jffs2" 1>&-; } || firstboot
22 }
23
24 exec /sbin/init
This page took 0.041621 seconds and 5 git commands to generate.