firstboot 629 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. switch2jffs_hook=
  3. jffs2reset_hook=
  4. no_fo_hook=
  5. . /lib/functions/boot.sh
  6. firstboot_skip_next=false
  7. for fb_source_file in /lib/firstboot/*; do
  8. . $fb_source_file
  9. done
  10. set_mtd_part
  11. set_rom_part
  12. set_jffs_part
  13. # invoked as an executable
  14. if [ "${0##*/}" = "firstboot" ]; then
  15. if [ "$1" = "switch2jffs" ]; then
  16. boot_run_hook switch2jffs
  17. elif [ -n "$jffs" ]; then
  18. reset_has_fo=true
  19. echo "firstboot has already been run"
  20. echo "jffs2 partition is mounted, only resetting files"
  21. boot_run_hook jffs2reset
  22. else
  23. mtd erase "$partname"
  24. mount "$mtdpart" /overlay -t jffs2
  25. fopivot /overlay /rom 1
  26. fi
  27. fi