diff --git a/config/sources/families/bcm2711.conf b/config/sources/families/bcm2711.conf index 84ee9b4a2e60..6aaa36d3797f 100644 --- a/config/sources/families/bcm2711.conf +++ b/config/sources/families/bcm2711.conf @@ -180,12 +180,6 @@ function post_family_tweaks_bsp__add_hooks_to_move_kernel_initrd_and_dtb() { run_host_command_logged chmod a+x "${destination}"/etc/initramfs/post-update.d/zzz-update-initramfs } -function post_family_tweaks_bsp__rpi_firmware() { - display_alert "$BOARD" "Installing firmware" "info" - git clone https://github.com/pyavitz/firmware.git --depth=1 -q "${destination}"/lib/firmware/updates/brcm - rm -fdr "${destination}"/lib/firmware/updates/brcm/{.git,README.md} -} - function post_family_tweaks_bsp__add_x11_config() { display_alert "rpi5b" "Adding X11 configuration" "info" run_host_command_logged mkdir -p "${destination}"/etc/X11/xorg.conf.d/ @@ -260,6 +254,22 @@ function pre_install_distribution_specific__add_rpi_packages() { fi } +function pre_install_distribution_specific__ubuntu_brcm_firmware() { + # Ubuntu uses compressed "*.zst" firmware of which the kernel has issue. + if [[ "${DISTRIBUTION}" == "Ubuntu" ]]; then + declare destdir="${SDCARD}/lib/firmware/updates" + declare firmware_commit_sha1="996423a18fc9c084c494c8ce378a25c7f8f44db4" # Keep this inside this file, so hashing detect changes and bumps the version of the bsp package + declare srcdir="${SRC}/cache/sources/brcm/${firmware_commit_sha1}" + + run_host_command_logged mkdir -p "${destdir}" + # Get the firmware files from the git repo + fetch_from_repo "https://github.com/pyavitz/firmware.git" "brcm" "commit:${firmware_commit_sha1}" "yes" + # Copy the files from the git repo to the destdir + run_host_command_logged cp -pr "${srcdir}/"* "${destdir}"/ + rm -fdr "${SDCARD}"/lib/firmware/updates/.git + fi +} + function pre_install_distribution_specific__unblock_rfkill() { # Create a systemd service to unblock rfkill cat > "${SDCARD}/etc/systemd/system/unblock-rfkill.service" <<- EOT