Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Zoltán Kócsi" <zoltan@bendor.com.au>
To: buildroot@buildroot.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] User mailing list?
Date: Sat, 3 Aug 2024 12:50:13 +1000	[thread overview]
Message-ID: <20240803125013.5b7b907c@mazsola> (raw)
In-Reply-To: <20240802235743.58a983a5@windsurf>

Hi there,

On Fri, 2 Aug 2024 23:57:43 +0200
Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote:

> 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:

>>>   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
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-08-03  2:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02 20:25 [Buildroot] User mailing list? Zoltán Kócsi
2024-08-02 21:57 ` Thomas Petazzoni via buildroot
2024-08-03  2:50   ` Zoltán Kócsi [this message]
2024-08-03  9:44     ` Thomas Petazzoni via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240803125013.5b7b907c@mazsola \
    --to=zoltan@bendor.com.au \
    --cc=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox