[openwrt/openwrt] uboot-envtools: use /lib/upgrade/fit.sh

LEDE Commits lede-commits at lists.infradead.org
Thu Jul 18 03:49:36 PDT 2024


dangole pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/386855dca80be0caae434412fc8373c15f72684d

commit 386855dca80be0caae434412fc8373c15f72684d
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Wed Jul 17 16:25:05 2024 +0100

    uboot-envtools: use /lib/upgrade/fit.sh
    
    Use export_fitblk_bootdev() in /lib/upgrade/fit.sh instead of now
    deprecated fitblk_get_bootdev() function. Include /lib/upgrade/fit.sh
    instead of /lib/upgrade/common.sh to allow removing the function there.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/boot/uboot-envtools/files/mediatek_filogic | 16 ++++++++--------
 package/boot/uboot-envtools/files/mediatek_mt7622  | 17 ++++++++---------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic
index 0e30c489c9..4d1016d412 100644
--- a/package/boot/uboot-envtools/files/mediatek_filogic
+++ b/package/boot/uboot-envtools/files/mediatek_filogic
@@ -41,17 +41,17 @@ bananapi,bpi-r3-mini|\
 bananapi,bpi-r4|\
 bananapi,bpi-r4-poe|\
 jdcloud,re-cp-03)
-	. /lib/upgrade/common.sh
-
-	bootdev="$(fitblk_get_bootdev)"
-	case "$bootdev" in
-	ubi*)
+	. /lib/upgrade/fit.sh
+	export_fitblk_bootdev
+	case "$CI_METHOD" in
+	ubi)
 		ubootenv_add_ubi_default
 		;;
-	mmc*)
-		ubootenv_add_mmc_default "${bootdev%%p[0-9]*}"
+	emmc)
+		bootdev=${EMMC_KERN_DEV%%p[0-9]*}
+		ubootenv_add_mmc_default "${bootdev#/dev/}"
 		;;
-	mtd*)
+	default)
 		ubootenv_add_nor_default
 		;;
 	esac
diff --git a/package/boot/uboot-envtools/files/mediatek_mt7622 b/package/boot/uboot-envtools/files/mediatek_mt7622
index 6698e06ee3..ae173fad61 100644
--- a/package/boot/uboot-envtools/files/mediatek_mt7622
+++ b/package/boot/uboot-envtools/files/mediatek_mt7622
@@ -31,17 +31,16 @@ dlink,eagle-pro-ai-m32-a1|\
 dlink,eagle-pro-ai-r32-a1)
 	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x2000" "0x2000"
 	;;
+bananapi,bpi-r64|\
 linksys,e8450-ubi)
-	ubootenv_add_ubi_default
-	;;
-bananapi,bpi-r64)
-	. /lib/upgrade/common.sh
-	bootdev="$(fitblk_get_bootdev)"
-	case "$bootdev" in
-	mmc*)
-		ubootenv_add_mmc_default "${bootdev%p[0-9]*}"
+	. /lib/upgrade/fit.sh
+	export_fitblk_bootdev
+	case "$CI_METHOD" in
+	emmc)
+		bootdev=${EMMC_KERN_DEV%%p[0-9]*}
+		ubootenv_add_mmc_default "${bootdev#/dev/}"
 		;;
-	ubi*)
+	ubi)
 		ubootenv_add_ubi_default
 		;;
 	esac




More information about the lede-commits mailing list