[yocto] [PATCH] Gracefully abort if rootfs.img gets to big

Chris Hallinan challinan at gmail.com
Mon Mar 30 16:17:46 PDT 2015


Hi Armin,

Great catching up with you last week, and thanks for looking at my
patch.  I supposed it's a double edged sword.  If we make it a
variable, it can be set wrong and the build hang again.  OTOH, 128MB
is probably way more space than we really need to reserve, and I
supposed if someone were just banging up against the limit, they might
want to tweak it.  I'll defer to the collective judgement of the
group, and resubmit if that's the consensus.

Oh, and silly me...I figured the mail list daemon would put the
[Yocto] tag on the patch. Since it seems to tag our posts, that is a
mystery to me.  Maybe Michael can enlighten me off list. :-P

-Chris

On Mon, Mar 30, 2015 at 6:51 PM, akuster808 <akuster808 at gmail.com> wrote:
> Chris,
>
> Should the hardcoded value '4160800000' be a variable so it can be
> overridden?
>
> - armin
>
>
> On 03/30/2015 01:50 PM, Chris Hallinan wrote:
>>
>> See https://bugzilla.yoctoproject.org/show_bug.cgi?id=7541
>>
>> Current implementation of live image type cannot support image size
>> greater than 4GB. If the image gets too large, the build simply
>> hangs silently, without any clues or debug output to indicate why.
>> This patch prevents the build hanging on rootfs.img getting too big.
>>
>> ---
>>   meta/classes/bootimg.bbclass | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
>> index b1c03ba..e143e24 100644
>> --- a/meta/classes/bootimg.bbclass
>> +++ b/meta/classes/bootimg.bbclass
>> @@ -84,6 +84,13 @@ populate() {
>>         fi
>>
>>         if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
>> +               ROOTFS_FILE_SIZE=`stat -L -c "%s" ${ROOTFS}`
>> +               bbnote "do_bootimg(): rootfs.img size =
>> ${ROOTFS_FILE_SIZE}"
>> +               # Actual limit is difficult to determine
>> +               # This leaves ~128MiB headroom for initrd and boot files
>> +               if [ ${ROOTFS_FILE_SIZE} -gt 4160800000 ]; then
>> +                       bbfatal "Root fs (rootfs.img) is too big for live
>> image"
>> +               fi
>>                 install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
>>         fi
>>
>>
>



-- 
Life is like Linux - it never stands still.



More information about the yocto mailing list