Skip to content

Commit 06e7e25

Browse files
committed
FW update new method v5
1 parent 2c63a34 commit 06e7e25

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

distros/raspberry_pi/install.sh

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -254,21 +254,9 @@ if [ "$(get_install_stage)" -eq 1 ]; then
254254
systemctl stop unattended-upgrades
255255
systemctl disable unattended-upgrades
256256

257-
258-
set_status "[install.sh] - Check for firmware updates for the Raspberry Pi SBC"
259-
apt install -y flashrom
260-
261-
# Check if /proc/cpuinfo exists
262-
if [ -f /proc/cpuinfo ]; then
263-
# Read CPU information from /proc/cpuinfo
264-
CPU_INFO=$(grep -m 1 'Hardware' /proc/cpuinfo | awk '{print $3}')
265-
elif [ -f /proc/device-tree/compatible ]; then
266-
# Alternatively, check /proc/device-tree/compatible
267-
CPU_INFO=$(tr -d '\0' < /proc/device-tree/compatible | grep -o 'bcm271[1-9]')
268-
else
269-
echo "Unable to retrieve hardware information. This might not be a Raspberry Pi."
270-
exit 1
271-
fi
257+
# Ubuntu 24.04 have old rpi-eeprom app
258+
git-force-clone -b master https://github.com/raspberrypi/rpi-eeprom /opt/web3pi/rpi-eeprom
259+
/opt/web3pi/rpi-eeprom/test/install -b
272260

273261
output_reu=""
274262
# Detect SoC version
@@ -277,13 +265,15 @@ if [ "$(get_install_stage)" -eq 1 ]; then
277265

278266
if echo "$SOC_COMPATIBLE" | grep -q "brcm,bcm2711"; then
279267
set_status "[install.sh] - Detected SoC: BCM2711 (e.g., Raspberry Pi 4/400/CM4)"
268+
set_status "[install.sh] - Check for firmware updates for the Raspberry Pi SBC"
280269
output_reu=$(rpi-eeprom-update -a)
281270
echolog "cmd: rpi-eeprom-update -a \n${output_reu}"
282271
elif echo "$SOC_COMPATIBLE" | grep -q "brcm,bcm2712"; then
283272
set_status "[install.sh] - Detected SoC: BCM2712 (e.g., Raspberry Pi 5/500/CM5)"
273+
set_status "[install.sh] - Check for firmware updates for the Raspberry Pi SBC"
284274
# Run the firmware update command
285-
output_reu=$(rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader-2712/latest/pieeprom-2025-01-13-w3p.bin)
286-
echolog "cmd: rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader-2712/latest/pieeprom-2025-01-13-w3p.bin \n${output_reu}"
275+
output_reu=$(rpi-eeprom-update -a)
276+
echolog "cmd: rpi-eeprom-update -a \n${output_reu}"
287277
else
288278
set_error "[install.sh] - Detected another model (not BCM2711 or BCM2712)."
289279
terminateScript
@@ -309,12 +299,13 @@ if [ "$(get_install_stage)" -eq 1 ]; then
309299

310300
# Check the value of rebootReq
311301
if [ "$rebootReq" = true ]; then
302+
echo "[install.sh] - EEPROM update requires a reboot. Restarting the device..."
312303
set_status "[install.sh] - Rebooting after rpi-eeprom-update"
313304
sleep 5
314305
reboot
315-
sleep 5
316306
exit 1
317307
else
308+
echo "[install.sh] - No firmware update required"
318309
set_status "[install.sh] - No firmware update required"
319310
sleep 3
320311
fi

0 commit comments

Comments
 (0)