From 725a1dc534a1ad1008ae0412925100fef66a776f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 13 Sep 2026 08:50:26 +0200 Subject: [PATCH] base-files: create the provisioning partition on sysupgrade by default The partition holds data that must survive a factory reset, so a device needs it before the data exists, not after. Waiting for the user to pass -P means the partition is missing on exactly the devices that were never flashed with it in mind. The partition is only created if it does not exist yet, and --no-provisioning turns the behaviour off. Signed-off-by: Felix Fietkau --- package/base-files/files/sbin/sysupgrade | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 68ab9c63b3f..8aabad75a42 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -11,7 +11,7 @@ INSTALLED_PACKAGES=${ETCBACKUP_DIR}/installed_packages.txt COMMAND=/lib/upgrade/do_stage2 # File-local globals -ADD_PROVISIONING=0 +ADD_PROVISIONING=1 SAVE_OVERLAY=0 SAVE_OVERLAY_PATH= SAVE_PARTITIONS=1 @@ -47,6 +47,7 @@ while [ -n "$1" ]; do -o) SAVE_OVERLAY=1 SAVE_OVERLAY_PATH=/;; -p) SAVE_PARTITIONS=0;; -P) ADD_PROVISIONING=1;; + --no-provisioning) ADD_PROVISIONING=0;; -k) SAVE_INSTALLED_PKGS=1;; -u) SKIP_UNCHANGED=1;; -b|--create-backup) CONF_BACKUP="$2" NEED_IMAGE=1; shift;; @@ -85,7 +86,9 @@ upgrade-option: $INSTALLED_PACKAGES -s stay on current partition (for dual firmware devices) -P create provisioning partition to keep sensitive data across - factory resets. + factory resets. This is the default. + --no-provisioning + do not create a provisioning partition. -T | --test Verify image and config .tar.gz but do not actually flash. -F | --force