From 65c42992b6b9c138a86ee73bd82b9798ad961a2f Mon Sep 17 00:00:00 2001 From: Roy Date: Mon, 12 Oct 2026 22:35:44 +0800 Subject: [PATCH 1/3] raspinfo: Fix camera listing and vcgencmd errors on current images libcamera-hello was renamed rpicam-hello, and current images only ship the new name. raspinfo therefore never listed cameras and fell back to "vcgencmd get_camera", which Pi 5 firmware does not register, printing "Command not registered" instead of camera information. Prefer rpicam-hello, keep libcamera-hello for older images, and only call get_camera and mem_reloc_stats when the firmware registers them (Pi 5 has no relocatable heap, so mem_reloc_stats does not exist). Fixes #39, fixes #137. Signed-off-by: Roy --- raspinfo/raspinfo | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/raspinfo/raspinfo b/raspinfo/raspinfo index f228d26..f879f57 100755 --- a/raspinfo/raspinfo +++ b/raspinfo/raspinfo @@ -8,6 +8,11 @@ alias filter="sed -e 's/\([0-9a-fA-F]\{1,4\}:\)\{7,7\}[0-9a-fA-F]\{1,4\}/y.y.y.y.y.y.y.y/g' | sed -e 's/[0-9a-fA-F]\{1,4\}:\(:[0-9a-fA-F]\{1,4\}\)\{1,4\}/y::y.y.y.y/g' | sed -e 's/\([0-9]\{1,3\}\.\)\{3,3\}[0-9]\{1,3\}/x.x.x.x/g' | sed -e 's/\([0-9a-fA-F]\{2,2\}\:\)\{5,5\}[0-9a-fA-F]\{2,2\}/m.m.m.m/g'" +# True if the firmware registers the given vcgencmd command (Pi 5 lacks several) +vcgencmd_has() { + vcgencmd commands | tr ',="' ' ' | grep -qw -- "$1" +} + display_info_drm() { # kmsprint is more useful, but not always installed if command -v kmsprint > /dev/null; then @@ -235,9 +240,12 @@ echo "Camera Information" echo "------------------" echo -if command -v libcamera-hello > /dev/null; then +# libcamera-hello was renamed rpicam-hello; current images only have the new name +if command -v rpicam-hello > /dev/null; then + rpicam-hello --list +elif command -v libcamera-hello > /dev/null; then libcamera-hello --list -else +elif vcgencmd_has get_camera; then echo "Camera : "`vcgencmd get_camera` fi @@ -247,8 +255,11 @@ echo "---------------------" echo vcgencmd version -echo -vcgencmd mem_reloc_stats +# Pi 5 has no relocatable heap, so its firmware does not register this command +if vcgencmd_has mem_reloc_stats; then + echo + vcgencmd mem_reloc_stats +fi echo echo "Filesystem information" From b8dd07a098c47ee0d47ce116de204adee7534f19 Mon Sep 17 00:00:00 2001 From: Roy Date: Tue, 13 Oct 2026 09:22:43 +0800 Subject: [PATCH 2/3] raspinfo: Show the EEPROM section on Pi 500 and CM5 The revision-code regex only matches board types 0x11, 0x13, 0x14, 0x15 and 0x17, so Pi 500 (0x19) and CM5 (0x18) never reported their bootloader EEPROM. Also match any board whose device tree is compatible with bcm2712, which covers every current and future BCM2712 board, and keep the regex for the Pi 4 family. Signed-off-by: Roy --- raspinfo/raspinfo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/raspinfo/raspinfo b/raspinfo/raspinfo index f879f57..9a076c2 100755 --- a/raspinfo/raspinfo +++ b/raspinfo/raspinfo @@ -360,7 +360,9 @@ echo sudo dmesg | filter -if grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]1[13457][0-9a-fA-F]$" /proc/cpuinfo +# Pi 4 family by revision code; every BCM2712 board (Pi 5, Pi 500, CM5) by SoC +if grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]1[13457][0-9a-fA-F]$" /proc/cpuinfo || + grep -q bcm2712 /proc/device-tree/compatible 2>/dev/null then echo echo "EEPROM" From 8b71871eafc5dc7150eb6649c9c6a974cf6ebe1a Mon Sep 17 00:00:00 2001 From: Roy Date: Tue, 13 Oct 2026 22:21:21 +0800 Subject: [PATCH 3/3] raspinfo: Select EEPROM boards by SoC instead of revision code Match bcm2711 (Pi 4, Pi 400, CM4) or bcm2712 (Pi 5, Pi 500, CM5) in /proc/device-tree/compatible and drop the revision-code regex. Signed-off-by: Roy --- raspinfo/raspinfo | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/raspinfo/raspinfo b/raspinfo/raspinfo index 9a076c2..d3cee29 100755 --- a/raspinfo/raspinfo +++ b/raspinfo/raspinfo @@ -360,9 +360,8 @@ echo sudo dmesg | filter -# Pi 4 family by revision code; every BCM2712 board (Pi 5, Pi 500, CM5) by SoC -if grep -q "^Revision\s*:\s*[ 123][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]1[13457][0-9a-fA-F]$" /proc/cpuinfo || - grep -q bcm2712 /proc/device-tree/compatible 2>/dev/null +# Boards with a bootloader EEPROM: BCM2711 (Pi 4, Pi 400, CM4) and BCM2712 (Pi 5, Pi 500, CM5) +if grep -q -e bcm2711 -e bcm2712 /proc/device-tree/compatible 2>/dev/null then echo echo "EEPROM"