From 492db67f641a8938afe2647bd57e2373160e9088 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 23 Jan 2023 09:49:44 +0100 Subject: [PATCH] base-files: sysupgrade: always imply -n if -f is not provided This ensures that no random config giles get carried over. Signed-off-by: John Crispin --- ...-ignore-sysupgrade-that-was-not-ours.patch | 27 -------------- ...grade-always-assume-n-if-f-is-not-pr.patch | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 27 deletions(-) delete mode 100644 patches/base/0013-base-files-ignore-sysupgrade-that-was-not-ours.patch create mode 100644 patches/base/0013-base-files-sysupgrade-always-assume-n-if-f-is-not-pr.patch diff --git a/patches/base/0013-base-files-ignore-sysupgrade-that-was-not-ours.patch b/patches/base/0013-base-files-ignore-sysupgrade-that-was-not-ours.patch deleted file mode 100644 index 8f6c11d50..000000000 --- a/patches/base/0013-base-files-ignore-sysupgrade-that-was-not-ours.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 9fb93fbd42f8f1f3036580b6666b40ab343509f8 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Thu, 17 Jun 2021 08:47:51 +0200 -Subject: [PATCH 13/43] base-files: ignore sysupgrade that was not ours - -Signed-off-by: John Crispin ---- - package/base-files/files/lib/preinit/80_mount_root | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/package/base-files/files/lib/preinit/80_mount_root b/package/base-files/files/lib/preinit/80_mount_root -index 3f75411a43..7cf16e68e0 100644 ---- a/package/base-files/files/lib/preinit/80_mount_root -+++ b/package/base-files/files/lib/preinit/80_mount_root -@@ -17,7 +17,8 @@ missing_lines() { - do_mount_root() { - mount_root - boot_run_hook preinit_mount_root -- [ -f /sysupgrade.tgz ] && { -+ (tar tzf /sysupgrade.tgz | grep -q ucentral) 2> /dev/null -+ [ $? -eq 0 ] && { - echo "- config restore -" - cp /etc/passwd /etc/group /etc/shadow /tmp - cd / --- -2.25.1 - diff --git a/patches/base/0013-base-files-sysupgrade-always-assume-n-if-f-is-not-pr.patch b/patches/base/0013-base-files-sysupgrade-always-assume-n-if-f-is-not-pr.patch new file mode 100644 index 000000000..a3efd1bfe --- /dev/null +++ b/patches/base/0013-base-files-sysupgrade-always-assume-n-if-f-is-not-pr.patch @@ -0,0 +1,37 @@ +From 60cf08fa4ce44d7c3d3c6264a933f4c6e5b2e831 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Mon, 23 Jan 2023 09:47:54 +0100 +Subject: [PATCH] base-files: sysupgrade: always assume -n if -f is not + provided + +Signed-off-by: John Crispin +--- + 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 5a2d459013..f55237b935 100755 +--- a/package/base-files/files/sbin/sysupgrade ++++ b/package/base-files/files/sbin/sysupgrade +@@ -9,7 +9,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 +@@ -345,9 +345,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" +- export SAVE_CONFIG=1 + else + [ $TEST -eq 1 ] || rm -f "$CONF_TAR" + export SAVE_CONFIG=0 +-- +2.34.1 +