uvol: fix autopart on devices using fitblk
authorDaniel Golle <redacted>
Fri, 16 May 2025 00:52:53 +0000 (01:52 +0100)
committerDaniel Golle <redacted>
Sun, 8 Jun 2025 21:15:39 +0000 (23:15 +0200)
Correctly detect the block device used for booting also on devices
using the new fitblk driver.

Signed-off-by: Daniel Golle <redacted>
utils/uvol/Makefile
utils/uvol/files/autopart.defaults

index 1524fc16f5b537a1b990e02bbc80a21db7e46f1a..5c0b3d307a34faede40527f0b12fc9f765ed3f8e 100644 (file)
@@ -1,8 +1,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uvol
-PKG_VERSION:=0.9
-PKG_RELEASE:=3
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 PKG_LICENSE:=GPL-2.0-or-later
index b403dd6df6205ddcc7b63e88e532fb422fcd5c38..10119ce26513e46b9a004fd7e860c04ebeb7e9c3 100644 (file)
@@ -91,12 +91,22 @@ lvm_init() {
 }
 
 autopart_init() {
-       local diskdev
+       local fitpart diskdev
        local lvmpart
        local diskserial diskhash
 
-       export_bootdevice && export_partdevice diskdev 0
-
+       if [ -e "/lib/upgrade/fit.sh" ]; then
+               . /lib/upgrade/fit.sh
+               export_fitblk_bootdev
+               if [ "$EMMC_KERN_DEV" ]; then
+                       for fitpart in /sys/class/block/*/${EMMC_KERN_DEV:5}; do
+                               [ -e "$fitpart" ] || continue
+                               diskdev="${fitpart%/*}"
+                               diskdev="${diskdev##*/}"
+                       done
+               fi
+       fi
+       [ "$diskdev" ] || export_bootdevice && export_partdevice diskdev 0
        [ "$diskdev" ] || return
 
        [ -e "/sys/class/block/$diskdev/device/serial" ] && diskserial="$(cat "/sys/class/block/$diskdev/device/serial")"
git clone https://git.99rst.org/PROJECT