Detect a Pi 5 for its kernel instead of a per-host flag

`pi_standard_setup_install_pi5_kernel` now defaults to "auto": the Pi 5 kernel is
installed when the device tree says Raspberry Pi 5, which covers a card moved over from
a Pi 4 and is a no-op on current images that ship it. true/false still force it, and
musicdolphin no longer needs its own override.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 23:14:18 +02:00
parent a6d4180b2b
commit e3722d2648
3 changed files with 12 additions and 6 deletions

View File

@@ -17,8 +17,7 @@ mediapi_ir_control: irserver
# work there. Needs a libgpiod-based replacement before this goes back to true. # work there. Needs a libgpiod-based replacement before this goes back to true.
mediapi_has_dhtsensor: false mediapi_has_dhtsensor: false
# Raspberry Pi 5. The SD card came from a Pi 4, whose image has no Pi 5 kernel. # Raspberry Pi 5 (detected from the device tree; the Pi 5 kernel is installed as needed).
pi_standard_setup_install_pi5_kernel: true
# The Pi is fed 5V through the HiFiBerry board's GPIO header, not USB-C, so it cannot # The Pi is fed 5V through the HiFiBerry board's GPIO header, not USB-C, so it cannot
# negotiate a 5A supply and would cap USB current at 600mA. # negotiate a 5A supply and would cap USB current at 600mA.
hifiberry_powers_pi: true hifiberry_powers_pi: true

View File

@@ -11,6 +11,7 @@ ansible_become_password: "raspberry"
ansible_become: true ansible_become: true
# Install the Pi 5 (BCM2712) kernel, kernel_2712.img (an arm64 package, hence the :arm64 on # Install the Pi 5 (BCM2712) kernel, kernel_2712.img (an arm64 package, hence the :arm64 on
# the armhf userland). A card imaged on a Pi 4 does not have # an armhf userland). A card imaged on a Pi 4 does not have it, and a Pi 5 will not boot
# it, and a Pi 5 will not boot without. Harmless on a Pi 4, which keeps its own kernel. # without. "auto" installs it when the detected model is a Pi 5 (a no-op on current
pi_standard_setup_install_pi5_kernel: false # images, which ship it); set true/false to force.
pi_standard_setup_install_pi5_kernel: auto

View File

@@ -116,11 +116,17 @@
cache_valid_time: 7200 cache_valid_time: 7200
state: present state: present
- name: Install the Pi 5 kernel - name: Install the Pi 5 kernel
# Only where it can matter: a Pi 5 running an image that was built for an older Pi
# (a card moved over from a Pi 4). A current arm64 image already ships it, and then
# this is a no-op; an armhf userland needs the arm64 kernel package cross-installed.
ansible.builtin.apt: ansible.builtin.apt:
name: "linux-image-rpi-2712:arm64" name: "linux-image-rpi-2712:arm64"
cache_valid_time: 7200 cache_valid_time: 7200
state: present state: present
when: pi_standard_setup_install_pi5_kernel when: >-
(pi_standard_setup_install_pi5_kernel | string | lower == 'true')
or (pi_standard_setup_install_pi5_kernel | string | lower == 'auto'
and 'Raspberry Pi 5' in (pi_standard_setup_raspberry_model.content | b64decode))
notify: Reboot after standard setup notify: Reboot after standard setup
- name: Copy vim config - name: Copy vim config
ansible.builtin.copy: ansible.builtin.copy: