BCM2711 and BCM2712 require different EEPROM firmware and
consequently the binaries have been moved to chip specific
firmware directories.
firmware-2711 / firmware-2712
Remove the beta release folder and replace with a symlink to the
'latest' release.
Including beta firmware in the APT release causes unecessary churn
and occasionally causes an issue where a user might end up on an
old and unsupported beta release.
Instead, beta releases are will be feature specific and installed
manually via 'rpi-eeprom-config --edit beta-firmware.bin'
i.e. beta releases will be out-of-package custom firmware releases
downloaded from github. The functionality will be merged into
a new latest/stable release or abandoned.
N.B. The old beta releases have been archived to 'old' but are no
longer included in APT.
Debian's raspi-firmware package assumes the boot partition is mounted as
/boot/firmware/ rather than /boot/. This commit adds support for either
approach by default.
latest and default are links to directories, so follow them.
Before:
/usr/bin/rpi-eeprom-update
BOOTLOADER: up to date
CURRENT: Wed Jan 11 17:40:52 UTC 2023 (1673458852)
LATEST: Thu Jan 1 00:00:00 UTC 1970 (0)
RELEASE: critical (/lib/firmware/raspberrypi/bootloader/critical)
After:
/usr/bin/rpi-eeprom-update
BOOTLOADER: up to date
CURRENT: Wed Jan 11 17:40:52 UTC 2023 (1673458852)
LATEST: Wed Jan 11 17:40:52 UTC 2023 (1673458852)
RELEASE: critical (/lib/firmware/raspberrypi/bootloader/critical)
Signed-off-by: Ivan T. Ivanov <iivanov@suse.de>
The busybox implementation of find does not detect recursive nested
symlinks, this results in it finding multiple instances of of_node
matching -samefile, the result of which then fails the -e path test.
The of_node symlink we're tyring to find should match the path
/sys/bus/nvmem/devices/*/of_node so just limit the find depth to 3 as
there's no point searching deeper than that.
Signed-off-by: Allan Xavier <mr.a.xavier@googlemail.com>
Self-update is preferred to using recovery.bin because it avoids modifiy the
boot partition in order to rename recovery.bin after use. Since the 2711 ROM
does not support network or USB MSD loading of recovery.bin self-update has to
be used with other boot modes anyway.
If RPI_EEPROM_SELF_UPDATE=1 then avoid installing recovery.bin so long as the
current bootloader version supports self-update from SD/MMC and that doesn't
look as though SELF_UPDATE has been disable in the EEPROM config.
At present, the update script exits cleanly in the case it finds itself
run on Pi hardware prior to the 4/CM4/400, but if installed on non-Pi
hardware exits with various slightly cryptic errors (missing vcgencmd
and some subsequent math errors from trying to bit-shift the empty
BOARD_INFO variable).
This patch adds a similar exit to the non-Pi 4 case, with a slightly
more useful message.
Display a warning if the bootloader version is downgraded. This can
happen when swapping boot-media and the bootloader configuration is
changed from an OS with an old version of the rpi-eeprom package.
Remove the duplicated "update pending" and "to cancel update" messages.
Add a new flag '-s' which init scripts should specify to indicate that
the bootloader is running silently to do an automatic update. If '-s'
is specified and the 'default' release is specified then the bootloader
is only updated if it is older than the minimum version number specified
within this script.
This allows the default release to be updated to support new hardware
without forcing updates for existing users. However, if the
configuration is updated then the latest release should be used.
E.g. If network boot is selected via raspi-config or the Raspberry Pi
Imager then it's desirable to get the latest production release to
benefit from any bug fixes. However, a bootloader updated to support
new hardware (e.g. CM4) should not require Pi4B users to to upgrade
their bootloader.
The min-version is set to pieeprom-2020-09-03.
The 'strings' utility is installed by binutils whereas 'tr' belongs with
coreutils. Minimal systems will only contain the latter, due to binutils'
size (20-50 MB). So, convert all uses of 'strings' to 'tr' so as to
avoid the package dependency.
The second 'tr' usage converts non-ASCII characters into newlines so as
to isolate the "BUILD_TIMESTAMP=1234567890" statement (similar to what
'strings' does). There is no need for this in the first one: non-ASCII
characters are simply discarded as DT aliases have a fixed one line
format.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Move to to the old directory now that it's no longer referenced by rpi-eeprom-update.
Add a dependency check for 'lspci' which is normally provided by
pciutils or busybox and remove the failover to the vl805 helper.
Tweak the failure messages for missing dependencies to be slightly less
OS specific.
The muxing of the SPI EEPROM and analog audio pins makes flashrom
usage unreliable and having two flashing mechanisms adds unnecessary
complexity to this script.
The bootloader supports EEPROM updates from USB-MSD, Network
and rpiboot there is no real need to support flashrom within this
utility. Therefore, the option to use flashrom can be removed from this
script.
Some users might forcibly install this on a board that isn't an rpi4.
Exit early, and explain why the program can't be run.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Update the human readable version of the version information to indicate
that raspi-config may be used to change the release type.
raspi-config can be replaced with other program names if necessary.
Change default FIRMWARE_RELEASE_STATUS variable to 'default' rather
than 'critical'.
Update the built in help for new release names which align the
rpi-eeprom release names with raspi-config documentation.
Move all package checksum related operations to the subshell and check
the old rpi-eeprom-images packages if rpi-eeprom contains no .bin
files.
The rpi-eeprom-config --edit and --apply option passes the -i flag so
checksums should have been skipped anyway.
Add the -l option to return the latest bootloader EEPROM image. This
will be used by rpi-eeprom-config to provide a more convenient mechanism
for quick config changes.
This command pipeline:
printf '00000000000000000000000000000000' | od -An -t x1 | tr -d ' '
produces this output:
30303030303030303030303030303030
*
Add a `-v` to od and a `\n` to the tr arg like so:
printf '00000000000000000000000000000000' | od -v -An -t x1 | tr -d ' \n'
to instead produce this output:
3030303030303030303030303030303030303030303030303030303030303030
Although it's unlikely that the revision value would generate multiple
lines or contain duplicate lines, it's better to be safe than sorry
especially since the changes to do so do not introduce any extra overhead
and use only POSIX-specified options/arguments.
It's also possible this code fragment could be copied and pasted elsewhere
to provide a "hexdump" of something that might be expected to generate
multiple lines and which may potentially contain duplicates. By fixing
the code here any breakage caused by such copying and pasting is avoided.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Normally BOOTFS is a local FAT partition but with NFS it's possible
that the NFS mount of /boot is not setup to have the equivalent
permissions as /boot. Set the .upd,.sig files to be readable by
all users to to avoid the case where the file is visible to root on the
Pi but is not readable by the TFTP daemon on the server.