All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] wic: add 'part-name' argument for naming GPT
@ 2017-11-01  8:38 Artur Mądrzak
  2017-11-01  9:02 ` ✗ patchtest: failure for " Patchwork
  0 siblings, 1 reply; 2+ messages in thread
From: Artur Mądrzak @ 2017-11-01  8:38 UTC (permalink / raw)
  To: openembedded-core

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>
---
  scripts/lib/wic/help.py                  |  2 ++
  scripts/lib/wic/ksparser.py              |  1 +
  scripts/lib/wic/partition.py             |  1 +
  scripts/lib/wic/plugins/imager/direct.py | 11 +++++++++++
  4 files changed, 15 insertions(+)

diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py
index bd9c62e2e8..2ac45e052e 100644
--- a/scripts/lib/wic/help.py
+++ b/scripts/lib/wic/help.py
@@ -970,6 +970,8 @@ DESCRIPTION
                              This option cannot be used with --fixed-size
                              option.

+         --part-name: This option is specific to wic. It specifies name 
for GPT partitions.
+
           --part-type: This option is specific to wic. It specifies 
partition
                        type GUID for GPT partitions.
                        List of partition type GUIDS can be found here:
diff --git a/scripts/lib/wic/ksparser.py b/scripts/lib/wic/ksparser.py
index 99b66eebc5..7850e81d2f 100644
--- a/scripts/lib/wic/ksparser.py
+++ b/scripts/lib/wic/ksparser.py
@@ -144,6 +144,7 @@ class KickStart():
          part.add_argument('--no-table', action='store_true')
          part.add_argument('--ondisk', '--ondrive', dest='disk', 
default='sda')
          part.add_argument("--overhead-factor", type=overheadtype)
+        part.add_argument('--part-name')
          part.add_argument('--part-type')
          part.add_argument('--rootfs-dir')

diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
index b623bb9e6d..66e61ba70c 100644
--- a/scripts/lib/wic/partition.py
+++ b/scripts/lib/wic/partition.py
@@ -51,6 +51,7 @@ class Partition():
          self.no_table = args.no_table
          self.num = None
          self.overhead_factor = args.overhead_factor
+        self.part_name = args.part_name
          self.part_type = args.part_type
          self.rootfs_dir = args.rootfs_dir
          self.size = args.size
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)
-- 
2.13.6




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* ✗ patchtest: failure for wic: add 'part-name' argument for naming GPT
  2017-11-01  8:38 [PATCH v2] wic: add 'part-name' argument for naming GPT Artur Mądrzak
@ 2017-11-01  9:02 ` Patchwork
  0 siblings, 0 replies; 2+ messages in thread
From: Patchwork @ 2017-11-01  9:02 UTC (permalink / raw)
  To: Artur Mądrzak; +Cc: openembedded-core

== Series Details ==

Series: wic: add 'part-name' argument for naming GPT
Revision: 1
URL   : https://patchwork.openembedded.org/series/9571/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series cannot be parsed correctly due to malformed diff lines [test_mbox_format] 
  Suggested fix    Create the series again using git-format-patch and ensure it can be applied using git am
  Diff line        


* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 3b413a8057)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-01  9:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01  8:38 [PATCH v2] wic: add 'part-name' argument for naming GPT Artur Mądrzak
2017-11-01  9:02 ` ✗ patchtest: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.