check if some /proc files exist, before using it, for systems without diag kernel...
[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 [ "$(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 exec /sbin/init
This page took 0.042867 seconds and 5 git commands to generate.