home · contact · privacy
Fixes. master
authorChristian Heller <c.heller@plomlompom.de>
Mon, 31 Mar 2025 08:00:58 +0000 (10:00 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 31 Mar 2025 08:00:58 +0000 (10:00 +0200)
bookworm/preseed.cfg
bookworm/scripts/lib/install_aptmarkeds [deleted file]
bookworm/scripts/lib/mark_nonrequireds_auto [deleted file]
bookworm/scripts/setup_server.sh
testing/scripts/setup_desktop.sh

index 481658a21abdd9905e1499eef4f3bbefb9703da8..82d6d682102e854e6533306414ff82f228c7c5a5 100644 (file)
@@ -1,6 +1,6 @@
 #_preseed_V1
 
 #_preseed_V1
 
-d-i debian-installer/load-cdrom/title
+#d-i debian-installer/load-cdrom/title
 
 d-i netcfg/choose_interface select auto
 d-i netcfg/link_wait_timeout string 3
 
 d-i netcfg/choose_interface select auto
 d-i netcfg/link_wait_timeout string 3
@@ -13,8 +13,11 @@ d-i netcfg/get_domain string unassigned-domain
 d-i passwd/root-login boolean true
 user-setup-udeb        passwd/make-user boolean false
 
 d-i passwd/root-login boolean true
 user-setup-udeb        passwd/make-user boolean false
 
-# d-i partman-auto/method string crypto
+#d-i partman-auto/method string crypto
+#d-i partman-auto/select_disk /var/lib/partman/devices/=dev=nvme0n1
 d-i partman-auto-lvm/guided_size string max
 d-i partman-auto-lvm/guided_size string max
+#d-i partman-auto-lvm/new_vg_name plomvg
+#d-i partman-lvm/confirm true
 #d-i partman-auto/choose_recipe select atomic
 d-i partman-auto-crypto/erase_disks boolean false
 # d-i partman-lvm/confirm boolean true
 #d-i partman-auto/choose_recipe select atomic
 d-i partman-auto-crypto/erase_disks boolean false
 # d-i partman-lvm/confirm boolean true
@@ -22,11 +25,11 @@ d-i partman-auto-crypto/erase_disks boolean false
 d-i base-installer/kernel/image string linux-image-amd64
 d-i base-installer/initramfs-tools/driver-policy most
 
 d-i base-installer/kernel/image string linux-image-amd64
 d-i base-installer/initramfs-tools/driver-policy most
 
-# d-i pkgsel/run_tasksel boolean false
+#d-i pkgsel/run_tasksel boolean false
 
 
-d-i apt-setup/use-mirror true
+#d-i apt-setup/use-mirror true
 d-i mirror/protocol string http
 d-i mirror/protocol string http
-d-i mirror/http/proxy
+#d-i mirror/http/proxy
 #d-i mirror/http/hostname string http.us.debian.org
 d-i apt-setup/enable-source-repositories true
 d-i apt-setup/non-free-firmware boolean true
 #d-i mirror/http/hostname string http.us.debian.org
 d-i apt-setup/enable-source-repositories true
 d-i apt-setup/non-free-firmware boolean true
@@ -34,7 +37,6 @@ d-i apt-setup/non-free boolean true
 d-i apt-setup/contrib boolean true
 d-i apt-setup/services-select security, updates
 
 d-i apt-setup/contrib boolean true
 d-i apt-setup/services-select security, updates
 
-# d-i grub-installer/only_debian boolean true
 d-i grub-installer/force-efi-extra-removable false
 d-i grub-installer/update-nvram true
 d-i grub-installer/enable_os_prober_otheros_no false
 d-i grub-installer/force-efi-extra-removable false
 d-i grub-installer/update-nvram true
 d-i grub-installer/enable_os_prober_otheros_no false
diff --git a/bookworm/scripts/lib/install_aptmarkeds b/bookworm/scripts/lib/install_aptmarkeds
deleted file mode 100644 (file)
index daf91d1..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-install_aptmarkeds() {
-    # Walk through the package names in ../aptmark/ files to ensure the respective
-    # packages are installed.
-    for TAG in $@; do
-        PATH_APTMARK_TAG="${PATH_CONF}/aptmark/${TAG}"
-        if [ ! -f "${PATH_APTMARK_TAG}" ]; then
-            continue
-        fi
-        cat "${PATH_APTMARK_TAG}" | while read LINE; do
-            if [ ! $(echo "${LINE}" | cut -c1) = "#" ]; then
-                apt-get -y -o Dpkg::Options::="--force-confnew" install "${LINE}"
-            fi
-        done
-    done
-}
diff --git a/bookworm/scripts/lib/mark_nonrequireds_auto b/bookworm/scripts/lib/mark_nonrequireds_auto
deleted file mode 100644 (file)
index 0b2a435..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-mark_nonrequireds_auto() {
-    PATH_LIST_PREFIX=/tmp/list_
-    PATH_LIST_UNSORTED="${PATH_LIST_PREFIX}unsorted"
-    PATH_LIST_ALL_PACKAGES="${PATH_LIST_PREFIX}all_packages"
-    PATH_LIST_WHITE="${PATH_LIST_PREFIX}white"
-    PATH_LIST_BLACK="${PATH_LIST_PREFIX}black"
-    TOK_REQ=' required'
-    dpkg-query -Wf '${Package} ${Priority}\n' | grep "${TOK_REQ}" | sed "s/${TOK_REQ}//" > "${PATH_LIST_UNSORTED}"
-    sort "${PATH_LIST_UNSORTED}" | uniq > "${PATH_LIST_WHITE}"
-    dpkg-query -Wf '${Package}\n' > "${PATH_LIST_UNSORTED}"
-    sort "${PATH_LIST_UNSORTED}" | uniq > "${PATH_LIST_ALL_PACKAGES}"
-    comm -3 "${PATH_LIST_ALL_PACKAGES}" "${PATH_LIST_WHITE}" > "${PATH_LIST_BLACK}"
-    apt-mark auto `cat "${PATH_LIST_BLACK}"`
-    rm "${PATH_LIST_UNSORTED}" "${PATH_LIST_ALL_PACKAGES}" "${PATH_LIST_WHITE}" "${PATH_LIST_BLACK}"
-}
index c65fd7c1da5aae8680be920e7162053a17b5e781..e47712ed951f21c4d6ae5fc5b6164946666d5a55 100755 (executable)
@@ -5,8 +5,8 @@ cd $(dirname "$0")
 . lib/copy_dirtree
 . lib/determine_ip
 . lib/expect_min_n_args
 . lib/copy_dirtree
 . lib/determine_ip
 . lib/expect_min_n_args
-. lib/install_aptmarkeds
-. lib/mark_nonrequireds_auto
+. lib/init_packages
+. libs/setup_users
 
 MIN_TAGS='all server'
 
 
 MIN_TAGS='all server'
 
@@ -22,17 +22,11 @@ PATH_REPO="$(dirname ${PARENT_DIR})"
 PATH_REL_ETC=etc
 PATH_CONF="${PATH_REPO}/${DEBIAN_RELEASE}"
 PATH_CONF_ETC="${PATH_CONF}/${PATH_REL_ETC}"
 PATH_REL_ETC=etc
 PATH_CONF="${PATH_REPO}/${DEBIAN_RELEASE}"
 PATH_CONF_ETC="${PATH_CONF}/${PATH_REL_ETC}"
-PATH_CONF_HOME="${PATH_CONF}/home"
 PATH_USER_SSH="${PATH_USER_HOME}/${PATH_REL_SSH}"
 PATH_ETC="/${PATH_REL_ETC}"
 PATH_HOSTS="${PATH_ETC}/hosts"
 
 PATH_USER_SSH="${PATH_USER_HOME}/${PATH_REL_SSH}"
 PATH_ETC="/${PATH_REL_ETC}"
 PATH_HOSTS="${PATH_ETC}/hosts"
 
-export DEBIAN_FRONTEND=noninteractive
-
-mark_nonrequireds_auto
-install_aptmarkeds ${MIN_TAGS}
-apt -y --purge autoremove
-apt -y dist-upgrade
+init_packages "${MIN_TAGS}"
 
 echo '\nSetting hostname and FQDN.'
 echo "${HOSTNAME}" > "${PATH_ETC}/hostname"
 
 echo '\nSetting hostname and FQDN.'
 echo "${HOSTNAME}" > "${PATH_ETC}/hostname"
@@ -42,20 +36,16 @@ echo "$(determine_ip) ${FQDN} ${HOSTNAME}" >> "${PATH_HOSTS}"
 
 echo '\nAdapting /etc to our needs.'
 copy_dirtree "${PATH_CONF_ETC}" "${PATH_ETC}"${MIN_TAGS}
 
 echo '\nAdapting /etc to our needs.'
 copy_dirtree "${PATH_CONF_ETC}" "${PATH_ETC}"${MIN_TAGS}
+
 echo '\nSetting Berlin localtime.'
 ln -sf /usr/share/zoneinfo/Europe/Berlin "${PATH_ETC}/localtime"
 ntpdate-debian
 
 echo '\nSetting Berlin localtime.'
 ln -sf /usr/share/zoneinfo/Europe/Berlin "${PATH_ETC}/localtime"
 ntpdate-debian
 
-# # Enable firewall.
-# systemctl enable nftables.service
-
-echo "\nSetting up root user's home directory."
-copy_dirtree "${PATH_CONF_HOME}" '/root' ${MIN_TAGS} root
+setup_users plom "${MIN_TAGS}"
 
 
-echo "\nSetting up user ${USERNAME}."
-adduser --disabled-password --gecos "" "${USERNAME}"
-usermod -a -G sudo "${USERNAME}"
-copy_dirtree "${PATH_CONF_HOME}" "${PATH_USER_HOME}" ${MIN_TAGS} user
 mkdir -p "${PATH_USER_SSH}"
 mv "${PATH_SSH}/authorized_keys" "${PATH_USER_SSH}/"
 mkdir -p "${PATH_USER_SSH}"
 mv "${PATH_SSH}/authorized_keys" "${PATH_USER_SSH}/"
-chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
+chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_SSH}"
+
+# # Enable firewall.
+# systemctl enable nftables.service
index 968e560a14858305cd3905fb1b493eafcc72aa56..feb32578939cf739720a6e49b881966788d549d8 100755 (executable)
@@ -7,14 +7,13 @@ cd $(dirname "$0")
 . lib/copy_dirtree
 . lib/determine_ip
 . lib/expect_min_n_args
 . lib/copy_dirtree
 . lib/determine_ip
 . lib/expect_min_n_args
