From 2dd397b0f1bd9aa6d8355d4dea10c377dafb91d6 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Sat, 20 Jul 2013 23:06:51 +0200 Subject: [PATCH] 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 --- .../root_file_system/etc/sysupgrade.conf | 1 + build_patches/sysupgrade_no_config_save.patch | 27 +++++++------------ 2 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 bsp/default/root_file_system/etc/sysupgrade.conf diff --git a/bsp/default/root_file_system/etc/sysupgrade.conf b/bsp/default/root_file_system/etc/sysupgrade.conf new file mode 100644 index 0000000..25b1109 --- /dev/null +++ b/bsp/default/root_file_system/etc/sysupgrade.conf @@ -0,0 +1 @@ +/etc/shadow diff --git a/build_patches/sysupgrade_no_config_save.patch b/build_patches/sysupgrade_no_config_save.patch index a49a43b..890b3b5 100644 --- a/build_patches/sysupgrade_no_config_save.patch +++ b/build_patches/sysupgrade_no_config_save.patch @@ -1,20 +1,13 @@ 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) -@@ -76,6 +76,15 @@ - exit 1 - } - -+if [ "$SAVE_CONFIG" = "1" -a "$FORCE" = "0" ]; then -+ echo "Please let the image serve you with a new config." -+ echo "Use -n flag to get the new config!" -+ echo "" -+ echo "If you don't want to flash a Freifunk-Image you can force" -+ 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. +@@ -90,7 +90,7 @@ + add_uci_conffiles() { + local file="$1" + ( find $(sed -ne '/^[[:space:]]*$/d; /^#/d; p' \ +- /etc/sysupgrade.conf /lib/upgrade/keep.d/* 2>/dev/null) \ ++ /etc/sysupgrade.conf 2>/dev/null) \ + -type f 2>/dev/null; + opkg list-changed-conffiles ) | sort -u > "$file" + return 0