patches: carry forward sysupgrade safety flag (0017)

Makes sysupgrade default to not preserving configuration unless explicitly requested with -f flag.

Renumbered from patches/0013.

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2025-10-19 00:00:00 +02:00
parent a84610bbf1
commit fbf236413b

View File

@@ -1,33 +1,35 @@
From 15b8909db31a2dfdfc73c7e62e4decbad83e8c73 Mon Sep 17 00:00:00 2001
From 2bd4d99a32461dad09deb0b0db933b4a650ad1ef Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Mon, 23 Jan 2023 09:47:54 +0100
Subject: [PATCH 13/68] base-files: sysupgrade: always assume -n if -f is not
Date: Fri, 1 Aug 2025 07:44:42 +0200
Subject: [PATCH 17/55] base-files: sysupgrade: always assume -n if -f is not
provided
Changes sysupgrade default behaviour to not preserve configuration unless explicitly requested with -f flag, avoiding config carry-over during firmware updates in managed environments.
Signed-off-by: John Crispin <john@phrozen.org>
---
package/base-files/files/sbin/sysupgrade | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 9315091302..3fc4fcf25c 100755
index 611d8830bf..9bdbe9f625 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -9,7 +9,7 @@ export MTD_ARGS=""
@@ -29,7 +29,7 @@ export MTD_ARGS=""
export MTD_CONFIG_ARGS=""
export INTERACTIVE=0
export VERBOSE=1
-export SAVE_CONFIG=1
+export SAVE_CONFIG=0
export SAVE_OVERLAY=0
export SAVE_OVERLAY_PATH=
export SAVE_PARTITIONS=1
@@ -349,9 +349,6 @@ if [ -n "$CONF_IMAGE" ]; then
export IGNORE_MINOR_COMPAT=0
export FORCE=0
export CONFFILES=/tmp/sysupgrade.conffiles
@@ -389,9 +389,6 @@ if [ -n "$CONF_IMAGE" ]; then
esac
get_image "$CONF_IMAGE" "cat" > "$CONF_TAR"
export SAVE_CONFIG=1
-elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then
- [ $TEST -eq 1 ] || do_save_conffiles "$CONF_TAR"
- [ $TEST -eq 1 ] || create_backup_archive "$CONF_TAR" || exit
- export SAVE_CONFIG=1
else
[ $TEST -eq 1 ] || rm -f "$CONF_TAR"