[openwrt/openwrt] base-files: remove fitblk_get_bootdev() from /lib/upgrade/common.sh

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


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

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

    base-files: remove fitblk_get_bootdev() from /lib/upgrade/common.sh
    
    The function was moved to /lib/upgrade/fit.sh which is part of the fitblk
    package. Remove it from /lib/upgrade/common.sh to safe space on boards
    not using unified uImage.FIT images.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/base-files/files/lib/upgrade/common.sh | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index ef8d01e168..718907a711 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -165,23 +165,6 @@ part_magic_fat() {
 	[ "$magic" = "FAT" ] || [ "$magic_fat32" = "FAT32" ]
 }
 
-fitblk_get_bootdev() {
-	[ -e /sys/firmware/devicetree/base/chosen/rootdisk ] || return
-
-	local rootdisk="$(cat /sys/firmware/devicetree/base/chosen/rootdisk)"
-	local handle bootdev
-	for handle in /sys/class/block/*/of_node/phandle /sys/class/block/*/device/of_node/phandle; do
-		[ ! -e "$handle" ] && continue
-		if [ "$rootdisk" = "$(cat $handle)" ]; then
-			bootdev="${handle%/of_node/phandle}"
-			bootdev="${bootdev%/device}"
-			bootdev="${bootdev#/sys/class/block/}"
-			echo "$bootdev"
-			break
-		fi
-	done
-}
-
 export_bootdevice() {
 	local cmdline uuid blockdev uevent line class
 	local MAJOR MINOR DEVNAME DEVTYPE




More information about the lede-commits mailing list