projects
/
openwrt
/
staging
/
jow.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
base-files: fix sysupgrade -b/-l when -c is used
[openwrt/staging/jow.git]
/
package
/
base-files
/
files
/
sbin
/
sysupgrade
diff --git
a/package/base-files/files/sbin/sysupgrade
b/package/base-files/files/sbin/sysupgrade
index 359f21f51c3d5491f8bfcc9bf96819d2e91c11cc..3fd612c37572aaf3884ccfb23f7592dbdd66b9f6 100755
(executable)
--- a/
package/base-files/files/sbin/sysupgrade
+++ b/
package/base-files/files/sbin/sysupgrade
@@
-108,14
+108,8
@@
add_uci_conffiles() {
add_overlayfiles() {
local file="$1"
add_overlayfiles() {
local file="$1"
- if [ -d /overlay/upper ]; then
- local overlaydir="/overlay/upper"
- else
- local overlaydir="/overlay"
- fi
- find $overlaydir/etc/ -type f -o -type l | sed \
+ find /overlay/upper/etc/ -type f -o -type l | sed \
-e 's,^/overlay\/upper/,/,' \
-e 's,^/overlay\/upper/,/,' \
- -e 's,^/overlay/,/,' \
-e '\,/META_[a-zA-Z0-9]*$,d' \
-e '\,/functions.sh$,d' \
-e '\,/[^/]*-opkg$,d' \
-e '\,/META_[a-zA-Z0-9]*$,d' \
-e '\,/functions.sh$,d' \
-e '\,/[^/]*-opkg$,d' \
@@
-126,9
+120,16
@@
add_overlayfiles() {
# hooks
sysupgrade_image_check="fwtool_check_image platform_check_image"
sysupgrade_pre_upgrade="fwtool_pre_upgrade"
# hooks
sysupgrade_image_check="fwtool_check_image platform_check_image"
sysupgrade_pre_upgrade="fwtool_pre_upgrade"
-[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \
- sysupgrade_init_conffiles="add_uci_conffiles" || \
+
+if [ $SAVE_OVERLAY = 1 ]; then
+ [ ! -d /overlay/upper/etc ] && {
+ echo "Cannot find '/overlay/upper/etc', required for '-c'"
+ exit 1
+ }
sysupgrade_init_conffiles="add_overlayfiles"
sysupgrade_init_conffiles="add_overlayfiles"
+else
+ sysupgrade_init_conffiles="add_uci_conffiles"
+fi
include /lib/upgrade
include /lib/upgrade
@@
-152,7
+153,7
@@
do_save_conffiles() {
}
if [ $CONF_BACKUP_LIST -eq 1 ]; then
}
if [ $CONF_BACKUP_LIST -eq 1 ]; then
- add_uci_conffiles "$CONFFILES"
+ run_hooks "$CONFFILES" $sysupgrade_init_conffiles
cat "$CONFFILES"
rm -f "$CONFFILES"
exit 0
cat "$CONFFILES"
rm -f "$CONFFILES"
exit 0