From 75438c8934f2a506eb6a75b0f0e017c5ca70bccf Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 28 Sep 2026 23:35:49 +0100 Subject: [PATCH] uvol: pad the MBR disk signature when matching root= get_bootdev() identifies the boot disk for a root=PARTUUID=xxxxxxxx-NN command line by reading the four-byte signature at offset 440 of each block device, but renders it with %x per byte, so a byte below 0x10 comes out as a single digit and the string is too short to ever match. A disk whose signature is cf0a3161 yields "cfa3161", get_bootdev() returns null, and every backend's init fails: uvol then reports no backend at all and no volume can be created on a perfectly good volume group. Pad each byte to two digits, as the GPT branch of the same function already does. Fixes: 6350c7bc63a1 ("uvol: replace with re-write in ucode") Signed-off-by: Daniel Golle --- utils/uvol/Makefile | 2 +- utils/uvol/files/blockdev_common.uc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/uvol/Makefile b/utils/uvol/Makefile index eb7c6da9b2..8f92f82451 100644 --- a/utils/uvol/Makefile +++ b/utils/uvol/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uvol PKG_VERSION:=1.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_MAINTAINER:=Daniel Golle PKG_LICENSE:=GPL-2.0-or-later diff --git a/utils/uvol/files/blockdev_common.uc b/utils/uvol/files/blockdev_common.uc index f76508657f..b14842ca28 100644 --- a/utils/uvol/files/blockdev_common.uc +++ b/utils/uvol/files/blockdev_common.uc @@ -95,7 +95,7 @@ let get_bootdev = function(void) { bdf.seek(440); let bduuid = bdf.read(4); bdf.close(); - if (uuidarg == sprintf("%x%x%x%x", ord(bduuid, 3), ord(bduuid, 2), ord(bduuid, 1), ord(bduuid, 0))) { + if (uuidarg == sprintf("%02x%02x%02x%02x", ord(bduuid, 3), ord(bduuid, 2), ord(bduuid, 1), ord(bduuid, 0))) { uevent = sprintf("/sys/class/block/%s/uevent", bd); break; }