#
# CAUTION: This removes original files at the affected paths.
set -e
+. ./misc.sh
+
+expect_n_args 3 "(source root, target root, modules)" "$@"
-if [ "$#" -lt 3 ]; then
- echo 'Need arguments: source root, target root, modules.'
- false
-fi
source_root="$1"
target_root="$2"
shift 2
#
# Ignores anything in an apt-mark/ file after the last newline.
set -e
-debian_version="bookworm"
-
-config_tree_prefix="${HOME}/config/${debian_version}"
-aptmark_dir="${config_tree_prefix}/apt-mark"
+. ./misc.sh
for target in "$@"; do
path="${aptmark_dir}/${target}"
--- /dev/null
+#!/bin/sh
+set -e
+debian_version="bookworm"
+legal_system_names="x220 w530"
+config_tree_prefix="${HOME}/config/${debian_version}"
+setup_scripts_dir="${config_tree_prefix}/setup_scripts"
+aptmark_dir="${config_tree_prefix}/apt-mark"
+
+expect_n_args() {
+ min_args="$1"
+ explainer="$2"
+ shift 2
+ if [ "$#" -lt "${min_args}" ]; then
+ echo "Need at least $1 arguments … ${explainer}"
+ false
+ fi
+}
+
+get_system_name_arg() {
+ found=0
+ for system_name_i in $legal_system_names; do
+ if [ "$1" = "$system_name_i" ]; then
+ found=1
+ system_name="${system_name_i}"
+ continue
+ fi
+ done
+ if [ "$found" = 0 ]; then
+ echo "Need legal system name."
+ false
+ fi
+}
# "required" or not depended on by packages of priority "required"
# or not listed in the argument-selected files of apt-mark/.
set -e
-debian_version="bookworm"
-
-config_tree_prefix="${HOME}/config/${debian_version}"
-aptmark_dir="${config_tree_prefix}/apt-mark"
+. ./misc.sh
dpkg-query -Wf '${Package} ${Priority}\n' | grep ' required' | sed 's/ required//' > /tmp/list_white_unsorted
for target in "$@"; do
#
# Ignores IPv6s.
set -e
+. ./misc.sh
+
+expect_n_args 1 "(hostname, fqdn)" "$@"
hostname="$1"
fqdn="$2"
-if [ "${hostname}" = "" ]; then
- echo "Need hostname as argument."
- false
-fi
echo "${hostname}" > /etc/hostname
hostname "${hostname}"
#!/bin/sh
set -e
debian_version="bookworm"
+. ./misc.sh
# Provide maximum input for set_hostname_and_fqdn.sh.
if [ "$#" -lt 2 ]; then
fqdn="$2"
shift 2
-config_tree_prefix="${HOME}/config/${debian_version}"
-setup_scripts_dir="${config_tree_prefix}/setup_scripts"
cd "${setup_scripts_dir}"
# Adapt /etc/ to our needs by copying from ./etc_files. This will set
#!/bin/sh
set -e
set -x
-debian_version="bookworm"
-legal_system_names="x220 w530"
+. ./misc.sh
-if [ "$#" -ne 1 ]; then
- echo 'Need exactly one argument (system name).'
- false
-fi
-found=0
-for system_name_i in $legal_system_names; do
- if [ "$1" = "$system_name_i" ]; then
- found=1
- system_name="${system_name_i}"
- continue
- fi
-done
-if [ "$found" = 0 ]; then
- echo "Need legal system name."
- false
-fi
+expect_n_args 1 "(system name)" "$@"
+get_system_name_arg "$1"
# Set up system without user environment.
-config_tree_prefix="${HOME}/config/${debian_version}"
-setup_scripts_dir="${config_tree_prefix}/setup_scripts"
cd "${setup_scripts_dir}"
./setup.sh "${system_name}" "" user desktop thinkpad "${system_name}"
+# Set up NVIDIA eGPU config.
if [ "$system_name" = "w530" ]; then
cd
git clone https://github.com/NVIDIA/open-gpu-kernel-modules
#!/bin/sh
set -e
debian_version="bookworm"
-legal_system_names="x220 w530"
+. ./misc.sh
-if [ "$#" -ne 1 ]; then
- echo 'Need exactly one argument (system name).'
- false
-fi
-found=0
-for system_name_i in $legal_system_names; do
- if [ "$1" = "$system_name_i" ]; then
- found=1
- system_name="${system_name_i}"
- continue
- fi
-done
-if [ "$found" = 0 ]; then
- echo "Need legal system name."
- false
-fi
-system_name="$1"
+expect_n_args 1 "(system name)" "$@"
+get_system_name_arg "$1"
-# config_tree_prefix="${public_repos_dir}/config/${debian_version}"
git clone https://plomlompom.com/repos/clone/config
+cd $setup_scripts_dir
./copy_dirtree.sh "${config_tree_prefix}/home_files" "${HOME}" minimal user "${system_name}"
# public_repos_dir="${HOME}/public_repos"