Skip to contentSkip to conversation

User mailing list?

Buildroot Zoltán Kócsi 2 participants 4 messages Aug 2, 2024 – Aug 3, 2024

lore
Share & tools
lore
#0 lore raw

This mailing list seems to be for Buildroot developers and maintainers.

Is there a list for the less illuminated, where stupid questions like "my build fails and I don't know why" and "I have no idea what I'm doing, anyone could guide me a bit" type questions can be asked?

Thanks,

Zoltan
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

Hello Zoltán,

Quoted 5 lines · On Sat, 3 Aug 2024 06:25:08 +1000 Zoltán Kócsi <[email protected]> wrote:

This mailing list seems to be for Buildroot developers and maintainers.

Is there a list for the less illuminated, where stupid questions like "my build fails and I don't know why" and "I have no idea what I'm doing, anyone could guide me a bit" type questions can be asked?

This mailing list is actually used for both, so feel free to ask your user's questions.

A second option to get support is to join the IRC channel. But really the mailing list is fine as well!

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi there,

Quoted 2 lines · On Fri, 2 Aug 2024 23:57:43 +0200 Thomas Petazzoni via buildroot…

This mailing list is actually used for both, so feel free to ask your user's questions.

In that case, I'll have some. Background: I live on Linux, I regularly cross-compile to bare-metal targets, write my own BSPs and target libs and all, know make.

New board, with a Xilinx Zynq7 SoC (actually, SoM w/ DRAM). It's just an ARM Cortex-A9 with loads of peripherals and an FPGA. I can boot the board (with bare metal code), can load anything to RAM, configure all devices and all. But I want Linux on it.

Not the Xilinx one, but the mainline version (the Zynq7 is old enough so that all relevant Xilinx drivers are already on the mainline), with the RT patches applied. Don't really want uboot or anything fancy, I can load a kernel image, device tree and rootfs into RAM myself and start the kernel. So all I need is the kernel, the DTB and the rootfs.

Buildroot seems to be a perfect match for this.

Alas, from here, user stupidity and ignorance to be expected...

First step, let's make an SDK. Load a defconfig with a board using the same chip, then change the Buildroot config to use a mainline kernel + RT patch, disable everything that the manual says: busybox, init system, /bin/sh, and tar-ing the root file system.
Type make sdk.

It chugs along, then the kernel compilation fails with a prototype mismatch in the noveau video driver. Why would it need an nVidia driver for a headless board is a mystery, but ok. Let's configure the kernel. Turn off everything the board doesn't have and/or not needed.

make sdk again. Cool! The kernel compiles. Then Buildroot starts to build rootfs.ext2. First, a warning about 64-bit filesystem support not being enabled, but it builds it anyway.
Writing superblocks and filesystem accounting information: done. Hurray!

Then:

Quoted 1 line
Quoted 1 line
Quoted 1 line

Executing post-image script board/zynq/post-image.sh

INFO: cmd: "mkdir -p "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp"" (stderr):
INFO: cmd: "rm -rf "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp"/*" (stderr):
INFO: cmd: "mkdir -p "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp"" (stderr):
INFO: cmd: "cp -a "/tmp/tmp.piKMAgmzhv" "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp/root"" (stderr):
ERROR: file(boot.bin):
stat(/usr/local/work/Linux/test/buildroot-2024.05/output/images/boot.bin)
failed: No such file or directory
ERROR: vfat(boot.vfat): could not setup boot.bin
make: *** [Makefile:826: target-post-image] Error 1

I guess what happened was that Buildroot wanted to invoke the Xilinx tool 'genimage' to create boot.bin, which is the FSBL for the Zynq7 chips.
Boot.bin is built from bare-metal code source (probably from Xilinx) and the resulting elf file is massaged to boot.bin by the Xilinx genimage tool. But I don't need boot.bin (I have my own), just the kernel, rootfs and the dtb.

Obviously, my gung-ho approach of reading the first few chapters of the manual and jumping on it is not the way to go. What I'd like to ask for is some advice about the correct way to have a new target board defined, the kernel configured *for that board* and building what I need (but not what I don't need).

Pointers to information about the whole build process would also be appreciated.

Thanks,

Zoltan
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Hello,

Quoted 10 lines · On Sat, 3 Aug 2024 12:50:13 +1000 Zoltán Kócsi <[email protected]> wrote:

