home · contact · privacy
Upgrade Raspi setup. master
authorChristian Heller <c.heller@plomlompom.de>
Mon, 4 Nov 2024 17:47:20 +0000 (18:47 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 4 Nov 2024 17:47:20 +0000 (18:47 +0100)
many_releases/scripts/_misc.sh
testing/scripts/setup_raspi.sh

index 756c9f5d11793006b3a1c8fa4c51dfe755e7f1d9..aed1526d4c07782d26ed834c55390abf30b3d523 100755 (executable)
@@ -105,9 +105,19 @@ add_my_public_key() {
     rm "${FILENAME_PUBLIC_KEY}"
 }
 
     rm "${FILENAME_PUBLIC_KEY}"
 }
 
-setup_for_desktop() {
+setup_for_raspi() {
     # NB: vars expected to be pulled in from caller previously calling constants.sh!
 
     # NB: vars expected to be pulled in from caller previously calling constants.sh!
 
+    # 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
+
+    # 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
     # on installing console-setup, will guide it to do the right thing (including
     # re-writing /etc/default/keyboard)
     echo 'XKBLAYOUT=de' > /etc/default/keyboard
@@ -120,11 +130,11 @@ setup_for_desktop() {
     apt update
     mark_nonrequireds_auto
     for root in "${PATH_MANY}" '..'; do
     apt update
     mark_nonrequireds_auto
     for root in "${PATH_MANY}" '..'; do
-        install_for_modules "${root}${PATH_REL_APTMARK}" all $@
+        install_for_modules "${root}${PATH_REL_APTMARK}" all raspi
     done
     apt -y --purge autoremove
     for root in "${PATH_MANY}" '..'; do
     done
     apt -y --purge autoremove
     for root in "${PATH_MANY}" '..'; do
-        copy_dirtree "${root}${PATH_REL_ETC}" '/etc' all $@
+        copy_dirtree "${root}${PATH_REL_ETC}" '/etc' all raspi
     done
 
     # Ensure our desired locale is available.
     done
 
     # Ensure our desired locale is available.
@@ -139,18 +149,22 @@ setup_for_desktop() {
 
     # Set up root environment.
     for root in "${PATH_MANY}" '..'; do
 
     # Set up root environment.
     for root in "${PATH_MANY}" '..'; do
-        copy_dirtree "${root}${PATH_REL_HOME}" '/root' all root
+        copy_dirtree "${root}${PATH_REL_HOME}" '/root' all root raspi_root
     done
 
     # Set up user and their environment.
     adduser --disabled-password --gecos "" "${USERNAME}"
     usermod -a -G sudo "${USERNAME}"
     for root in "${PATH_MANY}" '..'; do
     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 $@
+        copy_dirtree "${root}${PATH_REL_HOME}" "${PATH_USER_HOME}" all desktop raspi
     done
     mkdir "${PATH_USER_SSH}"
     cp "${PATH_AUTHORIZED_KEYS}" "${PATH_USER_SSH}"
     chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
     passwd "${USERNAME}"
     rm "${PATH_AUTHORIZED_KEYS}"
     done
     mkdir "${PATH_USER_SSH}"
     cp "${PATH_AUTHORIZED_KEYS}" "${PATH_USER_SSH}"
     chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
     passwd "${USERNAME}"
     rm "${PATH_AUTHORIZED_KEYS}"
+
+    # Activate /root/throttle_cpu.sh daemonization.
+    systemctl enable throttle_cpu.service
+    systemctl start throttle_cpu.service
 }
 }
index 227bd4bb1fea782ec033af3c3e6c369289aa9265..812f5b5d76b4de629c9d48aad2058205ff8a339a 100755 (executable)
@@ -4,19 +4,4 @@ set -x
 . ../../constants.sh
 . "${PATH_MANY_MISC}"
 
 . ../../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
-
-# migrate to testing
-upgrade_from_older_release
-
-# actual setup
-setup_for_desktop raspi
-
-copy_dirtree "${PATH_MANY}${PATH_REL_HOME}" '/root' raspi_root
-systemctl enable throttle_cpu.service
-# systemctl start throttle_cpu.service
+setup_for_raspi