summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.com>2024-10-31 13:28:46 +0000
committerSerge Schneider <serge@raspberrypi.com>2024-10-31 13:28:46 +0000
commitda8f0063ea3716fca03510146047df961ed242db (patch)
treef96d712deb08ee8c6c2c25b8b6ffa38ee1f41e63
parentccc23c6738915e57485a7606b777556a36e26892 (diff)
parentc6d303831b9c6214b5d362e82bebb4070f24b291 (diff)
Merge branch 'master' into arm64
-rw-r--r--README.md3
-rwxr-xr-xstage2/02-net-tweaks/01-run.sh30
-rw-r--r--stage2/02-net-tweaks/files/wpa_supplicant.conf2
3 files changed, 16 insertions, 19 deletions
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