Commit Graph

70 Commits

Author SHA1 Message Date
Nicolas Saenz Julienne
2aa97029fd rpi-eeprom-update: Get bootloader configuration from DT
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
2021-01-22 19:20:22 +01:00
Tim Gover
a95ecf9355 rpi-eeprom-update: Update docs and default ENV for release names
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.
2021-01-13 09:52:56 +00:00
Tim Gover
690872a3ca rpi-eeprom-update: Add trailing / so find follows the FW symlink 2021-01-12 16:44:31 +00:00
Tim Gover
289befb382 rpi-eeprom-update: Get bootloader build-timestamp from device-tree 2021-01-09 09:38:31 +00:00
Andrew Scheller
435da0f3cb typos 2020-10-28 09:47:50 +00:00
Tim Gover
7612907337 Add the timestamp of the update to the pieeprom.sig file.
Add the timestamp to pieeprom.sig for use with a future bootloader
update.

This is not relevant for the VL805 firmware because it is not
configurable.
2020-10-28 07:40:59 +00:00
Tim Gover
b1ed98c779 rpi-eeprom-update: Skip checksums if there is no dpkg info directory 2020-10-20 16:49:36 +01:00
Tim Gover
2730572da2 rpi-eeprom-update: Fix shellcheck warnings 2020-10-20 16:49:36 +01:00
Tim Gover
d34f62ee3d rpi-eeprom-update: Move .bin filter for checksums into subshell
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.
2020-10-01 20:07:53 +01:00
Tim Gover
6ab4179bae rpi-eeprom-config: Trap errors when deleting previous update files 2020-09-29 10:35:34 +01:00
Tim Gover
b6c6b03add rpi-eeprom-update: Add -b flag to output BOOTFS path
Add an API for external scripts to safely determine which the directory
the EEPROM image update files will be written to.
2020-09-28 10:41:20 +01:00
Tim Gover
ccd8444501 Implement review comments
Update --apply --edit to allow the eeprom image to be specified.
Add some error checking around chmod in rpi-eeprom-update

TODO: Test this on NFS
2020-09-28 10:41:20 +01:00
Tim Gover
a554034c1d rpi-eeprom-update: Add -l option to resolve the latest bootloader image
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.
2020-09-28 10:41:20 +01:00
Tim Gover
29fe479af9 rpi-eeprom-update: Restrict package checksums to EEPROM images.
Only check EEPROM image binaries because it's annoying if
rpi-eeprom-update errors due to the release notes or the script
changing.
2020-09-28 10:41:20 +01:00
Tim Gover
8d4af8db97 rpi-eeprom-update: Use multiple sources for BOARD_INFO
Try device-tree, then cpuinfo and failing that raw OTP.
2020-09-28 10:37:15 +01:00
Kyle J. McKay
28153db403 rpi-eeprom-update: avoid any possible od accidents
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>
2020-09-03 11:37:28 -07:00
Tim Gover
73e845de28 Use od instead of hexdump to simplify package dependencies 2020-09-03 13:08:12 +01:00
Tim Brooks
18d50d52ca Fix #211 - hexdump error on older Pi models 2020-09-01 23:19:01 +01:00
Hristo Venev
eea80bc4ab rpi-eeprom-update: Upstream kernel fix
Upstream kernels do not list the board revision in /proc/cpuinfo. Get it
from the device tree instead.
2020-08-20 13:15:32 +03:00
Tim Gover
a5794dde78 rpi-eeprom-update: Set file permissions on the EEPROM update files
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.
2020-07-21 16:08:22 +01:00
Tim Gover
dd15621c8a Change "update required" message to "update available"
Originally, rpi-eeprom-update was only for critically important
security or hardware compatibility requirements. Change the
text of rpi-eeprom-update to indicate that an update is available
rather than being required.
N.B. The systemd service runs with the -a flag which automatically
applies available updates because most users just use the release
folder which is only updated for major/critical updates.
2020-07-16 12:03:52 +01:00
Tim Gover
b2e2818b28 Disable rpi-eeprom-update by default on CM4 2020-07-07 11:50:32 +01:00
Dave Jones
bd7957d353 Query checksums from rpi-eeprom instead of rpi-eeprom-images 2020-06-24 20:38:05 +01:00
Kyle J. McKay
4abaa46e1f rpi-eeprom-update: compare versions algebraically
Use `-lt` rather than `\<` so that, for example, this:

    [ 2 -lt 17 ]

