[][OpenWrt Dev][Add support for mmc dual-boot to reserve rootfs_data]
[Description]
Add support for mmc dual-boot to reserve rootfs_data
[Release-log]
N/A
Change-Id: Icec46b6ce94b85c72baabf5523919476cc452ba7
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6105791
diff --git a/target/linux/mediatek/base-files/lib/upgrade/mmc.sh b/target/linux/mediatek/base-files/lib/upgrade/mmc.sh
index de7086b..b7cfdaf 100644
--- a/target/linux/mediatek/base-files/lib/upgrade/mmc.sh
+++ b/target/linux/mediatek/base-files/lib/upgrade/mmc.sh
@@ -135,6 +135,7 @@
local kernel_dev=
local rootfs_dev=
local rootfs_data_dev=
+ local reserve_rootfs_data=$(cat /sys/module/boot_param/parameters/reserve_rootfs_data 2>/dev/null)
local board_dir=$(tar tf ${tar_file} | grep -m 1 '^sysupgrade-.*/$')
board_dir=${board_dir%/}
@@ -172,6 +173,12 @@
fw_setenv "dual_boot.slot_${upgrade_image_slot}_invalid" "0"
}
+ if [ x"${reserve_rootfs_data}" = xY ]; then
+ # Do not touch rootfs_data
+ sync
+ return 0
+ fi
+
rootfs_data_dev=$(cat /sys/module/boot_param/parameters/rootfs_data_part 2>/dev/null)
[ -z "${rootfs_data_dev}" -o $? -ne 0 ] && return 0