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

Torben Hohn torben.hohn at linutronix.de
Tue Mar 8 10:35:56 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.

Signed-off-by: Steih, Martin <Martin.Steih at lachmann-rink.de>
[Added a proper commit message after taking the diff from elbe-devel]
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
Tested-by:  Eduard Krein <eduard.krein 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 b3f006832..957c31b8c 100644
--- a/schema/dbsfed.xsd
+++ b/schema/dbsfed.xsd
@@ -1808,6 +1808,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