From: Peter Seiderer <ps.report@gmx.net>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC/next v2 1/2] package/rpi-firmware: rework boot/config file handling
Date: Tue, 9 Mar 2021 21:25:25 +0100 [thread overview]
Message-ID: <20210309212525.2c57f6ce@gmx.net> (raw)
In-Reply-To: <20210308220431.GC2737665@scaer>
Hello Yann,
On Mon, 8 Mar 2021 23:04:31 +0100, "Yann E. MORIN" <yann.morin.1998@free.fr> wrote:
> Peter, All,
>
> Second part of the review... ;-)
>
> On 2021-02-16 21:11 +0100, Peter Seiderer spake thusly:
> > Try to be less smart (focused on the one target/one use-case),
> > instead reduce the rpi-firmware package to a selectable list
> > of (verbatim) installed firmware files.
> >
> > - change rpi-firmware config handling from rpi-variant/rpi-flavour
> > choices to bootcode.bin, pi-default/-extended/-cut-down and
> > pi4-/default/-extended/-cut-down selection
> >
> > - add BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE option to select installable
> > config.txt file
> >
> > - remove config.txt modify code/handling from raspberry post-image.sh
> > script
> >
> > - add different customized config.txt files to the raspberry board
> > section
> >
> > - change raspberry defconfigs to select appropiate rpi-firmware
> > and config.txt files
> >
> > - change genimage-raspberrypi4.cfg/genimage-raspberrypi4-64.cfg to
> > use start4.elf and fixup4.dat
> >
> > With this changes a better support for custom use-cases should
> > be possible, specially multi-target SD cards as suggested by
> > Stefan Agner ([1]).
> >
> > [1] http://lists.busybox.net/pipermail/buildroot/2021-February/303318.html
> >
> > Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> [--SNIP--]
> > diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk
> > index f3d28ef825..a7ab8f0f14 100644
> > --- a/package/rpi-firmware/rpi-firmware.mk
> > +++ b/package/rpi-firmware/rpi-firmware.mk
> > @@ -10,6 +10,46 @@ RPI_FIRMWARE_LICENSE = BSD-3-Clause
> > RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom
> > RPI_FIRMWARE_INSTALL_IMAGES = YES
> >
> > +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN),y)
> > +RPI_FIRMWARE_FILES += bootcode.bin
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI),y)
> > +RPI_FIRMWARE_FILES += start.elf fixup.dat
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_X),y)
> > +RPI_FIRMWARE_FILES += startx.elf fixupx.dat
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_CD),y)
> > +RPI_FIRMWARE_FILES += start_cd.elf fixup_cd.dat
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4),y)
> > +RPI_FIRMWARE_FILES += start4.elf fixup4.dat
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_X),y)
> > +RPI_FIRMWARE_FILES += start4x.elf fixup4x.dat
> > +endif
> > +
> > +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_CD),y)
> > +RPI_FIRMWARE_FILES += start4cd.elf fixup4cd.dat
> > +endif
>
> What about:
>
> RPI_FIRMWARE_FILES = \
> $(if $(BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN),bootcode.bin) \
> $(if $(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI),start.elf fixup.dat) \
> $(if $(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_X),startx.elf fixupx.dat) \
> $(if $(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_CD),start_cd.elf fixup_cd.dat) \
> $(if $(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4),start4.elf fixup4.dat) \
> $(if $(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_X),start4x.elf fixup4x.dat) \
> $(if $(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_CD),start4cd.elf fixup4cd.dat)
>
> Or alternatively:
>
> RPI_FIRMWARE_FILES_$(BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN) += bootcode.bin
> RPI_FIRMWARE_FILES_$(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI) += start.elf fixup.dat
> RPI_FIRMWARE_FILES_$(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_X) += startx.elf fixupx.dat
> RPI_FIRMWARE_FILES_$(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_CD) += start_cd.elf fixup_cd.dat
> RPI_FIRMWARE_FILES_$(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4) += start4.elf fixup4.dat
> RPI_FIRMWARE_FILES_$(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_X) += start4x.elf fixup4x.dat
> RPI_FIRMWARE_FILES_$(BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_CD) += start4cd.elf fixup4cd.dat
Unsettled which of the three versions is the nicest one, seems a matter of
taste (and a matter of trading more lines against long lines), and personal not
much of a friend of the '.._y' pattern...
>
> define RPI_FIRMWARE_INSTALL_BIN
> $(foreach f,$(RPI_FIRMWARE_FILES_y),
> $(INSTALL) -D -m 0644 $(@D)/$(f) $(BINARIES_DIR)/rpi-firmware/$(f)
> )
> endef
>
> > +define RPI_FIRMWARE_INSTALL_BIN
> > + for firmwbin in $(RPI_FIRMWARE_FILES); do \
> > + $(INSTALL) -D -m 0644 $(@D)/boot/$${firmwbin} $(BINARIES_DIR)/rpi-firmware/$${firmwbin} || exit 1; \
> > + done
>
> Use a make-level $(foreach) loop rather than a shell loop (see example
> above).
Definitely an improvement as it avoids the '|| exit 1;' part...
Will rework the patch accordingly...
Regards,
Peter
>
> Regards,
> Yann E. MORIN.
>
next prev parent reply other threads:[~2021-03-09 20:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-16 20:11 [Buildroot] [RFC/next v2 1/2] package/rpi-firmware: rework boot/config file handling Peter Seiderer
2021-02-16 20:11 ` [Buildroot] [RFC/next v2 2/2] package/rpi-firmware: add option for the debug set of start/fixup boot files Peter Seiderer
2021-02-17 9:21 ` [Buildroot] [RFC/next v2 1/2] package/rpi-firmware: rework boot/config file handling Stefan Agner
2021-03-08 21:55 ` Yann E. MORIN
2021-03-08 22:14 ` Peter Seiderer
2021-03-08 22:27 ` Yann E. MORIN
2021-03-09 20:32 ` Peter Seiderer
2021-03-09 21:29 ` Yann E. MORIN
2021-03-09 21:35 ` Yann E. MORIN
2021-03-18 22:25 ` Peter Seiderer
2021-03-20 22:09 ` Yann E. MORIN
2021-03-21 12:00 ` Peter Seiderer
2021-03-08 22:04 ` Yann E. MORIN
2021-03-09 20:25 ` Peter Seiderer [this message]
2021-03-09 20:33 ` Yann E. MORIN
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=20210309212525.2c57f6ce@gmx.net \
--to=ps.report@gmx.net \
--cc=buildroot@busybox.net \
/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