source: trunk/package/base-files/files/sbin/firstboot @ 19980

Last change on this file since 19980 was 19980, checked in by nico, 7 years ago

firstboot: detect mtd, rom & jffs parts first, fix jffs mounted test

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 623 bytes
Line 
1#!/bin/sh
2
3switch2jffs_hook=
4jffs2reset_hook=
5no_fo_hook=
6
7. /lib/functions/boot.sh
8
9firstboot_skip_next=false
10
11for fb_source_file in /lib/firstboot/*; do
12    . $fb_source_file
13done
14
15set_mtd_part
16set_rom_part
17set_jffs_part
18
19# invoked as an executable
20if [ "${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
33fi
34
Note: See TracBrowser for help on using the repository browser.