[OE-core] [PATCH] wic/partionedfs: Avoid reserving space for non-existing ext. partition

Kristian Amlie kristian.amlie at mender.io
Thu Feb 16 12:10:22 UTC 2017


On 16/02/17 12:40, Ed Bartosh wrote:
> 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 at 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.

Hmm, you caught me. Since the code block looked virtually identical (but
indeed wasn't) I didn't rerun. But I think you're right, I will rerun them.

-- 
Kristian



More information about the Openembedded-core mailing list