6e6a9c998aa51b3f7be1c02e35f6058e9bdcd880
[openwrt.git] / openwrt / target / default / target_skeleton / etc / preinit
1 #!/bin/sh
2 # executed from squashfs before init to
3 # transfer root to the jffs2 partition
4 mount none /proc -t proc
5 insmod diag
6 echo 0x01 > /proc/sys/diag
7 sleep 1
8 if [ $(cat /proc/sys/reset) = 1 ] ; then
9 export FAILSAFE=true
10 while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
11 else
12 mtd unlock mtd4
13 mount -t jffs2 /dev/mtdblock/4 /jffs
14 pivot_root /jffs /jffs/rom
15 mount none /dev -t devfs
16 mount none /proc -t proc
17 umount rom/proc rom/dev
18 fi
19 mount none /tmp -t ramfs
20 exec /sbin/init
This page took 0.045785 seconds and 3 git commands to generate.