From b703b3e7d940d0b1b687b268ab437e8bed8558d4 Mon Sep 17 00:00:00 2001 From: pstruebi Date: Thu, 24 Apr 2025 16:56:44 +0200 Subject: [PATCH] modfiy custom stage run script --- stage2.1_custom/00-install/00-run.sh | 30 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/stage2.1_custom/00-install/00-run.sh b/stage2.1_custom/00-install/00-run.sh index 719efdf..bb25af5 100755 --- a/stage2.1_custom/00-install/00-run.sh +++ b/stage2.1_custom/00-install/00-run.sh @@ -2,7 +2,7 @@ set -e # Install Docker (official instructions for Raspberry Pi OS) -curl -fsSL https://download.docker.com/linux/raspbian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg +curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg apt-get update && apt-get install -y lsb-release @@ -12,22 +12,38 @@ echo \ apt-get update apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin +systemctl enable docker || true + +# Ensure docker group exists and add main user to it +DOCKER_GROUP=docker +if ! getent group "$DOCKER_GROUP" > /dev/null; then + groupadd "$DOCKER_GROUP" +fi +# Use FIRST_USER_NAME if set, else default to 'pi' +USER_TO_ADD="${FIRST_USER_NAME:-pi}" +usermod -aG "$DOCKER_GROUP" "$USER_TO_ADD" || true + docker compose version || true # Install Python Poetry (official installer) -apt-get update -apt-get install -y python3 curl -sSL https://install.python-poetry.org | python3 - +# Make Poetry available to all users +ln -sf /root/.local/bin/poetry /usr/local/bin/poetry # Install WireGuard -apt-get install -y wireguard +apt-get install -y wireguard wireguard-tools -# Disable WiFi (rfkill block and mask wpa_supplicant) -rfkill block wifi || true +# Disable WiFi +# Option 1: Mask wpa_supplicant (prevents WiFi client connections) systemctl mask wpa_supplicant.service || true -# Optionally, remove wpa_supplicant package +# Option 2: Remove wpa_supplicant package (removes WiFi client capability) # apt-get remove -y wpa_supplicant +# Option 3: (Optional, not always necessary) Block WiFi radio with rfkill +apt-get install -y rfkill && rfkill block wifi || true +# Note: rfkill is not strictly necessary if you mask/remove wpa_supplicant, but it disables the radio at a lower level. # Disable Bluetooth service systemctl mask bluetooth.service || true systemctl disable hciuart.service || true + +touch /root/CUSTOM_STAGE_WORKED