From e55853db908abeda7a0c436fb04ac5e6c8fdafe1 Mon Sep 17 00:00:00 2001 From: Tim Niemeyer Date: Sat, 17 Nov 2012 22:55:02 +0100 Subject: [PATCH] sysupgrade: force the user to use -n flag A router image always brings its own config. There is no user config, and so the configs should always be overwritten! Signed-off-by: Tim Niemeyer --- build_patches/sysupgrade_no_config_save.patch | 20 +++++++++++++++++++ buildscript | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 build_patches/sysupgrade_no_config_save.patch diff --git a/build_patches/sysupgrade_no_config_save.patch b/build_patches/sysupgrade_no_config_save.patch new file mode 100644 index 0000000..619c704 --- /dev/null +++ b/build_patches/sysupgrade_no_config_save.patch @@ -0,0 +1,20 @@ +Index: package/base-files/files/sbin/sysupgrade +=================================================================== +--- package/base-files/files/sbin/sysupgrade (Revision 33502) ++++ package/base-files/files/sbin/sysupgrade (Arbeitskopie) +@@ -72,6 +72,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 "$CONF_BACKUP" ] && { + cat <<-EOF + -b/--create-backup does not perform a firmware upgrade. Do not diff --git a/buildscript b/buildscript index 54fec69..7bbbaa1 100755 --- a/buildscript +++ b/buildscript @@ -16,6 +16,9 @@ prepare() { $target/scripts/feeds install -a + # This changes the default behavior of sysupgrade to not save the config + cat build_patches/sysupgrade_no_config_save.patch | patch -p0 -d $target + board_prepare }