rpi-update icon indicating copy to clipboard operation
rpi-update copied to clipboard

[Update bootloader bug] Possibly wrong path for lib on aarch64 armv8+

Open jgabriel98 opened this issue 2 years ago • 5 comments

Uppon running sudo rpi-update, i receive the following error: Path /lib/firmware/raspberrypi/bootloader-2711/latest not found. Please install the rpi-eeprom package first

[spoiler] full sudo rpi-update output
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
 *** Performing self-update
 *** Relaunching after update
 *** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
FW_REV:7ca14294c4bf09fda8d138f9987cd031ced61f7c
BOOTLOADER_REV:72cedfe5eea64bb8509b7d0fec68f5df5dd22f9e
WANT_32BIT:1 WANT_64BIT:1 WANT_PI4:1 WANT_PI5:0
#############################################################
WARNING: This update bumps to rpi-6.1.y linux tree
See: https://forums.raspberrypi.com/viewtopic.php?t=344246

'rpi-update' should only be used if there is a specific
reason to do so - for example, a request by a Raspberry Pi
engineer or if you want to help the testing effort
and are comfortable with restoring if there are regressions.

DO NOT use 'rpi-update' as part of a regular update process.
##############################################################
Would you like to proceed? (y/N)
Downloading bootloader tools
Downloading bootloader images
Path /lib/firmware/raspberrypi/bootloader-2711/latest not found. Please install the rpi-eeprom package first

But when inspecting /lib/firmware/raspberrypi/, the lib exists(but on another path):

pi@raspberrypi:~ $ ls /lib/firmware/raspberrypi
bootloader
pi@raspberrypi:~ $ ls /lib/firmware/raspberrypi/bootloader/
beta  critical  default  latest  release-notes.md  stable

So it seems that the script is looking for the wrong path? (or my system is using a different path? since it's on aarch64)


My system info:

pi@raspberrypi:~ $ uname -m
aarch64
pi@raspberrypi:~ $ uname -r
6.1.53-v8+

(feel free to ask any other information about my system)

jgabriel98 avatar Dec 28 '23 04:12 jgabriel98

It seems the cause is here:

https://github.com/raspberrypi/rpi-update/blob/e85c4b69065260496c138b82b68566217dc89ad0/rpi-update?plain=1#L260-L262

jgabriel98 avatar Dec 28 '23 04:12 jgabriel98

Full uname output:

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.53-v8+ #1680 SMP PREEMPT Wed Sep 13 18:09:06 BST 2023 aarch64 GNU/Linux

jgabriel98 avatar Dec 28 '23 05:12 jgabriel98

I'm no expert on embedded systems, but after looking at the repo history, it seems this behavior was introduced on this commit 62ef428cf9796a327ef44b92caa41c59c02c46e2. Or more precisely, it's new code and was not accounted for different scenarios/machines.

So maybe a check for the kernel arch would solve as a workarround? I'm tempted to edit te script and try it myself, but the chances of bricking my Pi4 due to lack of self expertise turns me off..

jgabriel98 avatar Dec 28 '23 05:12 jgabriel98

/lib/firmware/raspberrypi/bootloader/ is the directory structure for bootloader updates on Bullseye (or equivalent). The bootloader update part of rpi-update requires the new chip-specific directory structure. We could make that a warning (if not already) or just less chatty.

timg236 avatar Jan 03 '24 12:01 timg236

For curiosity: why does rpi-update requires the chip_name in the directory structure?

jgabriel98 avatar Jan 10 '24 17:01 jgabriel98