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 <nbd@nbd.name>
This commit is contained in:
Felix Fietkau committed 2026-09-29 17:29:25 +02:00
1 parent 83e7914958
commit 725a1dc534
1 file changed
+5 -2
+5 -2
View File
@@ -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