* [PATCH] wic: add 'part-name' argument for naming GPT partitions @ 2017-10-30 19:53 Artur Mądrzak 2017-10-30 20:32 ` ✗ patchtest: failure for " Patchwork 2017-10-31 13:33 ` [PATCH] " Ed Bartosh 0 siblings, 2 replies; 8+ messages in thread From: Artur Mądrzak @ 2017-10-30 19:53 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 partitions 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] 8+ messages in thread
* ✗ patchtest: failure for wic: add 'part-name' argument for naming GPT partitions 2017-10-30 19:53 [PATCH] wic: add 'part-name' argument for naming GPT partitions Artur Mądrzak @ 2017-10-30 20:32 ` Patchwork 2017-10-31 13:33 ` [PATCH] " Ed Bartosh 1 sibling, 0 replies; 8+ messages in thread From: Patchwork @ 2017-10-30 20:32 UTC (permalink / raw) To: Artur Mądrzak; +Cc: openembedded-core == Series Details == Series: wic: add 'part-name' argument for naming GPT partitions Revision: 1 URL : https://patchwork.openembedded.org/series/9544/ 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] 8+ messages in thread
* Re: [PATCH] wic: add 'part-name' argument for naming GPT partitions 2017-10-30 19:53 [PATCH] wic: add 'part-name' argument for naming GPT partitions Artur Mądrzak 2017-10-30 20:32 ` ✗ patchtest: failure for " Patchwork @ 2017-10-31 13:33 ` Ed Bartosh 2017-10-31 15:08 ` Nicolas Dechesne 1 sibling, 1 reply; 8+ messages in thread From: Ed Bartosh @ 2017-10-31 13:33 UTC (permalink / raw) To: Artur Mądrzak; +Cc: openembedded-core On Mon, Oct 30, 2017 at 08:53:09PM +0100, Artur Mądrzak wrote: > The WIC's 'part' can now give a name for GPT partition in WKS file. > It's similar to '--label', but is naming partitions instead file systems. > It's required by some bootloaders to partitions have specified names. > Thank you for the patch! +1 > 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 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- -- Regards, Ed ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] wic: add 'part-name' argument for naming GPT partitions 2017-10-31 13:33 ` [PATCH] " Ed Bartosh @ 2017-10-31 15:08 ` Nicolas Dechesne 2017-10-31 15:18 ` Artur Madrzak 2017-11-01 12:48 ` Ed Bartosh 0 siblings, 2 replies; 8+ messages in thread From: Nicolas Dechesne @ 2017-10-31 15:08 UTC (permalink / raw) To: ed.bartosh; +Cc: Patches and discussions about the oe-core layer On Tue, Oct 31, 2017 at 2:33 PM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote: > > On Mon, Oct 30, 2017 at 08:53:09PM +0100, Artur Mądrzak wrote: > > The WIC's 'part' can now give a name for GPT partition in WKS file. > > It's similar to '--label', but is naming partitions instead file systems. > > It's required by some bootloaders to partitions have specified names. > > > > Thank you for the patch! > > +1 Yes, +1 from me as well. The context of this patch is for the Qualcomm SoC based board that have *interesting* bootloaders requirements, one of them being to look for partition by their names. Patchwork complained about the patch, so Artur, please address these comments and resend the patch. Ed: do you think this can be backported to previous release branches? The lack of --part-name on previous releases make WIC unusable for us. The backport is not trivial since many changes have happened, but Artur has a equivalent patch for morty at least. > > > > 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 > > > > -- > > _______________________________________________ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > -- > -- > Regards, > Ed > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] wic: add 'part-name' argument for naming GPT partitions 2017-10-31 15:08 ` Nicolas Dechesne @ 2017-10-31 15:18 ` Artur Madrzak 2017-11-01 12:48 ` Ed Bartosh 1 sibling, 0 replies; 8+ messages in thread From: Artur Madrzak @ 2017-10-31 15:18 UTC (permalink / raw) To: Nicolas Dechesne, ed.bartosh Cc: Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 5804 bytes --] Hi, The patchwork is complaining because by mistake I sent patch for Morty branch as master one. I have some issues with sending patches to the group by git send-email but I'll send formatted patch soon. Dnia 31 października 2017 16:08:58 CET, Nicolas Dechesne <nicolas.dechesne@linaro.org> napisał(a): >On Tue, Oct 31, 2017 at 2:33 PM, Ed Bartosh ><ed.bartosh@linux.intel.com> wrote: >> >> On Mon, Oct 30, 2017 at 08:53:09PM +0100, Artur Mądrzak wrote: >> > The WIC's 'part' can now give a name for GPT partition in WKS file. >> > It's similar to '--label', but is naming partitions instead file >systems. >> > It's required by some bootloaders to partitions have specified >names. >> > >> >> Thank you for the patch! >> >> +1 > >Yes, +1 from me as well. The context of this patch is for the Qualcomm >SoC based board that have *interesting* bootloaders requirements, one >of them being to look for partition by their names. > >Patchwork complained about the patch, so Artur, please address these >comments and resend the patch. > >Ed: do you think this can be backported to previous release branches? >The lack of --part-name on previous releases make WIC unusable for us. >The backport is not trivial since many changes have happened, but >Artur has a equivalent patch for morty at least. > > >> >> >> > 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 >> > >> > -- >> > _______________________________________________ >> > Openembedded-core mailing list >> > Openembedded-core@lists.openembedded.org >> > http://lists.openembedded.org/mailman/listinfo/openembedded-core >> >> -- >> -- >> Regards, >> Ed >> -- >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-core -- Wysłane za pomocą K-9 Mail. [-- Attachment #2: Type: text/html, Size: 7432 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] wic: add 'part-name' argument for naming GPT partitions 2017-10-31 15:08 ` Nicolas Dechesne 2017-10-31 15:18 ` Artur Madrzak @ 2017-11-01 12:48 ` Ed Bartosh 2017-11-02 10:01 ` Artur Mądrzak 1 sibling, 1 reply; 8+ messages in thread From: Ed Bartosh @ 2017-11-01 12:48 UTC (permalink / raw) To: Nicolas Dechesne; +Cc: Patches and discussions about the oe-core layer On Tue, Oct 31, 2017 at 04:08:58PM +0100, Nicolas Dechesne wrote: > On Tue, Oct 31, 2017 at 2:33 PM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote: > > > > On Mon, Oct 30, 2017 at 08:53:09PM +0100, Artur Mądrzak wrote: > > > The WIC's 'part' can now give a name for GPT partition in WKS file. > > > It's similar to '--label', but is naming partitions instead file systems. > > > It's required by some bootloaders to partitions have specified names. > > > > > > > Thank you for the patch! > > > > +1 > > Yes, +1 from me as well. The context of this patch is for the Qualcomm > SoC based board that have *interesting* bootloaders requirements, one > of them being to look for partition by their names. > > Patchwork complained about the patch, so Artur, please address these > comments and resend the patch. > > Ed: do you think this can be backported to previous release branches? > The lack of --part-name on previous releases make WIC unusable for us. > The backport is not trivial since many changes have happened, but > Artur has a equivalent patch for morty at least. > Yes, I think it can be backported. It shouldn't be hard to do especially if there is a patch for morty. Just go ahead and send it for review. It would be a good first step in this direction. > > > > > > > > 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 > > > > > > -- > > > _______________________________________________ > > > Openembedded-core mailing list > > > Openembedded-core@lists.openembedded.org > > > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > > > -- > > -- > > Regards, > > Ed > > -- > > _______________________________________________ > > Openembedded-core mailing list > > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core -- Regards, Ed ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] wic: add 'part-name' argument for naming GPT partitions 2017-11-01 12:48 ` Ed Bartosh @ 2017-11-02 10:01 ` Artur Mądrzak 2017-11-02 10:15 ` Nicolas Dechesne 0 siblings, 1 reply; 8+ messages in thread From: Artur Mądrzak @ 2017-11-02 10:01 UTC (permalink / raw) To: ed.bartosh, Nicolas Dechesne Cc: Patches and discussions about the oe-core layer [-- Attachment #1: Type: text/plain, Size: 6291 bytes --] Hi again, May I ask you to merge attached patch? I'm sorry I'm not sending it according to the guide, but I don't know why list doesn't accept my emails sent via git send-email(can receive emails if send to my different e-mail address). If I place patch manually, then patchwork complain. The patch is on top of openembedded-core 3b413a8057 (head of master). Thanks and sorry for inconvenience. Artur Mądrzak W dniu 01.11.2017 o 13:48, Ed Bartosh pisze: > On Tue, Oct 31, 2017 at 04:08:58PM +0100, Nicolas Dechesne wrote: >> On Tue, Oct 31, 2017 at 2:33 PM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote: >>> >>> On Mon, Oct 30, 2017 at 08:53:09PM +0100, Artur Mądrzak wrote: >>>> The WIC's 'part' can now give a name for GPT partition in WKS file. >>>> It's similar to '--label', but is naming partitions instead file systems. >>>> It's required by some bootloaders to partitions have specified names. >>>> >>> >>> Thank you for the patch! >>> >>> +1 >> >> Yes, +1 from me as well. The context of this patch is for the Qualcomm >> SoC based board that have *interesting* bootloaders requirements, one >> of them being to look for partition by their names. >> >> Patchwork complained about the patch, so Artur, please address these >> comments and resend the patch. >> >> Ed: do you think this can be backported to previous release branches? >> The lack of --part-name on previous releases make WIC unusable for us. >> The backport is not trivial since many changes have happened, but >> Artur has a equivalent patch for morty at least. >> > > Yes, I think it can be backported. It shouldn't be hard to do especially > if there is a patch for morty. Just go ahead and send it for review. It > would be a good first step in this direction. > >> >>> >>> >>>> 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 >>>> >>>> -- >>>> _______________________________________________ >>>> Openembedded-core mailing list >>>> Openembedded-core@lists.openembedded.org >>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core >>> >>> -- >>> -- >>> Regards, >>> Ed >>> -- >>> _______________________________________________ >>> Openembedded-core mailing list >>> Openembedded-core@lists.openembedded.org >>> http://lists.openembedded.org/mailman/listinfo/openembedded-core > > -- > Regards, > Ed > [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-wic-add-part-name-argument-for-naming-GPT-partitions.patch --] [-- Type: text/x-patch; name="0001-wic-add-part-name-argument-for-naming-GPT-partitions.patch", Size: 4102 bytes --] From 5b433666df434f2284508169783796b69c68a46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C4=85drzak?= <artur@madrzak.eu> Date: Sun, 29 Oct 2017 22:35:41 +0100 Subject: [OE-core][PATCH v2] wic: add 'part-name' argument for naming GPT partitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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] 8+ messages in thread
* Re: [PATCH] wic: add 'part-name' argument for naming GPT partitions 2017-11-02 10:01 ` Artur Mądrzak @ 2017-11-02 10:15 ` Nicolas Dechesne 0 siblings, 0 replies; 8+ messages in thread From: Nicolas Dechesne @ 2017-11-02 10:15 UTC (permalink / raw) To: Artur Mądrzak; +Cc: Patches and discussions about the oe-core layer On Thu, Nov 2, 2017 at 11:01 AM, Artur Mądrzak <artur@madrzak.eu> wrote: > > Hi again, > > May I ask you to merge attached patch? I'm sorry I'm not sending it according to the guide, but I don't know why list doesn't accept my emails sent via git send-email(can receive emails if send to my different e-mail address). If I place patch manually, then patchwork complain. The patch is on top of openembedded-core 3b413a8057 (head of master). I will test it our locally, and resend for you. > > > Thanks and sorry for inconvenience. > Artur Mądrzak > > W dniu 01.11.2017 o 13:48, Ed Bartosh pisze: > >> On Tue, Oct 31, 2017 at 04:08:58PM +0100, Nicolas Dechesne wrote: >>> >>> On Tue, Oct 31, 2017 at 2:33 PM, Ed Bartosh <ed.bartosh@linux.intel.com> wrote: >>>> >>>> >>>> On Mon, Oct 30, 2017 at 08:53:09PM +0100, Artur Mądrzak wrote: >>>>> >>>>> The WIC's 'part' can now give a name for GPT partition in WKS file. >>>>> It's similar to '--label', but is naming partitions instead file systems. >>>>> It's required by some bootloaders to partitions have specified names. >>>>> >>>> >>>> Thank you for the patch! >>>> >>>> +1 >>> >>> >>> Yes, +1 from me as well. The context of this patch is for the Qualcomm >>> SoC based board that have *interesting* bootloaders requirements, one >>> of them being to look for partition by their names. >>> >>> Patchwork complained about the patch, so Artur, please address these >>> comments and resend the patch. >>> >>> Ed: do you think this can be backported to previous release branches? >>> The lack of --part-name on previous releases make WIC unusable for us. >>> The backport is not trivial since many changes have happened, but >>> Artur has a equivalent patch for morty at least. >>> >> >> Yes, I think it can be backported. It shouldn't be hard to do especially >> if there is a patch for morty. Just go ahead and send it for review. It >> would be a good first step in this direction. >> >>> >>>> >>>> >>>>> 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 >>>>> >>>>> -- >>>>> _______________________________________________ >>>>> Openembedded-core mailing list >>>>> Openembedded-core@lists.openembedded.org >>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core >>>> >>>> >>>> -- >>>> -- >>>> Regards, >>>> Ed >>>> -- >>>> _______________________________________________ >>>> Openembedded-core mailing list >>>> Openembedded-core@lists.openembedded.org >>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core >> >> >> -- >> Regards, >> Ed >> ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-11-02 10:16 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-10-30 19:53 [PATCH] wic: add 'part-name' argument for naming GPT partitions Artur Mądrzak 2017-10-30 20:32 ` ✗ patchtest: failure for " Patchwork 2017-10-31 13:33 ` [PATCH] " Ed Bartosh 2017-10-31 15:08 ` Nicolas Dechesne 2017-10-31 15:18 ` Artur Madrzak 2017-11-01 12:48 ` Ed Bartosh 2017-11-02 10:01 ` Artur Mądrzak 2017-11-02 10:15 ` Nicolas Dechesne
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox