Preserve /etc/shadow to save password over reflash

With this change, the sysupgrade should be run without -n flag.
But only if this code runs already on the device.

Signed-off-by: Tim Niemeyer <tim@fipux.org>
This commit is contained in:
Tim Niemeyer 2013-07-20 23:06:51 +02:00 committed by Tim Niemeyer
parent 1f189ca402
commit 2dd397b0f1
2 changed files with 11 additions and 17 deletions

View File

@ -0,0 +1 @@
/etc/shadow

View File

@ -1,20 +1,13 @@
Index: package/base-files/files/sbin/sysupgrade Index: package/base-files/files/sbin/sysupgrade
=================================================================== ===================================================================
--- package/base-files/files/sbin/sysupgrade (Revision 35186) --- package/base-files/files/sbin/sysupgrade (Revision 35298)
+++ package/base-files/files/sbin/sysupgrade (Arbeitskopie) +++ package/base-files/files/sbin/sysupgrade (Arbeitskopie)
@@ -76,6 +76,15 @@ @@ -90,7 +90,7 @@
exit 1 add_uci_conffiles() {
} local file="$1"
( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \
+if [ "$SAVE_CONFIG" = "1" -a "$FORCE" = "0" ]; then - /etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \
+ echo "Please let the image serve you with a new config." + /etc/sysupgrade.conf 2>/dev/null) \
+ echo "Use -n flag to get the new config!" -type f 2>/dev/null;
+ echo "" opkg list-changed-conffiles ) | sort -u > "$file"
+ echo "If you don't want to flash a Freifunk-Image you can force" return 0
+ echo "a sysupgrade without -n using the -F parameter."
+ exit 1
+fi
+
[ -n "$ARGV" -a -n "$NEED_IMAGE" ] && {
cat <<-EOF
-b|--create-backup and -r|--restore-backup do not perform a firmware upgrade.