aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-08-16 17:02:58 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-08-22 13:47:51 +0200
commitb6f4cd57e19a8cfcd9ff52582b65164ce6213c3d (patch)
tree35d7185909c4cbc7b44b028e0e551b07aff26b13 /package
parentb534ba96110012d2697d19d71b7dcd60bd4cd375 (diff)
downloadupstream-b6f4cd57e19a8cfcd9ff52582b65164ce6213c3d.tar.gz
upstream-b6f4cd57e19a8cfcd9ff52582b65164ce6213c3d.tar.bz2
upstream-b6f4cd57e19a8cfcd9ff52582b65164ce6213c3d.zip
treewide: sysupgrade: pass "save_partitions" option to the "sysupgrade" method
This explicitly lets stage2 know if partitions should be preserved. No more "touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap" hack. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package')
-rwxr-xr-xpackage/base-files/files/lib/upgrade/stage25
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade9
2 files changed, 2 insertions, 12 deletions
diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index 4e5837af83..ff2a9aee05 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -6,8 +6,6 @@
export IMAGE="$1"
COMMAND="$2"
-export SAVE_PARTITIONS=1
-
export INTERACTIVE=0
export VERBOSE=1
export CONFFILES=/tmp/sysupgrade.conffiles
@@ -16,9 +14,6 @@ export CONF_TAR=/tmp/sysupgrade.tgz
RAMFS_COPY_BIN= # extra programs for temporary ramfs root
RAMFS_COPY_DATA= # extra data files
-
-[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0
-
include /lib/upgrade
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 15514159b3..c27c1fbc47 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -351,12 +351,6 @@ if [ $TEST -eq 1 ]; then
exit 0
fi
-if [ $SAVE_PARTITIONS -eq 0 ]; then
- touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap
-else
- rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap
-fi
-
install_bin /sbin/upgraded
v "Commencing upgrade. Closing all shell sessions."
@@ -371,7 +365,8 @@ else
\"path\": $(json_string "$IMAGE"),
\"command\": $(json_string "$COMMAND"),
\"options\": {
- \"save_config\": $SAVE_CONFIG
+ \"save_config\": $SAVE_CONFIG,
+ \"save_partitions\": $SAVE_PARTITIONS
}
}"
fi