base-files: remove fitblk_get_bootdev() from /lib/upgrade/common.sh
authorDaniel Golle <daniel@makrotopia.org>
Wed, 17 Jul 2024 15:25:59 +0000 (16:25 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 18 Jul 2024 10:48:53 +0000 (11:48 +0100)
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@makrotopia.org>
package/base-files/files/lib/upgrade/common.sh

index ef8d01e16896f32bd2d75544f707d4497582fe88..718907a7111791a31406b53cc6584d9b315a1d51 100644 (file)
@@ -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