5 mtdpart
="$(find_mtd_part $partname)"
9 rom
=$
(awk '/squashfs/ {print $2}' /proc
/mounts
)
13 jffs
=$
(awk '/jffs2/ {print $2}' /proc
/mounts
)
16 determine_mtd_part
() {
18 if [ -z "$mtdpart" ]; then
19 echo "MTD partition not found."
24 determine_rom_part
() {
27 if [ -z "$rom" ]; then
28 echo "You do not have a squashfs partition; aborting"
29 echo "(firstboot cannot be run on jffs2 based firmwares)"
35 determine_jffs2_part
() {
41 boot_hook_add switch2jffs determine_mtd_part
42 boot_hook_add jffs2reset determine_mtd_part
43 boot_hook_add switch2jffs determine_rom_part
44 boot_hook_add jffs2reset determine_rom_part
45 boot_hook_add switch2jffs determine_jffs2_part
46 boot_hook_add jffs2reset determine_jffs2_part