Commit b6f4cd57 authored by Rafał Miłecki's avatar Rafał Miłecki

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: default avatarRafał Miłecki <rafal@milecki.pl>
parent b534ba96
......@@ -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
......
......@@ -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
......@@ -43,7 +43,7 @@ mbl_do_upgrade() {
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
......
......@@ -45,7 +45,7 @@ platform_do_upgrade() {
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
......
......@@ -49,7 +49,7 @@ platform_do_upgrade_sdcard() {
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
......
......@@ -45,7 +45,7 @@ platform_do_upgrade() {
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
......
......@@ -45,7 +45,7 @@ platform_do_upgrade() {
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
......
......@@ -62,7 +62,7 @@ platform_do_upgrade() {
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
......
......@@ -54,7 +54,7 @@ platform_do_upgrade() {
sync
if [ "$SAVE_PARTITIONS" = "1" ]; then
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
get_partitions "/dev/$diskdev" bootdisk
#extract the boot sector from the image
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment