Changeset 35712


Ignore:
Timestamp:
2013-02-21T12:45:14+01:00 (5 years ago)
Author:
jogo
Message:

base-files: make firstboot ask for confirmation

To prevent accidential resets ask for confirmation (and default to n).

Signed-off-by: Jonas Gorski <jogo@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/files/sbin/firstboot

    r34794 r35712  
    2121    if [ "$1" = "switch2jffs" ]; then 
    2222        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 
    2823    else 
    29         mtd erase "$partname" 
    30         mount -o noatime "$mtdpart" /overlay -t jffs2 
    31         fopivot /overlay /rom 1 
     24        local input 
     25 
     26        echo -n  "firstboot will erase all settings and remove any installed packages. Are you sure? [N/y]" 
     27        read input 
     28        [ "$input" = "y" ] || [ "$input" = "Y" ] || return 0 
     29 
     30        if [ -n "$jffs" ]; then 
     31            reset_has_fo=true 
     32            echo "firstboot has already been run" 
     33            echo "jffs2 partition is mounted, only resetting files" 
     34            boot_run_hook jffs2reset 
     35        else 
     36            mtd erase "$partname" 
     37            mount -o noatime "$mtdpart" /overlay -t jffs2 
     38            fopivot /overlay /rom 1 
     39        fi 
    3240    fi 
    3341fi 
Note: See TracChangeset for help on using the changeset viewer.