Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jgabriel98 opened this issue Dec 28, 2023 · 5 comments
Open

Comments

@jgabriel98
Copy link

jgabriel98 commented Dec 28, 2023

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
Copy link
Author

It seems the cause is here:

rpi-update/rpi-update

Lines 260 to 262 in e85c4b6

fw_path="/lib/firmware/raspberrypi/bootloader-${bcm_chip}/latest"
if [[ ! -d "${fw_path}" ]]; then
echo "Path ${fw_path} not found. Please install the rpi-eeprom package first"

@jgabriel98
Copy link
Author

jgabriel98 commented Dec 28, 2023

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 jgabriel98 changed the title Possibly wrong path for rpi-eeprom (bootloader lib) [Update bootloader bug] Possibly wrong path for rpi-eeprom (bootloader lib) Dec 28, 2023
@jgabriel98 jgabriel98 changed the title [Update bootloader bug] Possibly wrong path for rpi-eeprom (bootloader lib) [Update bootloader bug] Possibly wrong path for lib Dec 28, 2023
@jgabriel98 jgabriel98 changed the title [Update bootloader bug] Possibly wrong path for lib [Update bootloader bug] Possibly wrong path for lib on aarch64 armv8+ Dec 28, 2023
@jgabriel98
Copy link
Author

I'm no expert on embedded systems, but after looking at the repo history, it seems this behavior was introduced on this commit 62ef428.
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..

@timg236
Copy link

timg236 commented Jan 3, 2024

/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 added a commit to timg236/rpi-update that referenced this issue Jan 3, 2024
Skip the bootloader updates without stopping rpi-update of the firmware

See: raspberrypi#28
timg236 added a commit to timg236/rpi-update that referenced this issue Jan 3, 2024
Skip the bootloader updates without stopping rpi-update of the firmware

See: raspberrypi#28
popcornmix pushed a commit that referenced this issue Jan 8, 2024
Skip the bootloader updates without stopping rpi-update of the firmware

See: #28
@jgabriel98
Copy link
Author

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

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

No branches or pull requests

2 participants