Skip to content

rpi-eeprom-update: Firmware downgrades now require the '-y' flag or an interactive response - #875

Merged
timg236 merged 6 commits into
raspberrypi:masterfrom
timg236:bootloader-strict-version-checks
Sep 7, 2026
Merged

timg236 merged 6 commits into
raspberrypi:masterfrom
timg236:bootloader-strict-version-checks

Conversation

@timg236

@timg236 timg236 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

In addition to the version check change the default behaviour to never downgrade the bootloader to an older version without prompting the user unless the '-y' flag is passed.

Also, add defensive code to verify that the update timestamp specified in device-tree is valid and that the node is present e.g. if u-boot is used and device-tree does not match RPI OS expected layout for the bootloader.

Comment thread rpi-eeprom-update-default Outdated
@timg236
timg236 force-pushed the bootloader-strict-version-checks branch from 4799ad1 to bf9e459 Compare September 7, 2026 12:07
Comment thread rpi-eeprom-update-default Outdated
@timg236
timg236 force-pushed the bootloader-strict-version-checks branch from bf9e459 to 03f367f Compare September 7, 2026 12:26
Comment thread rpi-eeprom-update Outdated
Comment thread rpi-eeprom-update Outdated
@timg236
timg236 force-pushed the bootloader-strict-version-checks branch from 03f367f to f12ae3f Compare September 7, 2026 12:28
…unknown

Add some defensive code to ensure that missing / invalid device
tree nodes cannot trigger an automatic firmware update.

Guard readDtInt against an empty property and do not pass an empty
string to date, which would otherwise be interpreted as today.

Remove dead code for the original 'launch' version of the Pi4
bootloader.
…ader

Installing an older bootloader only printed a warning. This is easy to
hit because rpi-eeprom-config applies config changes to the newest image
in the package, which may be older than the factory bootloader on new
board revisions.

Prompt on the tty, or fail if there is none, unless -y or
RPI_EEPROM_ALLOW_DOWNGRADE=1 is given. Check MFG_VER first so a rejected
image is not offered for confirmation. Automatic updates never select an
older image and are unaffected.
Refuse images with an MFG_VER older than the board manufacture version.
Set STRICT_MIN_VER_CHECK=0 to restore the previous warning-only behaviour.
Otherwise the update continues in the background after the timeout
error has been reported.
@timg236
timg236 force-pushed the bootloader-strict-version-checks branch from f12ae3f to 779c5d3 Compare September 7, 2026 12:45
Show stderr as it arrives instead of dumping the captured output after
a failure so a cancelled downgrade reads as a single message.
@timg236

timg236 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

Sorry, I added two more comments. I thought the ctrl-C behaviour from 'rpi-eeprom-config --edit' in the 'do you want to proceed prompt' was a bi t ugly because you got a Python exception backtrace.
Added the exception handler and nicer stderr handling

@timg236
timg236 merged commit a1e23df into raspberrypi:master Sep 7, 2026
1 check passed
@timg236
timg236 deleted the bootloader-strict-version-checks branch September 7, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants