From: Paul Spooren Date: Tue, 16 Jun 2026 14:04:48 +0000 (+0200) Subject: Revert "base-files: support rootfs_data on its own partition" X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ee64a736cda7ff8d5e92a5f4baf2d9ae612261b;p=thirdparty%2Fopenwrt.git Revert "base-files: support rootfs_data on its own partition" This reverts commit 13fc688f033895e0ba91c1d752ffd63a06760ef5. Wrong Signed-off-by line was used, reverting and re-applying. Signed-off-by: Paul Spooren --- diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index e4a255b9c0e..22f9cce42a5 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -7,9 +7,8 @@ CI_KERNPART="${CI_KERNPART:-kernel}" # 'ubi' partition on NAND contains UBI -# If individual UBI volumes are on different partitions, -# they can be set with CI_KERN_UBIPART, CI_ROOT_UBIPART and/or -# CI_DATA_UBIPART. +# There are also CI_KERN_UBIPART and CI_ROOT_UBIPART if kernel +# and rootfs are on separated UBIs. CI_UBIPART="${CI_UBIPART:-ubi}" # 'rootfs' UBI volume on NAND contains the rootfs @@ -78,10 +77,9 @@ identify_if_gzip() { } nand_restore_config() { - local ubidev=$( nand_find_ubi "${CI_DATA_UBIPART:-$CI_UBIPART}" ) + local ubidev=$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" ) local ubivol="$( nand_find_volume $ubidev rootfs_data )" if [ ! "$ubivol" ]; then - local ubidev=$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" ) ubivol="$( nand_find_volume $ubidev "$CI_ROOTPART" )" if [ ! "$ubivol" ]; then echo "cannot find ubifs data volume" @@ -190,21 +188,23 @@ nand_upgrade_prepare_ubi() { local has_env="${4:-0}" local kern_ubidev local root_ubidev - local data_ubidev [ -n "$rootfs_length" -o -n "$kernel_length" ] || return 1 - # Attach UBI partitions (might be identical, but nand_attach_ubi handles that) - kern_ubidev="$( nand_attach_ubi "${CI_KERN_UBIPART:-$CI_UBIPART}" "$has_env" )" - [ -n "$kern_ubidev" ] || return 1 - root_ubidev="$( nand_attach_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" )" - [ -n "$root_ubidev" ] || return 1 - data_ubidev="$( nand_attach_ubi "${CI_DATA_UBIPART:-$CI_UBIPART}" )" - [ -n "$data_ubidev" ] || return 1 + if [ -n "$CI_KERN_UBIPART" -a -n "$CI_ROOT_UBIPART" ]; then + kern_ubidev="$( nand_attach_ubi "$CI_KERN_UBIPART" "$has_env" )" + [ -n "$kern_ubidev" ] || return 1 + root_ubidev="$( nand_attach_ubi "$CI_ROOT_UBIPART" )" + [ -n "$root_ubidev" ] || return 1 + else + kern_ubidev="$( nand_attach_ubi "$CI_UBIPART" "$has_env" )" + [ -n "$kern_ubidev" ] || return 1 + root_ubidev="$kern_ubidev" + fi local kern_ubivol="$( nand_find_volume $kern_ubidev "$CI_KERNPART" )" local root_ubivol="$( nand_find_volume $root_ubidev "$CI_ROOTPART" )" - local data_ubivol="$( nand_find_volume $data_ubidev rootfs_data )" + local data_ubivol="$( nand_find_volume $root_ubidev rootfs_data )" [ "$root_ubivol" = "$kern_ubivol" ] && root_ubivol= # remove ubiblocks @@ -215,7 +215,7 @@ nand_upgrade_prepare_ubi() { # kill volumes [ "$kern_ubivol" ] && ubirmvol /dev/$kern_ubidev -N "$CI_KERNPART" || : [ "$root_ubivol" ] && ubirmvol /dev/$root_ubidev -N "$CI_ROOTPART" || : - [ "$data_ubivol" ] && ubirmvol /dev/$data_ubidev -N rootfs_data || : + [ "$data_ubivol" ] && ubirmvol /dev/$root_ubidev -N rootfs_data || : # create provisioning vol if [ "${UPGRADE_OPT_ADD_PROVISIONING:-0}" -gt 0 ]; then @@ -255,8 +255,8 @@ nand_upgrade_prepare_ubi() { if [ -n "$rootfs_data_max" ]; then rootfs_data_size_param="-s $rootfs_data_max" fi - if ! ubimkvol /dev/$data_ubidev -N rootfs_data $rootfs_data_size_param; then - if ! ubimkvol /dev/$data_ubidev -N rootfs_data -m; then + if ! ubimkvol /dev/$root_ubidev -N rootfs_data $rootfs_data_size_param; then + if ! ubimkvol /dev/$root_ubidev -N rootfs_data -m; then echo "cannot initialize rootfs_data volume" return 1 fi @@ -288,8 +288,8 @@ nand_upgrade_ubifs() { nand_upgrade_prepare_ubi "$ubifs_length" "ubifs" "" "" || return 1 - local root_ubidev="$( nand_find_ubi "${CI_ROOT_UBIPART:-$CI_UBIPART}" )" - local root_ubivol="$(nand_find_volume $root_ubidev "$CI_ROOTPART")" + local ubidev="$( nand_find_ubi "$CI_UBIPART" )" + local root_ubivol="$(nand_find_volume $ubidev "$CI_ROOTPART")" $cmd < "$ubifs_file" | ubiupdatevol /dev/$root_ubivol -s "$ubifs_length" - } @@ -302,7 +302,7 @@ nand_upgrade_fit() { nand_upgrade_prepare_ubi "" "" "$fit_length" "1" || return 1 - local fit_ubidev="$(nand_find_ubi "${CI_KERN_UBIPART:-$CI_UBIPART}")" + local fit_ubidev="$(nand_find_ubi "$CI_UBIPART")" local fit_ubivol="$(nand_find_volume $fit_ubidev "$CI_KERNPART")" $cmd < "$fit_file" | ubiupdatevol /dev/$fit_ubivol -s "$fit_length" - } diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index 80fbfb24c84..8bd2084f6b5 100644 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -228,7 +228,6 @@ platform_do_upgrade() { xiaomi,redmi-router-ax6000-stock) CI_KERN_UBIPART="ubi_kernel" CI_ROOT_UBIPART="ubi" - CI_DATA_UBIPART="ubi" nand_do_upgrade "$1" ;; buffalo,wsr-6000ax8|\ diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh index 10078eec9a9..a30f4bc1e22 100755 --- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh +++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh @@ -29,7 +29,6 @@ platform_do_upgrade() { CI_KERNPART=boot CI_KERN_UBIPART=ubi_kernel CI_ROOT_UBIPART=ubi - CI_DATA_UBIPART=ubi nand_do_upgrade "$1" ;; buffalo,ls421de|\ diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh index 13ccc3986ec..a5a4dc5bbb7 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh @@ -229,7 +229,6 @@ platform_do_upgrade() { # Kernel and rootfs are placed in 2 different UBI CI_KERN_UBIPART="ubi_kernel" CI_ROOT_UBIPART="rootfs" - CI_DATA_UBIPART="rootfs" nand_do_upgrade "$1" ;; yuncore,ax830|\ diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index f4963e1b3ba..9bece63345b 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -200,7 +200,6 @@ platform_do_upgrade() { buffalo,wxr-5950ax12) CI_KERN_UBIPART="rootfs" CI_ROOT_UBIPART="user_property" - CI_DATA_UBIPART="user_property" buffalo_upgrade_prepare nand_do_flash_file "$1" || nand_do_upgrade_failed nand_do_restore_config || nand_do_upgrade_failed @@ -259,7 +258,6 @@ platform_do_upgrade() { # Kernel and rootfs are placed in 2 different UBI CI_KERN_UBIPART="ubi_kernel" CI_ROOT_UBIPART="rootfs" - CI_DATA_UBIPART="rootfs" nand_do_upgrade "$1" ;; spectrum,sax1v1k) @@ -304,7 +302,6 @@ platform_do_upgrade() { zte,mf269) CI_KERN_UBIPART="ubi_kernel" CI_ROOT_UBIPART="rootfs" - CI_DATA_UBIPART="rootfs" nand_do_upgrade "$1" ;; zyxel,nbg7815)