From 31abeb7085ceb0a470ba679b35588c13d82f161b Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sat, 18 Feb 2023 15:58:49 +0100 Subject: [PATCH] Disable radio on RaspberryPi --- knowledge base/apt.md | 3 ++ knowledge base/raspberry pi os.md | 64 +++++++++++++++++++++++++------ knowledge base/rfkill.md | 28 ++++++++++++++ 3 files changed, 84 insertions(+), 11 deletions(-) create mode 100644 knowledge base/rfkill.md diff --git a/knowledge base/apt.md b/knowledge base/apt.md index c286317..6f52c19 100644 --- a/knowledge base/apt.md +++ b/knowledge base/apt.md @@ -3,6 +3,9 @@ ## TL;DR ```sh +# Check for broken dependencies. +sudo apt-get check + # Update the packages lists. sudo apt update diff --git a/knowledge base/raspberry pi os.md b/knowledge base/raspberry pi os.md index 68dc3e9..e7a9c25 100644 --- a/knowledge base/raspberry pi os.md +++ b/knowledge base/raspberry pi os.md @@ -1,25 +1,43 @@ # Raspberry Pi OS -1. [Store files on the SD even when the overlay file system is active](#store-files-on-the-sd-even-when-the-overlay-file-system-is-active) +1. [Disable WiFi and Bluetooth](#disable-wifi-and-bluetooth) + 1. [Through boot configuration](#through-boot-configuration) + 2. [Through rfkill](#through-rfkill) 2. [Swap](#swap) 3. [Run containers](#run-containers) 1. [Kernel containerization features](#kernel-containerization-features) 2. [Firewall settings](#firewall-settings) -4. [Sources](#sources) +4. [Store files on the SD even when the overlay file system is active](#store-files-on-the-sd-even-when-the-overlay-file-system-is-active) +5. [Further readings](#further-readings) +6. [Sources](#sources) -## Store files on the SD even when the overlay file system is active +## Disable WiFi and Bluetooth -The files just need to be stored on a different file system from `/`. You can partition the SD and use that, or create a file and mount it as a virtual file system: +### Through boot configuration -```sh -truncate -s '6G' 'file' -mkfs.ext4 'file' -mkdir 'mount/point' -sudo mount -t 'ext4' -o 'loop' 'file' 'mount/point' -sudo chown 'user':'group' 'mount/point' -touch 'mount/point/new-file' +Disable one or both in the `all` section of `/boot/config.txt`: + +```ini +[all] +dtoverlay=disable-wifi +dtoverlay=disable-bt ``` +### Through rfkill + +1. block one or both: + + ```sh + rfkill block wifi + rfkill block bluetooth + ``` + +1. check they are correctly soft-blocked: + + ```sh + rfkill list + ``` + ## Swap Disable the swap file. @@ -57,6 +75,23 @@ update-alternatives --set iptables /usr/sbin/iptables-legacy update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy ``` +## Store files on the SD even when the overlay file system is active + +The files just need to be stored on a different file system from `/`. You can partition the SD and use that, or create a file and mount it as a virtual file system: + +```sh +truncate -s '6G' 'file' +mkfs.ext4 'file' +mkdir 'mount/point' +sudo mount -t 'ext4' -o 'loop' 'file' 'mount/point' +sudo chown 'user':'group' 'mount/point' +touch 'mount/point/new-file' +``` + +## Further readings + +- [rfkill] + ## Sources - The [k3s] project page @@ -64,7 +99,14 @@ update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy - [Run Kubernetes on a Raspberry Pi with k3s] - Project's [issue 2067] + + + +[rfkill]: rfkill.md + + [build your very own self-hosting platform with raspberry pi and kubernetes]: https://kauri.io/build-your-very-own-self-hosting-platform-with-raspberry-pi-and-kubernetes/5e1c3fdc1add0d0001dff534/c +[how to disable your raspberry pi's wi-fi]: https://pimylifeup.com/raspberry-pi-disable-wifi/ [issue 2067]: https://github.com/k3s-io/k3s/issues/2067#issuecomment-664052806 [k3s]: https://k3s.io/ [run kubernetes on a raspberry pi with k3s]: https://opensource.com/article/20/3/kubernetes-raspberry-pi-k3s diff --git a/knowledge base/rfkill.md b/knowledge base/rfkill.md new file mode 100644 index 0000000..837e606 --- /dev/null +++ b/knowledge base/rfkill.md @@ -0,0 +1,28 @@ +# rfkill + +1. [TL;DR](#tldr) +2. [Sources](#sources) + +## TL;DR + +```sh +# List devices. +rfkill list + +# Block a device. +rfkill block 'wifi' +rfkill block 'id' + +# Unblock a device. +rfkill unblock 'bluetooth' +rfkill unblock 'id' +``` + +## Sources + +- [How to disable your Raspberry Pi's Wi-Fi] + + + + +[how to disable your raspberry pi's wi-fi]: https://pimylifeup.com/raspberry-pi-disable-wifi/