is true (whereas with `\<` in place of `-lt` it's false).

Also change an `=` comparison to `-eq` to be technically correct.

Helped-by: Tim Gover <tim.gover@raspberrypi.org>
Helped-by: MilhouseVH <milhouseVH.github@nmacleod.com>
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
2020-06-04 14:42:40 -07:00
andrum99
beceaab7ae reword 2020-06-03 17:26:03 +01:00
andrum99
7cf2828046 Clarify -d option when EEPROM update not needed 2020-06-03 17:24:29 +01:00
andrum99
ed86d5e144 rpi-eeprom-update - fix description of -d flag 2020-06-03 17:13:33 +01:00
Tim Gover
064c9d7395 rpi-eeprom-update: Remove warning in -f section
The warning is only relevant in USE_FLASHROM mode
2020-06-03 15:36:14 +01:00
Andrew Scheller
0cfc72304e small typos 2020-05-29 12:57:07 +01:00
MilhouseVH
40d608daaa include vl805 eeprom presence in machine output 2020-05-29 01:48:20 +01:00
Tim Gover
fd2ea72b26 rpi-eeprom-update: Update VL805 version check for boards without VL805 EEPROM
Newer board revisions do not have a dedicated VL805 EEPROM. Instead,
the VL805 firmware is loaded from the bootloader EEPROM.
Update the version check to ignore standalone VL805 update files
on boards without a dedicated VL805 EEPROM.
2020-05-28 08:19:30 +01:00
Tim Gover
7c181f40f2 rpi-eeprom-update: Update help for FIRMWARE_RELEASE_STATUS 2020-05-26 15:01:28 +01:00
Tim Gover
5fb23cfcb8 rpi-eeprom-update: Mark USE_FLASHROM as deprecated. 2020-05-26 10:25:40 +01:00
Tim Gover
21bd52daa0 rpi-eeprom-update: Change BOOTFS .elf check to a warning
If no .elf files are found in the boot partition then raise a warning
instead of an error. This normally indicates a system configuration
error but allow the usage of this tool in non-standard setups.
2020-05-25 11:32:51 +01:00
andrum99
bbffc1a9fc rpi-eeprom-update: mention Pi4 only, remove references to SD card 2020-05-12 14:36:48 +01:00
Ryan Finnie
22ce0605e4 Allow for run from local git checkout
- Set firmware directory to script dir/firmware as last resort
- Bypass IGNORE_DPKG_CHECKSUMS when in local mode
2020-03-06 09:06:51 -08:00
Tim Gover
c77267e84b Print the firmware image directory in the version status message 2020-02-28 15:01:41 +00:00
Tim Gover
3be67ad8a8 firmware: Promote the latest beta firmware to stable
The beta release with supports network boot is now stable enough
for most configurations. This is now frozen except for major bugs
in order to allow more experimental features to be released as
beta.
2020-02-27 14:51:53 +00:00
Tim Gover
fed1ca62a5 rpi-eeprom-update: Remove dependency on vl805
The vl805 utility is not available for aarch64 and is deprecated
because it's only required for USE_FLASHROM.

Remove the dependency check so that it can be removed from the package.

The USE_FLASHROM code will be removed at a later date once the
self-update mechanism in the bootloader EEPROM is released.
2020-02-27 14:00:27 +00:00
Tim Gover
da14a843a7 rpi-eeprom-update: Add support for board-revision specific images.
Add the option for board-revision specific bootloaders firmware. This
allows critical firmware updates to be applied to specific board
revisions first before these are promoted to the generic firmware
directories.

Update the find operation to follow symlinks so that EEPROM images
in the board revision specific subdirectories can be links to the
generic images.
2020-01-10 15:11:27 +00:00
Tim Gover
e9290b3bfc Merge pull request #67 from timg236/vl805_match_ver
rpi-eeprom-update: Improve version selection for VL805
2020-01-08 09:53:01 +00:00
Andrew Scheller
d92d4e1a94 Fix typo
As spotted in the now-closed #65
2019-12-17 19:50:46 +00:00
Tim Gover
1a0070fe30 rpi-eeprom-update: Improve version selection for VL805
Deprecate the vl805.latest file and compare version numbers. This
ensures that the rpi-eeprom-update will never downgrade the VL805.
2019-12-12 19:06:18 +00:00
Tim Gover
0855227532 rpi-eeprom-update: Add hook/flashrom help and fix section formatting
Document the EEPROM_CONFIG_HOOK option and move the existing
USE_FLASHROM env var to the new section.

The other more obscure path options can be documented in other commits
2019-12-11 11:17:35 +00:00
Tim Gover
560f001e99 rpi-eeprom-update: Add support for config txt processing hooks 2019-12-10 12:23:08 +00:00
Tim Gover
390b4b85e1 vcgencmd: Use cpuinfo instead of otp_dump
On a 64-bit beta kernel a hang in vcgencmd otp_dump was observed
blocking rpi-eeprom-update and apt. Since there is another method
for obtaining the board Revision that should never block use that instead.
2019-11-29 15:21:58 +00:00
MilhouseVH
e204b1f4eb use lspci if available instead of vl805. Avoid calling vl805 twice. 2019-11-09 03:46:23 +00:00
josef radinger
6895418ffe fix typo 2019-10-29 15:16:43 +01:00
Tim Gover
5c9a0cf40d rpi-eeprom-update: Check for vcmailbox, vcgencmd, dtparam, dtoverlay
Check for these commands and issue an error indicating how to fix this
on Debian. These are all installed by default on Raspbian but this
script might be re-used in other-systems e.g. custom busybox builds.
2019-10-24 15:08:12 +01:00
Tim Gover
95ba7b50eb Tweak update status for BOOTLOADER, VL805
Make up-to-date message specific to bootloader or vl805 and indicate if
the tool was not run as root.
2019-10-24 12:57:01 +01:00