From: Daniel Golle Date: Fri, 16 May 2025 00:52:53 +0000 (+0100) Subject: uvol: fix autopart on devices using fitblk X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=317598bed2a179e0c0e77f49cadc6a275db597a1;p=openwrt-packages.git 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 --- diff --git a/utils/uvol/Makefile b/utils/uvol/Makefile index 1524fc16f..5c0b3d307 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 b403dd6df..10119ce26 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")"