summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins
diff options
context:
space:
mode:
authorArtur Mądrzak <artur@madrzak.eu>2017-11-02 15:01:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-07 13:25:31 +0000
commit6f3b0a48acb22871890c4186a21d371e44751076 (patch)
tree21785694c0d894cf9d89d615982a6f25d8b53ef6 /scripts/lib/wic/plugins
parent5b2b572d85177211dc3ce6330ffade22bb5c2f2a (diff)
downloadpoky-6f3b0a48acb22871890c4186a21d371e44751076.tar.gz
wic: add 'part-name' argument for naming GPT partitions
The WIC's 'part' can now give a name for GPT partition in WKS file. It's similar to '--label', but is naming partintions instead file systems. It's required by some bootloaders to partitions have specified names. (From OE-Core rev: 9b60e3466ed7cff0cea10815851eb1304002eb52) Signed-off-by: Artur Mądrzak <artur@madrzak.eu> Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> 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.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
index 60317eed22..bdb8385620 100644
--- a/scripts/lib/wic/plugins/imager/direct.py
+++ b/scripts/lib/wic/plugins/imager/direct.py
@@ -366,6 +366,10 @@ class PartitionedImage():
366 for num in range(len(self.partitions)): 366 for num in range(len(self.partitions)):
367 part = self.partitions[num] 367 part = self.partitions[num]
368 368
369 if self.ptable_format == 'msdos' and part.part_name:
370 raise WicError("setting custom partition name is not " \
371 "implemented for msdos partitions")
372
369 if self.ptable_format == 'msdos' and part.part_type: 373 if self.ptable_format == 'msdos' and part.part_type:
370 # The --part-type can also be implemented for MBR partitions, 374 # The --part-type can also be implemented for MBR partitions,
371 # in which case it would map to the 1-byte "partition type" 375 # in which case it would map to the 1-byte "partition type"
@@ -519,6 +523,13 @@ class PartitionedImage():
519 self._create_partition(self.path, part.type, 523 self._create_partition(self.path, part.type,
520 parted_fs_type, part.start, part.size_sec) 524 parted_fs_type, part.start, part.size_sec)
521 525
526 if part.part_name:
527 logger.debug("partition %d: set name to %s",
528 part.num, part.part_name)
529 exec_native_cmd("sgdisk --change-name=%d:%s %s" % \
530 (part.num, part.part_name,
531 self.path), self.native_sysroot)
532
522 if part.part_type: 533 if part.part_type:
523 logger.debug("partition %d: set type UID to %s", 534 logger.debug("partition %d: set type UID to %s",
524 part.num, part.part_type) 535 part.num, part.part_type)