Changeset 29688


Ignore:
Timestamp:
2012-01-08T16:30:37+01:00 (6 years ago)
Author:
jow
Message:

[package] base-files: implement a --force option for sysupgrade to override image checks, useful to upgrade old ar71xx installations to current trunk ones

Location:
trunk/package/base-files
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/Makefile

    r29629 r29688  
    11# 
    2 # Copyright (C) 2007-2011 OpenWrt.org 
     2# Copyright (C) 2007-2012 OpenWrt.org 
    33# Copyright (C) 2010 Vertical Communications 
    44# 
     
    1111 
    1212PKG_NAME:=base-files 
    13 PKG_RELEASE:=100 
     13PKG_RELEASE:=101 
    1414 
    1515PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ 
  • trunk/package/base-files/files/sbin/sysupgrade

    r29587 r29688  
    1313export CONF_BACKUP= 
    1414export HELP=0 
     15export FORCE=0 
    1516 
    1617# parse options 
     
    2526                -b|--create-backup) export CONF_BACKUP="$2"; shift;; 
    2627                -f) export CONF_IMAGE="$2"; shift;; 
     28                -F|--force) export FORCE=1; shift;; 
    2729                -h|--help) export HELP=1; break;; 
    2830                -*) 
     
    5557                     i.e. stdout, verbosity is set to 0 (i.e. quiet). 
    5658        -n           do not save configuration over reflash 
     59        -F / --force 
     60                     Flash image even if image checks fail, this is dangerous! 
    5761        -q           less verbose 
    5862        -v           more verbose 
     
    130134for check in $sysupgrade_image_check; do 
    131135        ( eval "$check \"\$ARGV\"" ) || { 
    132                 echo "Image check '$check' failed." 
    133                 exit 1 
     136                if [ $FORCE -eq 1 ]; then 
     137                        echo "Image check '$check' failed but --force given - will update anyway!" 
     138                        break 
     139                else 
     140                        echo "Image check '$check' failed." 
     141                        exit 1 
     142                fi 
    134143        } 
    135144done 
Note: See TracChangeset for help on using the changeset viewer.