-. lib/mark_nonrequireds_auto
-. lib/install_aptmarkeds
+. lib/init_packages
+. libs/setup_users
 
 PARENT_DIR=$(dirname $(pwd))
 DEBIAN_RELEASE=$(basename ${PARENT_DIR})
 PATH_REPO=$(dirname ${PARENT_DIR})
 PATH_CONF="${PATH_REPO}/${DEBIAN_RELEASE}"
 
 PARENT_DIR=$(dirname $(pwd))
 DEBIAN_RELEASE=$(basename ${PARENT_DIR})
 PATH_REPO=$(dirname ${PARENT_DIR})
 PATH_CONF="${PATH_REPO}/${DEBIAN_RELEASE}"
-PATH_CONF_HOME="${PATH_CONF}/home"
 
 PATH_REL_ETC=etc
 PATH_CONF_ETC="${PATH_CONF}/${PATH_REL_ETC}"
 
 PATH_REL_ETC=etc
 PATH_CONF_ETC="${PATH_CONF}/${PATH_REL_ETC}"
@@ -26,8 +25,6 @@ TAG_ALL=all
 TAGS_USER='user desktop'
 THINKPAD_NAMES="x220 w530 t490s"
 
 TAGS_USER='user desktop'
 THINKPAD_NAMES="x220 w530 t490s"
 
