From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Kristian Amlie <kristian.amlie@mender.io>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] wic/partionedfs: Avoid reserving space for non-existing ext. partition
Date: Thu, 16 Feb 2017 13:40:40 +0200 [thread overview]
Message-ID: <20170216114040.GA26465@linux.intel.com> (raw)
In-Reply-To: <1487241012-8486-1-git-send-email-kristian.amlie@mender.io>
Hi Kristian,
Thank you for the patch. It looks good to me. Just one thing needs to be
changed. See my comment below.
On Thu, Feb 16, 2017 at 11:30:12AM +0100, Kristian Amlie wrote:
> We don't need the gap that the extended partition occupies if we
> already know that we have less than five partitions. Saves up to one
> full alignment of space.
>
> Signed-off-by: Kristian Amlie <kristian.amlie@mender.io>
> ---
> scripts/lib/wic/plugins/imager/direct.py | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/lib/wic/plugins/imager/direct.py b/scripts/lib/wic/plugins/imager/direct.py
> index 481d24d..bc2d620 100644
> --- a/scripts/lib/wic/plugins/imager/direct.py
> +++ b/scripts/lib/wic/plugins/imager/direct.py
> @@ -344,6 +344,10 @@ class PartitionedImage():
>
> msger.debug("Assigning %s partitions to disks" % self.ptable_format)
>
> + # The number of primary and logical partitions. Extended partition and
> + # partitions not listed in the table are not included.
> + num_real_partitions = len([p for p in self.partitions if not p['no_table']])
> +
Hm... shouldn't it be 'if p.no_table'?
Did you run 'oe-selftest -r wic' btw? I'd be surprised if it doesn't
fail at least some test cases with this change.
> # Go through partitions in the order they are added in .ks file
> for num in range(len(self.partitions)):
> part = self.partitions[num]
> @@ -369,7 +373,7 @@ class PartitionedImage():
> # Skip one sector required for the partitioning scheme overhead
> self.offset += overhead
>
> - if self.realpart > 3:
> + if self.realpart > 3 and num_real_partitions > 4:
> # Reserve a sector for EBR for every logical partition
> # before alignment is performed.
> if self.ptable_format == "msdos":
> @@ -408,7 +412,7 @@ class PartitionedImage():
>
> if self.ptable_format == "msdos":
> # only count the partitions that are in partition table
> - if len([p for p in self.partitions if not p.no_table]) > 4:
> + if num_real_partitions > 4:
> if self.realpart > 3:
> part.type = 'logical'
> part.num = self.realpart + 1
--
Regards,
Ed
next prev parent reply other threads:[~2017-02-16 12:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 6:51 [PATCH] wic/partionedfs: Avoid reserving space for non-existing ext. partition Kristian Amlie
2017-02-14 14:46 ` Kristian Amlie
2017-02-14 19:26 ` Burton, Ross
2017-02-16 10:30 ` Kristian Amlie
2017-02-16 11:40 ` Ed Bartosh [this message]
2017-02-16 12:10 ` Kristian Amlie
2017-03-10 13:16 ` Kristian Amlie
2017-03-10 13:16 ` [PATCH v3] " Kristian Amlie
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=20170216114040.GA26465@linux.intel.com \
--to=ed.bartosh@linux.intel.com \
--cc=kristian.amlie@mender.io \
--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