rm "${FILENAME_PUBLIC_KEY}"
}
-setup_for_desktop() {
+setup_for_raspi() {
# 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
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
- copy_dirtree "${root}${PATH_REL_ETC}" '/etc' all $@
+ copy_dirtree "${root}${PATH_REL_ETC}" '/etc' all raspi
done
# Ensure our desired locale is available.
# 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
- 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}"
+
+ # Activate /root/throttle_cpu.sh daemonization.
+ systemctl enable throttle_cpu.service
+ systemctl start throttle_cpu.service
}
. ../../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