summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins
diff options
context:
space:
mode:
authorDit Kozmaj <dit.kozmaj@kynetics.com>2023-04-06 10:44:15 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-13 11:55:40 +0100
commit7704d5fc36eb065224792bf4d5543814eaa5fed3 (patch)
treeff97d0a81f4450434829be1dbad767bf16671063 /scripts/lib/wic/plugins
parent0bdfe34c016c8db1f18d76b59a38af280b4c70aa (diff)
downloadopenembedded-core-7704d5fc36eb065224792bf4d5543814eaa5fed3.tar.gz
wic: use part_name when defined
So far part.label has been used to define GPT partition label even if part.part_name was defined. Fix the code to use part.part_name whenever available, as it makes sense to have a GPT partition label which is different from the contained filesystem label. Signed-off-by: Dit Kozmaj <dit.kozmaj@kynetics.com> Signed-off-by: Diego Rondini <diego.rondini@kynetics.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'scripts/lib/wic/plugins')
-rw-r--r--scripts/lib/wic/plugins/imager/direct.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index dfaa901567..7315d8f073 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -571,11 +571,12 @@ class PartitionedImage():
self._create_partition(self.path, part.type,
parted_fs_type, part.start, part.size_sec)
- if part.part_name:
+ if self.ptable_format == "gpt" and (part.part_name or part.label):
+ partition_label = part.part_name if part.part_name else part.label
logger.debug("partition %d: set name to %s",
- part.num, part.part_name)
+ part.num, partition_label)
exec_native_cmd("sgdisk --change-name=%d:%s %s" % \
- (part.num, part.part_name,
+ (part.num, partition_label,
self.path), self.native_sysroot)
if part.part_type:
@@ -592,13 +593,6 @@ class PartitionedImage():
(part.num, part.uuid, self.path),
self.native_sysroot)
- if part.label and self.ptable_format == "gpt":
- logger.debug("partition %d: set name to %s",
- part.num, part.label)
- exec_native_cmd("parted -s %s name %d %s" % \
- (self.path, part.num, part.label),
- self.native_sysroot)
-
if part.active:
flag_name = "legacy_boot" if self.ptable_format == 'gpt' else "boot"
logger.debug("Set '%s' flag for partition '%s' on disk '%s'",