2007-03-02 03:23:36 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-01-25 19:11:17 +02:00
|
|
|
switch2jffs_hook=
|
|
|
|
jffs2reset_hook=
|
|
|
|
no_fo_hook=
|
2007-03-02 03:23:36 +02:00
|
|
|
|
2010-01-25 19:11:17 +02:00
|
|
|
. /lib/functions/boot.sh
|
2007-03-02 03:23:36 +02:00
|
|
|
|
2010-01-25 19:11:17 +02:00
|
|
|
firstboot_skip_next=false
|
2007-03-02 03:23:36 +02:00
|
|
|
|
2010-01-25 19:11:17 +02:00
|
|
|
for fb_source_file in /lib/firstboot/*; do
|
|
|
|
. $fb_source_file
|
|
|
|
done
|
2007-03-02 03:23:36 +02:00
|
|
|
|
2010-03-05 02:53:51 +02:00
|
|
|
set_mtd_part
|
|
|
|
set_rom_part
|
|
|
|
set_jffs_part
|
|
|
|
|
2007-03-02 03:23:36 +02:00
|
|
|
# invoked as an executable
|
2010-01-25 19:11:17 +02:00
|
|
|
if [ "${0##*/}" = "firstboot" ]; then
|
|
|
|
if [ "$1" = "switch2jffs" ]; then
|
|
|
|
boot_run_hook switch2jffs
|
2010-03-05 02:53:51 +02:00
|
|
|
elif [ -n "$jffs" ]; then
|
2010-01-25 19:11:17 +02:00
|
|
|
reset_has_fo=true
|
|
|
|
echo "firstboot has already been run"
|
|
|
|
echo "jffs2 partition is mounted, only resetting files"
|
|
|
|
boot_run_hook jffs2reset
|
|
|
|
else
|
2007-03-02 03:23:36 +02:00
|
|
|
mtd erase "$partname"
|
2012-12-19 18:07:46 +02:00
|
|
|
mount -o noatime "$mtdpart" /overlay -t jffs2
|
2010-03-21 19:16:50 +02:00
|
|
|
fopivot /overlay /rom 1
|
2010-01-25 19:11:17 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|