New board, with a Xilinx Zynq7 SoC (actually, SoM w/ DRAM). It's just an ARM Cortex-A9 with loads of peripherals and an FPGA. I can boot the board (with bare metal code), can load anything to RAM, configure all devices and all. But I want Linux on it.

Not the Xilinx one, but the mainline version (the Zynq7 is old enough so that all relevant Xilinx drivers are already on the mainline), with the RT patches applied. Don't really want uboot or anything fancy, I can load a kernel image, device tree and rootfs into RAM myself and start the kernel. So all I need is the kernel, the DTB and the rootfs.

So far, sounds good.

Quoted 1 line

Buildroot seems to be a perfect match for this.

Absolutely :-)

Quoted 3 lines

Alas, from here, user stupidity and ignorance to be expected...

First step, let's make an SDK. Load a defconfig with a board using the

No, not an SDK. That's a first mistake on your side, running "make sdk" is not what you want to do. You need to just run "make".

"make sdk" is to build a SDK, i.e Software Development Kit. In the context of Buildroot what this does is generate a tarball that contains the cross-compiler + sysroot, so that application developers can build applications/libraries using the Buildroot cross-compiler, but outside of Buildroot.

In practice, doing "make sdk" builds everything, but I believe it is useful to clarify that building a SDK is not what you want to do here.

Quoted 3 lines

same chip, then change the Buildroot config to use a mainline kernel + RT patch, disable everything that the manual says: busybox, init system, /bin/sh, and tar-ing the root file system.

Why do you disable everything? If you don't have busybox, if you don't have an init system, how do you expect user-space to start up?

Quoted 1 line

Type make sdk.

No, just "make" in your case.

Quoted 3 lines

It chugs along, then the kernel compilation fails with a prototype mismatch in the noveau video driver. Why would it need an nVidia driver for a headless board is a mystery, but ok. Let's configure the kernel.

Where did you specify that you are using a headless platform? You didn't specify which defconfig you started from, so I can't really comment, but maybe Buildroot defconfigs use Linux kernel defconfigs, and kernel defconfigs are very often quite featureful, and include a lot of drivers. This is not Buildroot's fault: it's up to you to pick the right kernel configuration, and tune it to your needs.

Quoted 5 lines

Turn off everything the board doesn't have and/or not needed.

make sdk again. Cool! The kernel compiles. Then Buildroot starts to build rootfs.ext2. First, a warning about 64-bit filesystem support not being enabled, but it builds it anyway.

Which warning?

Quoted 6 lines

Writing superblocks and filesystem accounting information: done. Hurray!

Then:

Quoted 1 line
Quoted 1 line
Quoted 1 line

Executing post-image script board/zynq/post-image.sh

Quoted 13 lines

INFO: cmd: "mkdir -p "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp"" (stderr):
INFO: cmd: "rm -rf "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp"/*" (stderr):
INFO: cmd: "mkdir -p "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp"" (stderr):
INFO: cmd: "cp -a "/tmp/tmp.piKMAgmzhv" "/usr/local/work/Linux/test/buildroot-2024.05/output/build/genimage.tmp/root"" (stderr):
ERROR: file(boot.bin):
stat(/usr/local/work/Linux/test/buildroot-2024.05/output/images/boot.bin)
failed: No such file or directory
ERROR: vfat(boot.vfat): could not setup boot.bin
make: *** [Makefile:826: target-post-image] Error 1

Well, you've started from a defconfig, but then you've disabled random stuff without really understanding what you were doing, what did you expect?

Here what happens is that at the end of the build, Buildroot uses the genimage utility to generate the final SD card image. The layout of the SD card image is defined by a genimage configuration file, and this SD card image layout expects to have a bootloader binary generated.. but I presume you disabled building the bootloader in your Buildroot configuration.

Quoted 3 lines

I guess what happened was that Buildroot wanted to invoke the Xilinx tool 'genimage' to create boot.bin, which is the FSBL for the Zynq7 chips.

No, genimage does not generate boot.bin, it consumes it. boot.bin should have been generated by the U-Boot build... which you have presumably disabled.

Quoted 3 lines

Boot.bin is built from bare-metal code source (probably from Xilinx) and the resulting elf file is massaged to boot.bin by the Xilinx genimage tool.

No. genimage is not a Xilinx tool.

Quoted 1 line

But I don't need boot.bin (I have my own), just the kernel, rootfs and the dtb.

Well, then adjust the genimage configuration file.

However, to be honest, it is not very logical to not need a bootloader. In the vast majority of embedded Linux projects, you will definitely want to have a bootloader.

Hope this helps!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot