Skip to content

Unlocking radios on RPI with a dedicated service #8210

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

Merged
merged 2 commits into from
May 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions config/sources/families/bcm2711.conf
Original file line number Diff line number Diff line change
@@ -181,6 +181,12 @@ 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/
@@ -255,6 +261,26 @@ function pre_install_distribution_specific__add_rpi_packages() {
fi
}

function pre_install_distribution_specific__unblock_rfkill() {
# Create a systemd service to unblock rfkill
cat > "${SDCARD}/etc/systemd/system/unblock-rfkill.service" <<- EOT
[Unit]
Description=Unblock rfkill manually (no rfkill binary)
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/bash -c 'for f in /sys/class/rfkill/*/state; do echo 1 > "\$f"; done'
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
EOT
# Enable the service to run at boot
display_alert "Enabling unblock-rfkill service" "bcm2711" "info"
chroot_sdcard systemctl enable unblock-rfkill.service
}

# Our default paritioning system is leaving esp on. Rpi3 is the only board that have issues with this.
# Removing the ESP flag from the boot partition should allow the image to boot on both the RPi3 and RPi4.
function pre_umount_final_image__remove_esp() {