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:56:07 +0100
commit18b04f9c3fd6d4268da538c7622875f02ff59d64 (patch)
treec929c945eb93995263459a9016b1b920e6cfd40c /scripts/lib/wic/plugins
parentd5592877fedcba2aad95bdc2d917254d7e17f1de (diff)
downloadpoky-18b04f9c3fd6d4268da538c7622875f02ff59d64.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. (From OE-Core rev: 7704d5fc36eb065224792bf4d5543814eaa5fed3) 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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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():
571 self._create_partition(self.path, part.type, 571 self._create_partition(self.path, part.type,
572 parted_fs_type, part.start, part.size_sec) 572 parted_fs_type, part.start, part.size_sec)
573 573
574 if part.part_name: 574 if self.ptable_format == "gpt" and (part.part_name or part.label):
575 partition_label = part.part_name if part.part_name else part.label
575 logger.debug("partition %d: set name to %s", 576 logger.debug("partition %d: set name to %s",
576 part.num, part.part_name) 577 part.num, partition_label)
577 exec_native_cmd("sgdisk --change-name=%d:%s %s" % \ 578 exec_native_cmd("sgdisk --change-name=%d:%s %s" % \
578 (part.num, part.part_name, 579 (part.num, partition_label,
579 self.path), self.native_sysroot) 580 self.path), self.native_sysroot)
580 581
581 if part.part_type: 582 if part.part_type:
@@ -592,13 +593,6 @@ class PartitionedImage():
592 (part.num, part.uuid, self.path), 593 (part.num, part.uuid, self.path),
593 self.native_sysroot) 594 self.native_sysroot)
594 595
595 if part.label and self.ptable_format == "gpt":
596 logger.debug("partition %d: set name to %s",
597 part.num, part.label)
598 exec_native_cmd("parted -s %s name %d %s" % \
599 (self.path, part.num, part.label),
600 self.native_sysroot)
601
602 if part.active: 596 if part.active:
603 flag_name = "legacy_boot" if self.ptable_format == 'gpt' else "boot" 597 flag_name = "legacy_boot" if self.ptable_format == 'gpt' else "boot"
604 logger.debug("Set '%s' flag for partition '%s' on disk '%s'", 598 logger.debug("Set '%s' flag for partition '%s' on disk '%s'",