From 317598bed2a179e0c0e77f49cadc6a275db597a1 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 16 May 2025 01:52:53 +0100 Subject: [PATCH] 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 --- utils/uvol/Makefile | 4 ++-- utils/uvol/files/autopart.defaults | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/utils/uvol/Makefile b/utils/uvol/Makefile index 1524fc16f5..5c0b3d307a 100644 --- a/utils/uvol/Makefile +++ b/utils/uvol/Makefile @@ -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 PKG_LICENSE:=GPL-2.0-or-later diff --git a/utils/uvol/files/autopart.defaults b/utils/uvol/files/autopart.defaults index b403dd6df6..10119ce265 100644 --- a/utils/uvol/files/autopart.defaults +++ b/utils/uvol/files/autopart.defaults @@ -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")"