5 RAMFS_COPY_BIN
="" # extra programs for temporary ramfs root
6 RAMFS_COPY_DATA
="" # extra data files
14 -i) export INTERACTIVE
=1;;
15 -v) export VERBOSE
="$(($VERBOSE + 1))";;
16 -q) export VERBOSE
="$(($VERBOSE - 1))";;
18 echo "Invalid option: $1"
26 export CONFFILES
=/tmp
/sysupgrade.conffiles
27 export CONF_TAR
=/tmp
/sysupgrade.tgz
34 Usage: $0 [options] <image file or URL>
47 find /etc
/config
> "$file"
52 sysupgrade_image_check
="platform_check_image"
53 sysupgrade_init_conffiles
="add_uci_conffiles"
58 [ -z "$(rootfs_type)" ] && {
59 echo "Cannot save config while running from ramdisk."
60 ask_bool
0 "Abort" && exit
63 run_hooks
"$CONFFILES" $sysupgrade_init_conffiles
64 ask_bool
0 "Edit config file list" && vi
"$CONFFILES"
66 v
"Saving config files..."
67 [ "$VERBOSE" -gt 1 ] && TAR_V
="v" || TAR_V
=""
68 tar c
${TAR_V}zf
"$CONF_TAR" -T "$CONFFILES" 2>/dev
/null
71 type platform_check_image
>/dev
/null
2>/dev
/null ||
{
72 echo "Firmware upgrade is not implemented for this platform."
76 for check
in $sysupgrade_image_check; do
77 ( eval "$check \"\$ARGV\"" ) ||
{
78 echo "Image check '$check' failed."
83 if ask_bool
$SAVE_CONFIG "Keep config files over reflash"; then
89 run_hooks
"" $sysupgrade_pre_upgrade
91 v
"Switching to ramdisk..."
92 run_ramfs
'. /etc/functions.sh; include /lib/upgrade; do_upgrade'