[elbe-devel] [PATCH 1/3] hdimg: do not use flag lba if partition format is gpt

Martin Kaistra martin.kaistra at linutronix.de
Mon Mar 26 10:10:56 CEST 2018


The partition flag 'lba' is not available for gpt disk labels, so
don't try to set it.

See also:
http://lists.linutronix.de/pipermail/elbe-devel/2016-February/000099.html

Signed-off-by: Martin Kaistra <martin.kaistra at linutronix.de>
---
 elbepack/hdimg.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index a8b74c58..e1dc2aae 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -398,7 +398,8 @@ def create_partition(
             fslabel[part.text("label")].fstype == "vfat":
                 fs = simple_fstype("fat32")
                 ppart = parted.Partition(disk, ptype, fs, geometry=g)
-                ppart.setFlag(_ped.PARTITION_LBA)
+                if disk.type != "gpt":
+                    ppart.setFlag(_ped.PARTITION_LBA)
     else:
         ppart = parted.Partition(disk, ptype, geometry=g)
 
-- 
2.11.0




More information about the elbe-devel mailing list