From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 31 May 2023 17:23:09 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q4NfK-004QSR-P9 for lore@lore.pengutronix.de; Wed, 31 May 2023 17:23:09 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1q4Nf8-0005jq-VP; Wed, 31 May 2023 17:22:58 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q4Nf6-0005ey-Lg for oss-tools@pengutronix.de; Wed, 31 May 2023 17:22:56 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q4Nf6-0049Au-0s for oss-tools@pengutronix.de; Wed, 31 May 2023 17:22:56 +0200 Received: from afa by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q4Nf4-005uDj-9i for oss-tools@pengutronix.de; Wed, 31 May 2023 17:22:54 +0200 From: Ahmad Fatoum To: oss-tools@pengutronix.de Date: Wed, 31 May 2023 17:22:45 +0200 Message-Id: <20230531152253.1407395-1-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [OSS-Tools] [PATCH 0/8] state: allow lookup of barebox state partition by Type GUID X-BeenThere: oss-tools@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: Pengutronix Public Open-Source-Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "OSS-Tools" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: oss-tools-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false This implements the binding extension introduced to barebox here: https://lore.barebox.org/barebox/20230531145927.1399282-1-a.fatoum@pengutronix.de/T/#t With this, barebox,state backend can optionally point at a device instead of a partition. If this device is GPT-partitioned and has a partition with a specific partition type GUID of 4778ed65-bf42-45fa-9c5b-287a1dc4aab1 It will be taken. This series also fixes an annoying issue of barebox-state triggering udev on every access, because the root block device corresponding to the device tree node was opened r/w. barebox-state will now open the disk read-only if possible and if a partition exists that fits the barebox state location, it will be opened instead. Ahmad Fatoum (8): state: backend: direct: open block device in read-only mode if possible libdt: factor out u64 sysattr parsing into helper libdt: drop broken if-branch libdt: factor out __of_cdev_find helper libdt: use block device partition instead of parent if found state: align with barebox use of of_cdev_find libdt: use of_find_device_by_uuid for partuuid lookup state: allow lookup of barebox state partition by Type GUID src/barebox-state/backend_bucket_direct.c | 5 +- src/barebox-state/backend_storage.c | 2 +- src/barebox-state/state.c | 58 +++- src/barebox-state/state.h | 3 +- src/dt/common.h | 8 + src/dt/dt.h | 8 + src/libdt-utils.sym | 5 + src/libdt.c | 341 ++++++++++++++++++---- src/linux/uuid.h | 24 ++ src/state.h | 4 + 10 files changed, 380 insertions(+), 78 deletions(-) create mode 100644 src/linux/uuid.h -- 2.39.2