[Buildroot] [PATCH 1/1] board/pc: improve image generation

Thomas Petazzoni thomas.petazzoni at bootlin.com
Thu Oct 11 19:49:32 UTC 2018


Hello Grégoire,

Thanks a lot for this patch, sorry for the slow answer.

On Thu, 20 Sep 2018 16:33:19 +0200, Grégoire Delattre wrote:
> From: Grégoire Delattre <gregoire.delattre at gmail.com>
> 
> Copy the grub configuration files before creating the filesystem
> image.

I think the commit title is a bit vague, "improve" doesn't mean much
and in fact, your patch fixes a real bug in this defconfig!

So perhaps:

	board/pc: ensure grub.cfg is copied to target filesystem

and then in the commit log, explain that the grub.cfg file was copied
to TARGET_DIR in a post-image hook, i.e after the filesystem image has
been generated, and that in practice it worked because the
board/pc/grub-bios.cfg file is the same as boot/grub2/grub.cfg, which
*is* copied to TARGET_DIR as part of the grub2 build process.

Some more comments below.

> +# Detect boot strategy, EFI or BIOS
> +if [ -f "$BINARIES_DIR/efi-part/startup.nsh" ]; then
> +  cp -f "$BOARD_DIR/grub-efi.cfg" "$BINARIES_DIR/efi-part/EFI/BOOT/grub.cfg"
> +else
> +  cp -f "$BOARD_DIR/grub-bios.cfg" "$TARGET_DIR/boot/grub/grub.cfg"

I think you could copy the boot.img to ${BINARIES_DIR} here as well. A
post-build script is called after all packages have been built, so
${HOST_DIR}/lib/grub/i386-pc/boot.img already exists. This would avoid
the need for the pre-genimage.sh.

Could you rework those minor details and send an updated patch?

Thanks a lot for spotting this mistake!

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list