2005-02-06 02:52:16 +02:00
|
|
|
#!/bin/sh
|
|
|
|
mount none /proc -t proc
|
|
|
|
insmod diag
|
|
|
|
echo 0x01 > /proc/sys/diag
|
|
|
|
sleep 1
|
|
|
|
if [ $(cat /proc/sys/reset) = 1 ] ; then
|
|
|
|
export FAILSAFE=true
|
|
|
|
while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
|
|
|
|
else
|
2005-02-28 09:04:51 +02:00
|
|
|
mount | grep jffs2 >&-
|
2005-03-06 05:34:52 +02:00
|
|
|
if [ $? = 0 ] ; then
|
2005-03-04 09:59:08 +02:00
|
|
|
mtd unlock rootfs
|
|
|
|
[ $(cat /proc/mtd | wc -l) = 6 ] && {
|
|
|
|
echo 5 > /proc/sys/diag
|
|
|
|
mtd unlock OpenWrt
|
|
|
|
mtd erase OpenWrt
|
|
|
|
jffs2root --move
|
|
|
|
}
|
|
|
|
mount -o remount,rw /dev/root /
|
2005-02-28 09:04:51 +02:00
|
|
|
else
|
2005-02-21 07:03:21 +02:00
|
|
|
mtd unlock mtd4
|
|
|
|
mount -t jffs2 /dev/mtdblock/4 /jffs
|
|
|
|
pivot_root /jffs /jffs/rom
|
2005-02-28 09:04:51 +02:00
|
|
|
mount none /dev -t devfs
|
|
|
|
mount none /proc -t proc
|
2005-03-01 08:56:22 +02:00
|
|
|
umount rom/proc rom/dev
|
2005-02-28 09:04:51 +02:00
|
|
|
fi
|
2005-02-06 02:52:16 +02:00
|
|
|
fi
|
2005-03-01 08:56:22 +02:00
|
|
|
mount none /tmp -t ramfs
|
2005-03-06 05:34:52 +02:00
|
|
|
mkdir -p /dev/pts
|
|
|
|
mount none /dev/pts -t devpts
|
2005-02-06 02:52:16 +02:00
|
|
|
exec /sbin/init
|