[Buildroot] [PATCH RESEND] imx/genimage: Place the rootfs at a proper offset when BR2_LINUX_KERNEL_INSTALL_TARGET=y

Yann E. MORIN yann.morin.1998 at free.fr
Sat Nov 13 21:02:19 UTC 2021


Fabio, All,

On 2021-11-13 15:11 -0300, Fabio Estevam spake thusly:
> Hi Thomas,
> 
> On Sat, Nov 13, 2021 at 2:06 PM Thomas Petazzoni
> <thomas.petazzoni at bootlin.com> wrote:
> 
> > I don't see the relationship between BR2_LINUX_KERNEL_INSTALL_TARGET=y
> > and changing the offset of the rootfs to avoid rootfs corruption.
> >
> > All what BR2_LINUX_KERNEL_INSTALL_TARGET=y does it add the kernel image
> > into the /boot directory of the rootfs. It makes the rootfs larger for
> > sure, but it would still start at the same place.
> >
> > Are you sure there's any relationship with
> > BR2_LINUX_KERNEL_INSTALL_TARGET=y here?
> 
> Yes, this problem only happens with BR2_LINUX_KERNEL_INSTALL_TARGET=y.
> 
> When BR2_LINUX_KERNEL_INSTALL_TARGET is not selected, then
> board/freescale/common/imx/genimage.cfg.template is used as per the logic
> inside board/freescale/common/imx/post-image.sh.
> 
> board/freescale/common/imx/genimage.cfg.template correctly puts the
> rootfs at a safe offset.
> 
> With BR2_LINUX_KERNEL_INSTALL_TARGET=y, then
> board/freescale/common/imx/genimage.cfg.template_no_boot_part is used and no
> offset to the rootfs is given, which may cause U-Boot environment
> area to write into the rootfs
> area, causing the rootfs corruption.

Ah, that indeed explains the case. This type of exp[lanations definitely
should be in the commit log.

However, please not that there are two cases for
BR2_LINUX_KERNEL_INSTALL_TARGET=y:

    if grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
        echo "genimage.cfg.template_no_boot_part_spl"
    else
        echo "genimage.cfg.template_no_boot_part"
    fi

And this patch only addresses the second one.

Could you respin, fixing the second template, and including these
extended explanations in the commit log, please?

Regards,
Yann E. MORIN.

> Please let me know if you need more information as this problem is
> easy to reproduce.
> 
> Regards,
> 
> Fabio Estevam
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list