2007-03-02 01:23:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-01-25 17:11:17 +00:00
|
|
|
switch2jffs_hook=
|
|
|
|
jffs2reset_hook=
|
|
|
|
no_fo_hook=
|
2007-03-02 01:23:36 +00:00
|
|
|
|
2010-01-25 17:11:17 +00:00
|
|
|
. /lib/functions/boot.sh
|
2007-03-02 01:23:36 +00:00
|
|
|
|
2010-01-25 17:11:17 +00:00
|
|
|
firstboot_skip_next=false
|
2007-03-02 01:23:36 +00:00
|
|
|
|
2010-01-25 17:11:17 +00:00
|
|
|
for fb_source_file in /lib/firstboot/*; do
|
|
|
|
. $fb_source_file
|
|
|
|
done
|
2007-03-02 01:23:36 +00:00
|
|
|
|
2010-03-05 00:53:51 +00:00
|
|
|
set_mtd_part
|
|
|
|
set_rom_part
|
|
|
|
set_jffs_part
|
|
|
|
|
2007-03-02 01:23:36 +00:00
|
|
|
# invoked as an executable
|
2010-01-25 17:11:17 +00:00
|
|
|
if [ "${0##*/}" = "firstboot" ]; then
|
|
|
|
if [ "$1" = "switch2jffs" ]; then
|
|
|
|
boot_run_hook switch2jffs
|
2010-03-05 00:53:51 +00:00
|
|
|
elif [ -n "$jffs" ]; then
|
2010-01-25 17:11:17 +00: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 01:23:36 +00:00
|
|
|
mtd erase "$partname"
|
2010-03-21 17:16:50 +00:00
|
|
|
mount "$mtdpart" /overlay -t jffs2
|
|
|
|
fopivot /overlay /rom 1
|
2010-01-25 17:11:17 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|