home · contact · privacy
Improve new testing setup. master
authorChristian Heller <c.heller@plomlompom.de>
Tue, 25 Feb 2025 03:09:29 +0000 (04:09 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 25 Feb 2025 03:09:29 +0000 (04:09 +0100)
many_releases/aptmark/all
many_releases/scripts/_misc.sh
testing/apt-mark/all
testing/apt-mark/t490s [new file with mode: 0644]
testing/scripts/misc.sh
testing/scripts/setup_desktop.sh

index e0dc9eeff6328ccb0063ae06df3dc1a4b2e3fa5e..41bd4a92a2e5059d0e75bcc1289c32c07b19a0ac 100644 (file)
@@ -1,5 +1,4 @@
-# connectivity: ifupdown seems necessary everyhwere, isc-dhcp-client
-# unpredictably so
+# connectivity: ifupdown seems necessary everyhwere, isc-dhcp-client unpredictably so
 ifupdown
 isc-dhcp-client
 # git for the setup directory; cloning works with ca-certificates
 ifupdown
 isc-dhcp-client
 # git for the setup directory; cloning works with ca-certificates
index 8cf0ca7f3d2a9e8f5f5bfd252ee915705be7b997..0b86948c1120ade66a7833ca7669b12adeb09682 100755 (executable)
@@ -30,8 +30,11 @@ copy_dirtree() {
     modules="$@"
     initial_directory="$(pwd)"
     for module in ${modules}; do
     modules="$@"
     initial_directory="$(pwd)"
     for module in ${modules}; do
-        mkdir -p "${source_root}/${module}"
-        cd "${source_root}/${module}"
+       module_path="${source_root}/${module}"
+       if [ ! -d "${module_path}" ]; then
+           continue
+       fi
+       cd "${module_path}"
         for path in $(find . -type f); do
             target_path="${target_root}"$(echo "${path}" | cut -c2-)
             source_path=$(realpath "${path}")
         for path in $(find . -type f); do
             target_path="${target_root}"$(echo "${path}" | cut -c2-)
             source_path=$(realpath "${path}")
index 617b7071caaa15fc79f4baa13a74cb55034ea9f0..cf4af24b03383800cbc4a0ad5160f737826ae7fe 100644 (file)
@@ -10,3 +10,5 @@ locales
 # extremely useful for basic network debugging; missed these more than once in an emergency
 netcat-traditional
 iputils-ping
 # extremely useful for basic network debugging; missed these more than once in an emergency
 netcat-traditional
 iputils-ping
+# to set the time
+ntpsec-ntpdate
diff --git a/testing/apt-mark/t490s b/testing/apt-mark/t490s
new file mode 100644 (file)
index 0000000..9be8397
--- /dev/null
@@ -0,0 +1,3 @@
+# so we can work without the Ethernet adapter
+network-manager
+
index ad1d4d6d8b3b4607b454bfc75be547d0d2cb0ef1..71f8ba8185501a66375679c9775e5139b9864d71 100644 (file)
@@ -13,17 +13,25 @@ config_tree_prefix="${repo_path}/testing"
 setup_scripts_dir="${config_tree_prefix}/scripts"
 
 get_system_name_arg() {
 setup_scripts_dir="${config_tree_prefix}/scripts"
 
 get_system_name_arg() {
-    legal_system_names="t490s"
+    thinkpad_names="x220 w530 t490s"
+    legal_system_names="${thinkpad_names} h610m"
     found=0
     for system_name_i in $legal_system_names; do
         if [ "$1" = "$system_name_i" ]; then
             found=1
             system_name="${system_name_i}"
     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   
+           break
         fi
     done
     if [ "$found" = 0 ]; then
         echo "Need legal system name."
         false
     fi
         fi
     done
     if [ "$found" = 0 ]; then
         echo "Need legal system name."
         false
     fi
+    system_class_name=
+    for thinkpad_name in $thinkpad_names; do
+        if [ "${system_name}" = "${thinkpad_name}" ]; then
+           system_class_name=thinkpad
+           break
+       fi
+    done
 }
 }
index d739593cc50bff5beb2c14b25425335e370d1460..c0170955c752b69f0f0358830da3e3fe2c1f97e6 100755 (executable)
@@ -5,11 +5,12 @@ set -x
 
 expect_min_n_args 1 "(system name)" "$@"
 get_system_name_arg "$1"
 
 expect_min_n_args 1 "(system name)" "$@"
 get_system_name_arg "$1"
+min_modules="all ${system_class_name} ${system_name}"
 
 # Adapt /etc/ to our needs by copying from ./etc_files. This will set
 # basic configurations affecting following steps, such as setup of APT
 # and the locale selection, so needs to be right at the beginning.
 
 # Adapt /etc/ to our needs by copying from ./etc_files. This will set
 # basic configurations affecting following steps, such as setup of APT
 # and the locale selection, so needs to be right at the beginning.
-copy_dirtree.sh "${config_tree_prefix}/${PATH_REL_ETC}" "" all
+copy_dirtree "${config_tree_prefix}/${PATH_REL_ETC}" "" ${min_modules}
 
 # Migrate to testing.
 upgrade_from_older_release
 
 # Migrate to testing.
 upgrade_from_older_release
@@ -45,12 +46,16 @@ echo "${final_ip} ${system_name}" >> /etc/hosts
 # Ensure package installation state as defined by what packages are
 # defined as required by Debian policy and by settings in ./apt-mark/.
 mark_nonrequireds_auto
 # Ensure package installation state as defined by what packages are
 # defined as required by Debian policy and by settings in ./apt-mark/.
 mark_nonrequireds_auto
+if [ "$system_name" = "h610m" ]; then
+    # Hold kernel known to work with nvidia-drivers.
+    apt-mark hold linux-image-amd64 linux-headers-amd64
+fi
 for root in "${PATH_MANY}" '..'; do
 for root in "${PATH_MANY}" '..'; do
-    install_for_modules "${root}/${PATH_REL_APTMARK}" all 
+    install_for_modules "${root}/${PATH_REL_APTMARK}" ${min_modules}
 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' ${min_modules}
 done
 
 # Ensure our desired locale is available.
 done
 
 # Ensure our desired locale is available.
@@ -59,3 +64,17 @@ locale-gen
 # Set Berlin localtime.
 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
 ntpdate-debian
 # Set Berlin localtime.
 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
 ntpdate-debian
+
+# Set up root environment.
+for root in "${PATH_MANY}" '..'; do
+    copy_dirtree "${root}/${PATH_REL_HOME}" '/root' ${min_modules} minimal 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}" ${min_modules} desktop
+done
+chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
+passwd "${USERNAME}"