Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: "Artur Mądrzak" <artur@madrzak.eu>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] wic: add 'part-name' argument for naming GPT partitions
Date: Tue, 31 Oct 2017 15:33:24 +0200	[thread overview]
Message-ID: <20171031133324.5hdzhtu7kop7um4b@linux.intel.com> (raw)
In-Reply-To: <123c3e3f-4ba4-43f6-957f-530a69e81712@madrzak.eu>

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


  parent reply	other threads:[~2017-10-31 14:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-10-31 15:08   ` [PATCH] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171031133324.5hdzhtu7kop7um4b@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=artur@madrzak.eu \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox