diff options
author | Artur Mądrzak <artur@madrzak.eu> | 2017-11-02 15:01:32 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-05 22:57:54 +0000 |
commit | 9b60e3466ed7cff0cea10815851eb1304002eb52 (patch) | |
tree | 35006dcb71a729a5b0da630e2cc466f39722a35e /scripts/lib/wic/plugins/imager/direct.py | |
parent | 148920f3971de0f44ac4dd3c85c29983862c5318 (diff) | |
download | openembedded-core-9b60e3466ed7cff0cea10815851eb1304002eb52.tar.gz openembedded-core-9b60e3466ed7cff0cea10815851eb1304002eb52.tar.bz2 openembedded-core-9b60e3466ed7cff0cea10815851eb1304002eb52.zip |
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.
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/imager/direct.py')
-rw-r--r-- | scripts/lib/wic/plugins/imager/direct.py | 11 |
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(): for num in range(len(self.partitions)): part = self.partitions[num] + if self.ptable_format == 'msdos' and part.part_name: + raise WicError("setting custom partition name is not " \ + "implemented for msdos partitions") + if self.ptable_format == 'msdos' and part.part_type: # The --part-type can also be implemented for MBR partitions, # in which case it would map to the 1-byte "partition type" @@ -519,6 +523,13 @@ class PartitionedImage(): self._create_partition(self.path, part.type, parted_fs_type, part.start, part.size_sec) + if part.part_name: + logger.debug("partition %d: set name to %s", + part.num, part.part_name) + exec_native_cmd("sgdisk --change-name=%d:%s %s" % \ + (part.num, part.part_name, + self.path), self.native_sysroot) + if part.part_type: logger.debug("partition %d: set type UID to %s", part.num, part.part_type) |