[elbe-devel] [PATCH 1/1] hdimg: Add support for partition names in GPT partitions

Torben Hohn torben.hohn at linutronix.de
Mon Mar 7 14:25:18 CET 2022


From: "Steih, Martin" <Martin.Steih at lachmann-rink.de>

GPT partitions also support names. This is required for example
on STM32mp1. The stmp32mp1 ROM code looks for fsbl1, fsbl2 and ssbl
partitions.

Add a name field to the partition entry and evaluate that.

[Patch by Martin Steih taken from elbe-devel]
Tested-by:  Eduard Krein <eduard.krein at linutronix.de>
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/hdimg.py | 4 ++++
 schema/dbsfed.xsd | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index 696225925..84d7a2e92 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -336,6 +336,10 @@ def create_partition(
     else:
         ppart = parted.Partition(disk, ptype, geometry=g)
 
+    if disk.type == "gpt" and \
+        part.has("name"):
+        ppart.set_name(part.text("name"))
+
     cons = parted.Constraint(exactGeom=g)
     disk.addPartition(ppart, cons)
 
diff --git a/schema/dbsfed.xsd b/schema/dbsfed.xsd
index 28f9d1d25..0f30e37f3 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -1807,6 +1807,13 @@
           </documentation>
         </annotation>
       </element>
+      <element name="name" type="rfs:string" minOccurs="0" maxOccurs="1">
+        <annotation>
+          <documentation>
+             human readable name of the partition used for naming a gpt partition
+          </documentation>
+        </annotation>
+      </element>
       <element name="binary" type="rfs:string" minOccurs="0">
         <annotation>
           <documentation>
-- 
2.20.1



More information about the elbe-devel mailing list