-export DEBIAN_FRONTEND=noninteractive
-
 get_system_class_for() {
     for THINKPAD_NAME in $THINKPAD_NAMES; do
         if [ "$1" = "${THINKPAD_NAME}" ]; then
 get_system_class_for() {
     for THINKPAD_NAME in $THINKPAD_NAMES; do
         if [ "$1" = "${THINKPAD_NAME}" ]; then
@@ -85,21 +82,14 @@ abort_if_illegal_system_name "${SYSTEM_NAME}"
 SYSTEM_CLASS_NAME="$(get_system_class_for ${SYSTEM_NAME})"
 MIN_TAGS="${TAG_ALL} ${SYSTEM_CLASS_NAME} ${SYSTEM_NAME}"
 
 SYSTEM_CLASS_NAME="$(get_system_class_for ${SYSTEM_NAME})"
 MIN_TAGS="${TAG_ALL} ${SYSTEM_CLASS_NAME} ${SYSTEM_NAME}"
 
+export DEBIAN_FRONTEND=noninteractive
+
 echo "\nUpgrading to ${DEBIAN_RELEASE}."
 # For this step only very selectively prepare /etc/ files.
 cp "${PATH_CONF_ETC}/${TAG_ALL}/${PATH_REL_APT_CONF}/99_minimize_dependencies" "${PATH_ETC}/${PATH_REL_APT_CONF}/"
 upgrade_from_older_release
 
 echo "\nUpgrading to ${DEBIAN_RELEASE}."
 # For this step only very selectively prepare /etc/ files.
 cp "${PATH_CONF_ETC}/${TAG_ALL}/${PATH_REL_APT_CONF}/99_minimize_dependencies" "${PATH_ETC}/${PATH_REL_APT_CONF}/"
 upgrade_from_older_release
 
-echo "\nInstalling and/or keeping only what's required by us or Debian."
-# Ensure package installation state as defined by what packages are
-# defined as required by Debian policy and by settings in ./aptmark.
-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
-install_aptmarkeds ${MIN_TAGS} ${TAGS_USER}
-apt -y --purge autoremove
+init_packages "${MIN_TAGS}"
 
 # NB: This needs to come before steps potentially overwriting /etc/network/interfaces.
 echo "\nChecking for existing wifi config in ${PATH_NETWORK_INTERFACES}."
 
 # NB: This needs to come before steps potentially overwriting /etc/network/interfaces.
 echo "\nChecking for existing wifi config in ${PATH_NETWORK_INTERFACES}."
@@ -113,18 +103,13 @@ echo "$(determine_ip) ${SYSTEM_NAME}" >> /etc/hosts
 
 echo "\nAdapting /etc to our needs."
 copy_dirtree "${PATH_CONF_ETC}" '/etc' ${MIN_TAGS} ${TAGS_USER}
 
 echo "\nAdapting /etc to our needs."
 copy_dirtree "${PATH_CONF_ETC}" '/etc' ${MIN_TAGS} ${TAGS_USER}
-echo "\nEnsuring our desired locale is available."
-locale-gen
+
+# echo "\nEnsuring our desired locale is available."
+# locale-gen
+
 echo "\nSetting Berlin localtime."
 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
 ntpdate-debian
 
 echo "\nSetting Berlin localtime."
 ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
 ntpdate-debian
 
-echo "\nSetting up root user's home directory."
-copy_dirtree "${PATH_CONF_HOME}" '/root' ${MIN_TAGS} root
-
-echo "\nSetting up user ${USERNAME}."
-adduser --disabled-password --gecos "" "${USERNAME}"
-usermod -a -G sudo "${USERNAME}"
-copy_dirtree "${PATH_CONF_HOME}" "${PATH_USER_HOME}" ${MIN_TAGS} ${TAGS_USER}
-chown -R "${USERNAME}:${USERNAME}" "${PATH_USER_HOME}"
+setup_users plom "${MIN_TAGS}"
 passwd "${USERNAME}"
 passwd "${USERNAME}"