From 3c6eb79834fed6221065159f1bb87315aa142a95 Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Sun, 19 Dec 2021 22:12:08 -0500 Subject: [PATCH] Avoid using magic in /boot to make changes --- Containerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Containerfile b/Containerfile index eb8c2cc..cc8d711 100644 --- a/Containerfile +++ b/Containerfile @@ -50,11 +50,17 @@ RUN sed -i 's/gb/us/' /etc/default/keyboard # Set up wifi by getting raspberry pi os to do the shim work # @see https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html RUN if [ -n "$RPI_WIFI_NETWORK" ] ; then \ - cp /etc/wpasupplicant/wpa_supplicant.conf /boot/ ; \ - wpa_passphrase "$RPI_WIFI_NETWORK" "$RPI_WIFI_PASSPHRASE" > /boot/wpa_supplicant.conf ; \ - touch /boot/ssh ; \ + wpa_passphrase "$RPI_WIFI_NETWORK" "$RPI_WIFI_PASSPHRASE" >> /etc/wpa_supplicant.conf ; \ fi +# Enable SSH access +RUN systemctl enable ssh + +# Remove the resize on boot +RUN sed -i 's#/usr/lib/raspi-config/init_resize.sh#/sbin/init#' /boot/cmdline.txt +RUN sed -i 's/fsck.repair=yes//' /boot/cmdline.txt +RUN update-rc.d resie2fs_once remove && rm /etc/init.d/resize2fs_once + # Change pi user's password RUN if [ -n "$RPI_PASSWORD" ] ; then echo "pi:${RPI_PASSWORD}" | chpasswd ; fi