[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    Re: [OE-core] [PATCH] wic: add 'part-name' argument for naming GPT partitions
From:       Artur Madrzak <artur () madrzak ! eu>
Date:       2017-10-31 15:18:43
Message-ID: E353D5C3-ABB9-4858-B29C-4E9157F98AF3 () madrzak ! eu
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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 #5 (text/html)]

<html><head></head><body>Hi,<br>
<br>
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&#39;ll send formatted patch soon. <br><br><div class="gmail_quote">Dnia 31 \
października 2017 16:08:58 CET, Nicolas Dechesne &lt;nicolas.dechesne@linaro.org&gt; \
napisał(a):<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <pre \
class="k9mail">On Tue, Oct 31, 2017 at 2:33 PM, Ed Bartosh \
&lt;ed.bartosh@linux.intel.com&gt; wrote:<br /><blockquote class="gmail_quote" \
style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: \
1ex;"><br /> On Mon, Oct 30, 2017 at 08:53:09PM +0100, Artur Mądrzak wrote:<br \
/><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px \
solid #ad7fa8; padding-left: 1ex;"> The WIC's 'part' can now give a name for GPT \
partition in WKS file.<br /> It's similar to '--label', but is naming partitions \
instead file systems.<br /> It's required by some bootloaders to partitions have \
specified names.</blockquote><br /><br /> Thank you for the patch!<br /><br /> +1<br \
/></blockquote><br />Yes, +1 from me as well. The context of this patch is for the \
Qualcomm<br />SoC based board that have *interesting* bootloaders requirements, \
one<br />of them being to look for partition by their names.<br /><br />Patchwork \
complained about the patch, so Artur, please address these<br />comments and resend \
the patch.<br /><br />Ed: do you think this can be backported to previous release \
branches?<br />The lack of --part-name on previous releases make WIC unusable for \
us.<br />The backport is not trivial since many changes have happened, but<br />Artur \
has a equivalent patch for morty at least.<br /><br /><br /><blockquote \
class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; \
padding-left: 1ex;"><br /><br /><blockquote class="gmail_quote" style="margin: 0pt \
0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> Signed-off-by: \
Artur Mądrzak &lt;artur@madrzak.eu&gt;<br /> ---<br />  scripts/lib/wic/<a \
href="http://help.py">help.py</a>                  |  2 ++<br />  scripts/lib/wic/<a \
href="http://ksparser.py">ksparser.py</a>              |  1 +<br />  \
scripts/lib/wic/<a href="http://partition.py">partition.py</a>             |  1 +<br \
/>  scripts/lib/wic/plugins/imager/<a href="http://direct.py">direct.py</a> | 11 \
+++++++++++<br />  4 files changed, 15 insertions(+)<br /><br /> diff --git \
a/scripts/lib/wic/<a href="http://help.py">help.py</a> b/scripts/lib/wic/<a \
href="http://help.py">help.py</a><br /> index bd9c62e2e8..2ac45e052e 100644<br /> --- \
a/scripts/lib/wic/<a href="http://help.py">help.py</a><br /> +++ b/scripts/lib/wic/<a \
href="http://help.py">help.py</a><br /> @@ -970,6 +970,8 @@ DESCRIPTION<br />         \
This option cannot be used with --fixed-size<br />                              \
option.<br /><br /> +         --part-name: This option is specific to wic. It \
specifies name for<br /> GPT partitions.<br /> +<br />           --part-type: This \
option is specific to wic. It specifies<br /> partition<br />                        \
type GUID for GPT partitions.<br />                        List of partition type \
GUIDS can be found here:<br /> diff --git a/scripts/lib/wic/<a \
href="http://ksparser.py">ksparser.py</a> b/scripts/lib/wic/<a \
href="http://ksparser.py">ksparser.py</a><br /> index 99b66eebc5..7850e81d2f \
100644<br /> --- a/scripts/lib/wic/<a href="http://ksparser.py">ksparser.py</a><br /> \
+++ b/scripts/lib/wic/<a href="http://ksparser.py">ksparser.py</a><br /> @@ -144,6 \
+144,7 @@ class KickStart():<br />          part.add_argument('--no-table', \
action='store_true')<br />          part.add_argument('--ondisk', '--ondrive', \
dest='disk',<br /> default='sda')<br />          \
part.add_argument(&quot;--overhead-factor&quot;, type=overheadtype)<br /> +        \
part.add_argument('--part-name')<br />          part.add_argument('--part-type')<br \
/>          part.add_argument('--rootfs-dir')<br /><br /> diff --git \
a/scripts/lib/wic/<a href="http://partition.py">partition.py</a> b/scripts/lib/wic/<a \
href="http://partition.py">partition.py</a><br /> index b623bb9e6d..66e61ba70c \
100644<br /> --- a/scripts/lib/wic/<a href="http://partition.py">partition.py</a><br \
/> +++ b/scripts/lib/wic/<a href="http://partition.py">partition.py</a><br /> @@ \
-51,6 +51,7 @@ class Partition():<br />          self.no_table = args.no_table<br />  \
self.num = None<br />          self.overhead_factor = args.overhead_factor<br /> +    \
self.part_name = args.part_name<br />          self.part_type = args.part_type<br />  \
self.rootfs_dir = args.rootfs_dir<br />          self.size = args.size<br /> diff \
--git a/scripts/lib/wic/plugins/imager/<a href="http://direct.py">direct.py</a><br /> \
b/scripts/lib/wic/plugins/imager/<a href="http://direct.py">direct.py</a><br /> index \
60317eed22..bdb8385620 100644<br /> --- a/scripts/lib/wic/plugins/imager/<a \
href="http://direct.py">direct.py</a><br /> +++ b/scripts/lib/wic/plugins/imager/<a \
href="http://direct.py">direct.py</a><br /> @@ -366,6 +366,10 @@ class \
PartitionedImage():<br />          for num in range(len(self.partitions)):<br />      \
part = self.partitions[num]<br /><br /> +            if self.ptable_format == 'msdos' \
and part.part_name:<br /> +                raise WicError(&quot;setting custom \
partition name is not &quot; \<br /> +                               \
&quot;implemented for msdos partitions&quot;)<br /> +<br />              if \
self.ptable_format == 'msdos' and part.part_type:<br />                  # The \
--part-type can also be implemented for MBR<br /> partitions,<br />                  \
# in which case it would map to the 1-byte &quot;partition type&quot;<br /> @@ -519,6 \
+523,13 @@ class PartitionedImage():<br />              \
self._create_partition(self.path, part.type,<br />                                    \
parted_fs_type, part.start,<br /> part.size_sec)<br /><br /> +            if \
part.part_name:<br /> +                logger.debug(&quot;partition %d: set name to \
%s&quot;,<br /> +                             part.num, part.part_name)<br /> +       \
exec_native_cmd(&quot;sgdisk --change-name=%d:%s %s&quot; % \<br /> +                 \
(part.num, part.part_name,<br /> +                                          \
self.path), self.native_sysroot)<br /> +<br />              if part.part_type:<br />  \
logger.debug(&quot;partition %d: set type UID to %s&quot;,<br />                      \
part.num, part.part_type)<br /> --<br /> 2.13.6<br /><br /> --<br /><hr /><br /> \
Openembedded-core mailing list<br /> Openembedded-core@lists.openembedded.org<br /> \
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br \
/></blockquote><br /> --<br /> --<br /> Regards,<br /> Ed<br /> --<br /><hr /><br /> \
Openembedded-core mailing list<br /> Openembedded-core@lists.openembedded.org<br /> \
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br \
                /></blockquote></pre></blockquote></div><br>
-- Wysłane za pomocą K-9 Mail.</body></html>



-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic