uvol: fix autopart on devices using fitblk

Correctly detect the block device used for booting also on devices
using the new fitblk driver.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle
2025-05-16 01:52:53 +01:00
parent 9f94448b71
commit 317598bed2
2 changed files with 15 additions and 5 deletions

View 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

View 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")"