home · contact · privacy
Update raspi setup. master
authorChristian Heller <c.heller@plomlompom.de>
Thu, 31 Oct 2024 00:51:02 +0000 (01:51 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 31 Oct 2024 00:51:02 +0000 (01:51 +0100)
many_releases/aptmark/raspi
many_releases/etc/all/locale.conf [new file with mode: 0644]
many_releases/home/desktop/.config/sway/config [new file with mode: 0644]
many_releases/home/user/.config/sway/config [deleted file]
many_releases/scripts/_misc.sh
testing/etc/all/locale.conf [deleted file]
testing/scripts/setup_raspi.sh

index c8b8c571e096bdc2ac6dd905b98e5db01eb848f4..6db4efe3abdaa79d710965f3a54323fef2520ae5 100644 (file)
@@ -9,9 +9,13 @@ sway
 pulseaudio
 # for setting console keyboard via /etc/default/keyboard 
 console-setup
+# for setting system time
+ntpsec-ntpdate
+# basic usage
+mpv
+firefox-esr
 # for convenience
+foot
 sudo
 vim
 ack
-foot
-mpv
diff --git a/many_releases/etc/all/locale.conf b/many_releases/etc/all/locale.conf
new file mode 100644 (file)
index 0000000..dd6eee3
--- /dev/null
@@ -0,0 +1 @@
+LANG="en_US.UTF-8"
diff --git a/many_releases/home/desktop/.config/sway/config b/many_releases/home/desktop/.config/sway/config
new file mode 100644 (file)
index 0000000..ccd2b50
--- /dev/null
@@ -0,0 +1,4 @@
+include /etc/sway/config
+output * background #551199 solid_color
+bindsym $mod+Shift+p exec swaynag -t warning -m 'Really exit sway/end Wayland session?' -B 'Yes, exit sway' 'swaymsg exit'
+input * xkb_layout "de"
diff --git a/many_releases/home/user/.config/sway/config b/many_releases/home/user/.config/sway/config
deleted file mode 100644 (file)
index ccd2b50..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-include /etc/sway/config
-output * background #551199 solid_color
-bindsym $mod+Shift+p exec swaynag -t warning -m 'Really exit sway/end Wayland session?' -B 'Yes, exit sway' 'swaymsg exit'
-input * xkb_layout "de"
index c48602de07343cccd09944a2b22c2e9567041300..98b486f8aae5f686336d5abc2620d5c63d7513b2 100755 (executable)
@@ -95,3 +95,63 @@ upgrade_from_older_release() {
     apt -y -o Dpkg::Options::='--force-confnew' full-upgrade
     apt -y autoremove
 }
+
+add_my_public_key() {
+    # NB: vars expected to be pulled in from caller previously calling constants.sh!
+    apt update
+    apt -y install wget
+    wget "${URL_PUBLIC_KEY}"
+    cat "${FILENAME_PUBLIC_KEY}" >> "${PATH_AUTHORIZED_KEYS}"
+    rm "${FILENAME_PUBLIC_KEY}"
+}
+
+setup_for_desktop() {
+    # NB: vars expected to be pulled in from caller previously calling constants.sh!
+
+    # on installing console-setup, will guide it to do the right thing (including
+    # re-writing /etc/default/keyboard)
+    echo 'XKBLAYOUT=de' > /etc/default/keyboard
+
+    # properly configure apt and reduce system to minimum that satisfies our own
+    # aptmark/ package lists
+    for root in "${PATH_MANY}" '..'; do
+        copy_dirtree "${root}${PATH_REL_ETC}/all" '/etc/apt' apt
+    done
+    apt update
+    mark_nonrequireds_auto
+    for root in "${PATH_MANY}" '..'; do
+        install_for_modules "${root}${PATH_REL_APTMARK}" all $@
+    done
+    apt -y --purge autoremove
+    for root in "${PATH_MANY}" '..'; do
+        copy_dirtree "${root}${PATH_REL_ETC}" '/etc' all $@
+    done
+
+    # Ensure our desired locale is available.
+    locale-gen
+
+    # Set Berlin localtime.
+    ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
+    ntpdate-debian
+
+    # so Sway won't complain about failing to access non-existant background image file
+    sed -i '/^output \* bg/ s/^/#/' /etc/sway/config
+
+    # Set up root environment.
+    for root in "${PATH_MANY}" '..'; do
+        copy_dirtree "${root}${PATH_REL_HOME}" '/root' all root
+    done
+
+    # Set up user and their environment.
+    adduser --disabled-password --gecos "" "${USERNAME}"
+    usermod -a -G sudo "${USERNAME}"
+    for root in "${PATH_MANY}" '..'; do
+        copy_dirtree "${root}${PATH_REL_HOME}" "${PATH_USER_HOME}" all desktop $@
+    done
+    cp -a "${PATH_REPO}" "${PATH_USER_HOME}"
+    mkdir "${PATH_USER_SSH}"
+    cp "${PATH_AUTHORIZED_KEYS}" "${PATH_USER_SSH}"
+    chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
+    passwd "${USERNAME}"
+    rm "${PATH_AUTHORIZED_KEYS}"
+}
diff --git a/testing/etc/all/locale.conf b/testing/etc/all/locale.conf
deleted file mode 100644 (file)
index dd6eee3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-LANG="en_US.UTF-8"
index 791bf51ec5957386bbdcd84889fe5e1754e72b90..995a822bd554b440ff92a718b072e3399edc34c2 100755 (executable)
@@ -1,66 +1,18 @@
-#!/bin/sh 
+#!/bin/sh
 set -e
 set -x
 . ../../constants.sh
 . "${PATH_MANY_MISC}"
 
 # ensure we can log in
+add_my_public_key
 # (alternatively, or preceding this to reduce non-remote typing, TEMPORARILY
 # (!) set password login:)
 # passwd
 # echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
-apt update
-apt -y install wget
-wget "${URL_PUBLIC_KEY}"
-cat "${FILENAME_PUBLIC_KEY}" >> "${PATH_AUTHORIZED_KEYS}"
-rm "${FILENAME_PUBLIC_KEY}" 
 
+# migrate to testing
 upgrade_from_older_release
 
-# on installing console-setup, will guide it to do the right thing (including
-# re-writing /etc/default/keyboard) 
-echo 'XKBLAYOUT=de' > /etc/default/keyboard
-
-# properly configure apt and reduce system to minimum that satisfies our own
-# aptmark/ package lists
-for root in "${PATH_MANY}" '..'; do
-    # copy_dirtree "${root}${PATH_REL_ETC}" '/etc' all raspi
-    copy_dirtree "${root}${PATH_REL_ETC}/all" '/etc/apt' apt
-    copy_dirtree "${root}${PATH_REL_ETC}/raspi" '/etc/apt' apt
-done
-apt update
-mark_nonrequireds_auto
-for root in "${PATH_MANY}" '..'; do
-    install_for_modules "${root}${PATH_REL_APTMARK}" all raspi
-done
-apt -y --purge autoremove
-for root in "${PATH_MANY}" '..'; do
-    copy_dirtree "${root}${PATH_REL_ETC}" '/etc' all raspi
-done
-
-# Ensure our desired locale is available.
-locale-gen
-
-# Set Berlin localtime.
-ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
-
-# so Sway won't complain about failing to access non-existant background image file
-sed -i '/^output \* bg/ s/^/#/' /etc/sway/config
-
-# Set up root environment.
-for root in "${PATH_MANY}" '..'; do
-    copy_dirtree "${root}${PATH_REL_HOME}" '/root' all root
-done
-
-# Set up user and their environment.
-adduser --disabled-password --gecos "" "${USERNAME}" 
-usermod -a -G sudo "${USERNAME}" 
-for root in "${PATH_MANY}" '..'; do
-    copy_dirtree "${root}${PATH_REL_HOME}" "${PATH_USER_HOME}" all user raspi 
-done
-cp -a "${PATH_REPO}" "${PATH_USER_HOME}" 
-mkdir "${PATH_USER_SSH}"
-cp "${PATH_AUTHORIZED_KEYS}" "${PATH_USER_SSH}"
-chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
-passwd "${USERNAME}"
-rm "${PATH_AUTHORIZED_KEYS}"
+# actual setup
+setup_for_desktop raspi