* image.bbclass question
@ 2023-08-02 16:41 Ryan Eatmon
2023-08-02 17:17 ` [OE-core] " Christopher Larson
0 siblings, 1 reply; 4+ messages in thread
From: Ryan Eatmon @ 2023-08-02 16:41 UTC (permalink / raw)
To: openembedded-core
I am trying to add support for the INITRAMFS_MAXSIZE into the meta-ti
layer for our tiny image.
I have added the following to our tiny image file:
INITRAMFS_FSTYPES += "cpio cpio.xz"
INITRAMFS_MAXSIZE = "65536"
But I'm not seeing any errors about the image being too big being printed.
In looking at the code in question:
# Check the initramfs size against INITRAMFS_MAXSIZE (if set)
if image_fstypes == initramfs_fstypes != '' and initramfs_maxsize:
initramfs_maxsize_int = int(initramfs_maxsize)
if base_size > initramfs_maxsize_int:
bb.error("The initramfs size %d(K) exceeds
INITRAMFS_MAXSIZE: %d(K)" % \
(base_size, initramfs_maxsize_int))
bb.error("You can set INITRAMFS_MAXSIZE a larger value.
Usually, it should")
bb.fatal("be less than 1/2 of ram size, or you may fail to
boot it.\n")
What is the purpose of the:
if image_fstypes == initramfs_fstypes != ''
It seems to looking for the ONLY images being built are the exact same
as the INITRAMFS_FSTYPES... Shouldn't that be more of an intersection
check? If any of the INITRAMFS_FSTYPES are in the IMAGE_FSTYPES, then
check the size?
Or am I missing something?
--
Ryan Eatmon reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc. - LCPD - MGTS
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] image.bbclass question
2023-08-02 16:41 image.bbclass question Ryan Eatmon
@ 2023-08-02 17:17 ` Christopher Larson
2023-08-02 18:14 ` Ryan Eatmon
[not found] ` <1777A39C626FDD4B.20033@lists.openembedded.org>
0 siblings, 2 replies; 4+ messages in thread
From: Christopher Larson @ 2023-08-02 17:17 UTC (permalink / raw)
To: reatmon; +Cc: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]
Image builds obey IMAGE_FSTYPES. Initramfs images set that to
INITRAMFS_FSTYPES, so it's comparing the two as a check to see if this is
an initramfs image. It isn't making sure it matches a hardcoded list, so
intersection isn't necessary.
On Wed, Aug 2, 2023 at 9:41 AM Ryan Eatmon via lists.openembedded.org
<reatmon=ti.com@lists.openembedded.org> wrote:
>
> I am trying to add support for the INITRAMFS_MAXSIZE into the meta-ti
> layer for our tiny image.
>
> I have added the following to our tiny image file:
>
> INITRAMFS_FSTYPES += "cpio cpio.xz"
> INITRAMFS_MAXSIZE = "65536"
>
> But I'm not seeing any errors about the image being too big being printed.
>
> In looking at the code in question:
>
> # Check the initramfs size against INITRAMFS_MAXSIZE (if set)
> if image_fstypes == initramfs_fstypes != '' and initramfs_maxsize:
> initramfs_maxsize_int = int(initramfs_maxsize)
> if base_size > initramfs_maxsize_int:
> bb.error("The initramfs size %d(K) exceeds
> INITRAMFS_MAXSIZE: %d(K)" % \
> (base_size, initramfs_maxsize_int))
> bb.error("You can set INITRAMFS_MAXSIZE a larger value.
> Usually, it should")
> bb.fatal("be less than 1/2 of ram size, or you may fail to
> boot it.\n")
>
>
> What is the purpose of the:
>
> if image_fstypes == initramfs_fstypes != ''
>
>
> It seems to looking for the ONLY images being built are the exact same
> as the INITRAMFS_FSTYPES... Shouldn't that be more of an intersection
> check? If any of the INITRAMFS_FSTYPES are in the IMAGE_FSTYPES, then
> check the size?
>
> Or am I missing something?
>
>
>
> --
> Ryan Eatmon reatmon@ti.com
> -----------------------------------------
> Texas Instruments, Inc. - LCPD - MGTS
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#185415):
> https://lists.openembedded.org/g/openembedded-core/message/185415
> Mute This Topic: https://lists.openembedded.org/mt/100509426/3617123
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> kergoth@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
--
Christopher Larson
chris_larson@mentor.com, chris.larson@siemens.com, kergoth@gmail.com
Principal Software Engineer, Embedded Linux Solutions, Siemens Digital
Industries Software
[-- Attachment #2: Type: text/html, Size: 3803 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] image.bbclass question
2023-08-02 17:17 ` [OE-core] " Christopher Larson
@ 2023-08-02 18:14 ` Ryan Eatmon
[not found] ` <1777A39C626FDD4B.20033@lists.openembedded.org>
1 sibling, 0 replies; 4+ messages in thread
From: Ryan Eatmon @ 2023-08-02 18:14 UTC (permalink / raw)
To: Christopher Larson; +Cc: openembedded-core
I added some debugging to print out the various variables on interest
and got this output:
DEBUG: image_fstypes= tar.xz wic.xz wic.bmap tar.xz.md5sum cpio cpio.xz
DEBUG: initramfs_fstypes=cpio.gz cpio cpio.xz
DEBUG: initramfs_maxsize=65536.000000
DEBUG: base_size=74366
So I'm not sure I agree with what you are saying. Again, I might be
missing something in how the == is supposed to work when comparing the
two variables...
On 8/2/2023 12:17 PM, Christopher Larson wrote:
> Image builds obey IMAGE_FSTYPES. Initramfs images set that to
> INITRAMFS_FSTYPES, so it's comparing the two as a check to see if this
> is an initramfs image. It isn't making sure it matches a hardcoded list,
> so intersection isn't necessary.
>
> On Wed, Aug 2, 2023 at 9:41 AM Ryan Eatmon via lists.openembedded.org
> <http://lists.openembedded.org> <reatmon=ti.com@lists.openembedded.org
> <mailto:ti.com@lists.openembedded.org>> wrote:
>
>
> I am trying to add support for the INITRAMFS_MAXSIZE into the meta-ti
> layer for our tiny image.
>
> I have added the following to our tiny image file:
>
> INITRAMFS_FSTYPES += "cpio cpio.xz"
> INITRAMFS_MAXSIZE = "65536"
>
> But I'm not seeing any errors about the image being too big being
> printed.
>
> In looking at the code in question:
>
> # Check the initramfs size against INITRAMFS_MAXSIZE (if set)
> if image_fstypes == initramfs_fstypes != '' and
> initramfs_maxsize:
> initramfs_maxsize_int = int(initramfs_maxsize)
> if base_size > initramfs_maxsize_int:
> bb.error("The initramfs size %d(K) exceeds
> INITRAMFS_MAXSIZE: %d(K)" % \
> (base_size, initramfs_maxsize_int))
> bb.error("You can set INITRAMFS_MAXSIZE a larger value.
> Usually, it should")
> bb.fatal("be less than 1/2 of ram size, or you may
> fail to
> boot it.\n")
>
>
> What is the purpose of the:
>
> if image_fstypes == initramfs_fstypes != ''
>
>
> It seems to looking for the ONLY images being built are the exact same
> as the INITRAMFS_FSTYPES... Shouldn't that be more of an intersection
> check? If any of the INITRAMFS_FSTYPES are in the IMAGE_FSTYPES, then
> check the size?
>
> Or am I missing something?
>
>
>
> --
> Ryan Eatmon reatmon@ti.com <mailto:reatmon@ti.com>
> -----------------------------------------
> Texas Instruments, Inc. - LCPD - MGTS
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#185415):
> https://lists.openembedded.org/g/openembedded-core/message/185415
> <https://lists.openembedded.org/g/openembedded-core/message/185415>
> Mute This Topic: https://lists.openembedded.org/mt/100509426/3617123
> <https://lists.openembedded.org/mt/100509426/3617123>
> Group Owner: openembedded-core+owner@lists.openembedded.org
> <mailto:openembedded-core%2Bowner@lists.openembedded.org>
> Unsubscribe:
> https://lists.openembedded.org/g/openembedded-core/unsub
> <https://lists.openembedded.org/g/openembedded-core/unsub>
> [kergoth@gmail.com <mailto:kergoth@gmail.com>]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
>
> --
> Christopher Larson
> chris_larson@mentor.com, chris.larson@siemens.com, kergoth@gmail.com
> Principal Software Engineer, Embedded Linux Solutions, Siemens Digital
> Industries Software
--
Ryan Eatmon reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc. - LCPD - MGTS
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [OE-core] image.bbclass question
[not found] ` <1777A39C626FDD4B.20033@lists.openembedded.org>
@ 2023-08-02 18:23 ` Ryan Eatmon
0 siblings, 0 replies; 4+ messages in thread
From: Ryan Eatmon @ 2023-08-02 18:23 UTC (permalink / raw)
To: Christopher Larson; +Cc: openembedded-core
In looking at the poky tiny initramfs image, it sets:
IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
Which would then make the two variable the same and make the check kick
in. But I cannot find where it manual says that you have to make them
the same value and cannot generate an initramfs image along with all
other image types.
On 8/2/2023 1:14 PM, Ryan Eatmon via lists.openembedded.org wrote:
>
> I added some debugging to print out the various variables on interest
> and got this output:
>
> DEBUG: image_fstypes= tar.xz wic.xz wic.bmap tar.xz.md5sum cpio cpio.xz
> DEBUG: initramfs_fstypes=cpio.gz cpio cpio.xz
> DEBUG: initramfs_maxsize=65536.000000
> DEBUG: base_size=74366
>
> So I'm not sure I agree with what you are saying. Again, I might be
> missing something in how the == is supposed to work when comparing the
> two variables...
>
>
> On 8/2/2023 12:17 PM, Christopher Larson wrote:
>> Image builds obey IMAGE_FSTYPES. Initramfs images set that to
>> INITRAMFS_FSTYPES, so it's comparing the two as a check to see if this
>> is an initramfs image. It isn't making sure it matches a hardcoded
>> list, so intersection isn't necessary.
>>
>> On Wed, Aug 2, 2023 at 9:41 AM Ryan Eatmon via lists.openembedded.org
>> <http://lists.openembedded.org> <reatmon=ti.com@lists.openembedded.org
>> <mailto:ti.com@lists.openembedded.org>> wrote:
>>
>>
>> I am trying to add support for the INITRAMFS_MAXSIZE into the meta-ti
>> layer for our tiny image.
>>
>> I have added the following to our tiny image file:
>>
>> INITRAMFS_FSTYPES += "cpio cpio.xz"
>> INITRAMFS_MAXSIZE = "65536"
>>
>> But I'm not seeing any errors about the image being too big being
>> printed.
>>
>> In looking at the code in question:
>>
>> # Check the initramfs size against INITRAMFS_MAXSIZE (if set)
>> if image_fstypes == initramfs_fstypes != '' and
>> initramfs_maxsize:
>> initramfs_maxsize_int = int(initramfs_maxsize)
>> if base_size > initramfs_maxsize_int:
>> bb.error("The initramfs size %d(K) exceeds
>> INITRAMFS_MAXSIZE: %d(K)" % \
>> (base_size, initramfs_maxsize_int))
>> bb.error("You can set INITRAMFS_MAXSIZE a larger value.
>> Usually, it should")
>> bb.fatal("be less than 1/2 of ram size, or you may
>> fail to
>> boot it.\n")
>>
>>
>> What is the purpose of the:
>>
>> if image_fstypes == initramfs_fstypes != ''
>>
>>
>> It seems to looking for the ONLY images being built are the exact
>> same
>> as the INITRAMFS_FSTYPES... Shouldn't that be more of an
>> intersection
>> check? If any of the INITRAMFS_FSTYPES are in the IMAGE_FSTYPES,
>> then
>> check the size?
>>
>> Or am I missing something?
>>
>>
>>
>> -- Ryan Eatmon reatmon@ti.com <mailto:reatmon@ti.com>
>> -----------------------------------------
>> Texas Instruments, Inc. - LCPD - MGTS
>>
>>
>>
>>
>> --
>> Christopher Larson
>> chris_larson@mentor.com, chris.larson@siemens.com, kergoth@gmail.com
>> Principal Software Engineer, Embedded Linux Solutions, Siemens Digital
>> Industries Software
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#185425): https://lists.openembedded.org/g/openembedded-core/message/185425
> Mute This Topic: https://lists.openembedded.org/mt/100509426/6551054
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [reatmon@ti.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
--
Ryan Eatmon reatmon@ti.com
-----------------------------------------
Texas Instruments, Inc. - LCPD - MGTS
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-02 18:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 16:41 image.bbclass question Ryan Eatmon
2023-08-02 17:17 ` [OE-core] " Christopher Larson
2023-08-02 18:14 ` Ryan Eatmon
[not found] ` <1777A39C626FDD4B.20033@lists.openembedded.org>
2023-08-02 18:23 ` Ryan Eatmon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox