diff --git a/README.md b/README.md index 7fa1670..5c7d419 100644 --- a/README.md +++ b/README.md @@ -407,9 +407,6 @@ follows: # Troubleshooting ## `64 Bit Systems` -Please note there is currently an issue when compiling with a 64 Bit OS. See -https://github.com/RPi-Distro/pi-gen/issues/271 - A 64 bit image can be generated from the `arm64` branch in this repository. Just replace the command from [this section](#getting-started-with-building-your-images) by the one below, and follow the rest of the documentation: diff --git a/stage2/02-net-tweaks/01-run.sh b/stage2/02-net-tweaks/01-run.sh index 4aa8148..d719c79 100755 --- a/stage2/02-net-tweaks/01-run.sh +++ b/stage2/02-net-tweaks/01-run.sh @@ -1,22 +1,24 @@ #!/bin/bash -e -install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant" -install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/" +# Newer versions of raspberrypi-sys-mods set rfkill.default_state=0 to prevent +# radiating on 5GHz bands until the WLAN regulatory domain is set. +# Unfortunately, this also blocks bluetooth, so we whitelist the known +# on-board BT adapters here. + +mkdir -p "${ROOTFS_DIR}/var/lib/systemd/rfkill/" +# 5 miniuart 4 miniuart Zero miniuart other other +for addr in 107d50c000.serial 3f215040.serial 20215040.serial fe215040.serial soc; do + echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-${addr}:bluetooth" +done if [ -v WPA_COUNTRY ]; then on_chroot <<- EOF SUDO_USER="${FIRST_USER_NAME}" raspi-config nonint do_wifi_country "${WPA_COUNTRY}" EOF -fi - -# Disable wifi on 5GHz models if WPA_COUNTRY is not set -mkdir -p "${ROOTFS_DIR}/var/lib/systemd/rfkill/" -if [ -n "$WPA_COUNTRY" ]; then - echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan" - echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan" - echo 0 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-1001100000.mmc:wlan" -else - echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan" - echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan" - echo 1 > "${ROOTFS_DIR}/var/lib/systemd/rfkill/platform-1001100000.mmc:wlan" +elif [ -d "${ROOTFS_DIR}/var/lib/NetworkManager" ]; then + # NetworkManager unblocks all WLAN devices by default. Prevent that: + cat > "${ROOTFS_DIR}/var/lib/NetworkManager/NetworkManager.state" <<- EOF + [main] + WirelessEnabled=false + EOF fi diff --git a/stage2/02-net-tweaks/files/wpa_supplicant.conf b/stage2/02-net-tweaks/files/wpa_supplicant.conf deleted file mode 100644 index 0fc335e..0000000 --- a/stage2/02-net-tweaks/files/wpa_supplicant.conf +++ /dev/null @@ -1,2 +0,0 @@ -ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev -update_config=1