Thread (7 messages) 7 messages, 3 authors, 2021-10-09

Re: [Buildroot] buildroot config for installing kernel and dtbs to rootfs?

flat view

From: Tim Harvey <tharvey@gateworks.com>
Date: 2021-10-01 14:38:20

On Thu, Sep 30, 2021 at 8:21 AM Tim Harvey [off-list ref] wrote:
On Wed, Sep 29, 2021 at 7:13 PM Fabio Estevam [off-list ref] wrote:
quoted
Hi Tim,

On Wed, Sep 29, 2021 at 10:52 PM Tim Harvey [off-list ref] wrote:
quoted
Greetings,

I see the buildroot has the ability to build dtb's from the kernel
source (BR2_LINUX_KENREL_DTS*) but I haven't seen any configs that
instruct buildroot to copy the dtb's or kernel image to the root
filesystem.

Is there a config for this and if not what do people usually do for this?
It is BR2_LINUX_KERNEL_INSTALL_TARGET=y.

configs/wandboard_defconfig is an example that selects
BR2_LINUX_KERNEL_INSTALL_TARGET=y
and install zImage and dtbs into the rootfs.
Thanks Fabio, I didn't see it because I had BR2_TARGET_ROOTFS_INITRAMFS=y.

BR2_LINUX_KERNEL_INSTALL_TARGET only installs the kernel image. It
looks like perhaps to install dtbs you need
BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh".
It seems to me installing of the dtbs to the rootfs should be moved
into a defconfig like the kernel image for those who are trying to
simply generate a tarball but not an image?
Fabio,

Digging into the image creation used for freescale_imx8mmevk_defconfig
things seem flawed to me or at least limited.

I'm still trying to wrap my head around what
BR2_LINUX_KERNEL_INTREE_DTS_NAME is trying to accomplish but one thing
I see is that board/freescale/common/imx/imx8-bootloader-prepare.sh
and board/freescale/common/imx/post-image.sh are creating images
assuming the U-Boot dtb and the Linux kernel dtb are one and the same
which is wrong. There are specific details that differ between the two
especially if you are trying to boot different kernels with differing
support. It's always best to decouple these. The other thing I'm
noticing is that these scripts assume one dtb per image which is
limiting. It looks like imx8mm-venice is the only U-Boot board that
supports multiple dtbs for imx8mm but for imx6 there are many.

So I think we need a way to make linux.mk copy desired kernel dtbs to
BINARIES_DIR separate from desired u-boot dtbs. This means we probably
need different DTB defines for each.

I also don't see any bootscript creation facility in buildroot which
seems to be something that may be desirable as well. For example the
freescale_imx8mmevk_defconfig only boots because it's U-Boot default
environment tries distro-config first which requires a bootscript then
falls back to a hard-coded loading of the kernel/fdt from the
filesystem thus no bootscript is needed. I'm not sure how many boards
in U-Boot have a hard coded fallback like that?

Best regards,

Tim
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help