firstboot: detect mtd, rom & jffs parts first, fix jffs mounted test
[openwrt.git] / package / base-files / files / sbin / firstboot
1 #!/bin/sh
2
3 switch2jffs_hook=
4 jffs2reset_hook=
5 no_fo_hook=
6
7 . /lib/functions/boot.sh
8
9 firstboot_skip_next=false
10
11 for fb_source_file in /lib/firstboot/*; do
12 . $fb_source_file
13 done
14
15 set_mtd_part
16 set_rom_part
17 set_jffs_part
18
19 # invoked as an executable
20 if [ "${0##*/}" = "firstboot" ]; then
21 if [ "$1" = "switch2jffs" ]; then
22 boot_run_hook switch2jffs
23 elif [ -n "$jffs" ]; then
24 reset_has_fo=true
25 echo "firstboot has already been run"
26 echo "jffs2 partition is mounted, only resetting files"
27 boot_run_hook jffs2reset
28 else
29 mtd erase "$partname"
30 mount "$mtdpart" /jffs -t jffs2
31 fopivot /jffs /rom 1
32 fi
33 fi
34
This page took 0.068692 seconds and 5 git commands to generate.