home · contact · privacy
Fixes. master
authorChristian Heller <c.heller@plomlompom.de>
Fri, 4 Apr 2025 17:48:25 +0000 (19:48 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Fri, 4 Apr 2025 17:48:25 +0000 (19:48 +0200)
22 files changed:
bookworm/preseed.cfg
bookworm/scripts/lib/INSTALLER_VERSION [new file with mode: 0644]
bookworm/scripts/lib/abort_if_command_unknown [deleted file]
bookworm/scripts/lib/abort_if_not_user [deleted file]
bookworm/scripts/lib/abort_if_offline [deleted file]
bookworm/scripts/lib/constants_installer [deleted file]
bookworm/scripts/lib/constants_ssh [deleted file]
bookworm/scripts/lib/expect_n_args [deleted file]
bookworm/scripts/lib/get_mountable_device_path [deleted file]
bookworm/scripts/make_writable_installer.sh [deleted file]
bookworm/scripts/update_preseed.sh [deleted file]
testing/home/desktop/.plomlib.sh/expect_n_args [new symlink]
testing/preseed.cfg [new symlink]
testing/scripts/lib/abort_if_command_unknown [new file with mode: 0644]
testing/scripts/lib/abort_if_not_user [changed from symlink to file mode: 0644]
testing/scripts/lib/abort_if_offline [changed from symlink to file mode: 0644]
testing/scripts/lib/constants_installer [new file with mode: 0644]
testing/scripts/lib/constants_ssh [changed from symlink to file mode: 0644]
testing/scripts/lib/expect_n_args [changed from symlink to file mode: 0644]
testing/scripts/lib/get_mountable_device_path [new file with mode: 0644]
testing/scripts/make_writable_installer.sh [new file with mode: 0755]
testing/scripts/update_preseed.sh [new file with mode: 0755]

index d095933388855a7cd6adea272400b20e79fb3785..8e3d89b0f7c756155a88847cd1240fce549bac84 100644 (file)
@@ -4,15 +4,22 @@ d-i anna/choose_modules multiselect
 
 d-i netcfg/link_wait_timeout string 3
 d-i netcfg/choose_interface select auto
-d-i netcfg/wireless_show_essids select kadatheron
 #d-i netcfg/wireless_essid string kadatheron
+#d-i netcfg/wireless_essid seen true
+d-i netcfg/wireless_show_essids select kadatheron
 #d-i netcfg/wireless_show_essids seen true
+#d-i netcfg/confirm_essid boolean true
+#d-i netcfg/confirm_essid seen true
 d-i netcfg/wireless_security_type select wpa
+d-i netcfg/wireless_wpa string REPLACE_WITH_WIFI_PASSWORD
+d-i netcfg/wireless_wpa seen true
 d-i netcfg/use_autoconfig boolean true
 d-i netcfg/get_hostname string unassigned-hostname
 d-i netcfg/get_domain string unassigned-domain
 
 d-i passwd/root-login boolean true
+d-i passwd/root-password password REPLACE_WITH_ROOT_PASSWORD
+d-i passwd/root-password-again password REPLACE_WITH_ROOT_PASSWORD
 user-setup-udeb        passwd/make-user boolean false
 
 #d-i partman-auto/method string crypto
@@ -30,9 +37,10 @@ d-i base-installer/initramfs-tools/driver-policy most
 
 d-i apt-setup/use_mirror boolean true
 d-i mirror/protocol string http
-d-i mirror/http/proxy string 
-d-i mirror/http/countries select US
-d-i mirror/http/mirror select deb.debian.org
+d-i mirror/http/proxy string
+#d-i mirror/http/countries select US
+#d-i mirror/http/countries seen true
+#d-i mirror/http/mirror select deb.debian.org
 #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
diff --git a/bookworm/scripts/lib/INSTALLER_VERSION b/bookworm/scripts/lib/INSTALLER_VERSION
new file mode 100644 (file)
index 0000000..bd9fd08
--- /dev/null
@@ -0,0 +1 @@
+INSTALLER_VERSION=12.10.0
diff --git a/bookworm/scripts/lib/abort_if_command_unknown b/bookworm/scripts/lib/abort_if_command_unknown
deleted file mode 100644 (file)
index 81a3365..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-. lib/abort
-
-abort_if_command_unknown() {
-    if ! which "$1" > /dev/null; then
-        abort "Expected command unavailable: ${1}."
-    fi
-}
diff --git a/bookworm/scripts/lib/abort_if_not_user b/bookworm/scripts/lib/abort_if_not_user
deleted file mode 100644 (file)
index a7b3da3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-. lib/abort
-
-abort_if_not_user() {
-    if [ "$(whoami)" != "$1" ]; then
-        abort "Must be run as ${1}."
-    fi
-}
diff --git a/bookworm/scripts/lib/abort_if_offline b/bookworm/scripts/lib/abort_if_offline
deleted file mode 100644 (file)
index b81c784..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-. lib/abort
-
-abort_if_offline() {
-    if ! ping -c1 -W2 1.1.1.1 > /dev/null 2>&1; then
-        abort 'Must be run online.'
-    fi
-}
diff --git a/bookworm/scripts/lib/constants_installer b/bookworm/scripts/lib/constants_installer
deleted file mode 100644 (file)
index 92e60df..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-FILENAME_PRESEED_CFG=preseed.cfg
-PATH_PRESEED_CFG="../${FILENAME_PRESEED_CFG}"
diff --git a/bookworm/scripts/lib/constants_ssh b/bookworm/scripts/lib/constants_ssh
deleted file mode 100644 (file)
index 43e6ee5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-. lib/constants_user
-PATH_REL_SSH=.ssh
-PATH_USER_SSH="${PATH_USER_HOME}/${PATH_REL_SSH}"
diff --git a/bookworm/scripts/lib/expect_n_args b/bookworm/scripts/lib/expect_n_args
deleted file mode 100644 (file)
index 950671a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-. lib/abort
-
-expect_n_args() {
-    _N_MIN_ARGS="$1"
-    _N_MAX_ARGS="$2"
-    _USAGE="$3"
-    shift 3
-    _ABORT_MSG=
-    if [ "$#" -lt "${_N_MIN_ARGS}" ]; then
-        _ABORT_MSG="missing arguments (got $# instead of ${_N_MAX_ARGS})."
-    elif [ "$#" -gt "${_N_MAX_ARGS}" ]; then
-        shift "${_N_MAX_ARGS}"
-        _ABORT_MSG="unexpected arguments beyond expected number (${_N_MAX_ARGS}): $@"
-    fi
-    if [ ! -z "${_ABORT_MSG}" ]; then 
-        if [ ! -z "${_USAGE}" ]; then 
-            _ABORT_MSG="${_ABORT_MSG}\nExpected arguments: ${_USAGE}"
-        fi 
-        abort "Aborting due to ${_ABORT_MSG}"
-    fi
-}
diff --git a/bookworm/scripts/lib/get_mountable_device_path b/bookworm/scripts/lib/get_mountable_device_path
deleted file mode 100644 (file)
index b0a1cd5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-. lib/abort
-
-get_mountable_device_path() {
-    _PATH_DEV="/dev/$1"
-    if [ ! -b "${_PATH_DEV}" ]; then
-        abort "No block device at ${_PATH_DEV}."
-    elif [ $(mount | grep -E "^${_PATH_DEV}" | wc -l) -gt 0 ]; then
-        abort "${_PATH_DEV} already mounted."
-    fi
-    printf "${_PATH_DEV}"
-}
diff --git a/bookworm/scripts/make_writable_installer.sh b/bookworm/scripts/make_writable_installer.sh
deleted file mode 100755 (executable)
index 1cf871d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-# based on <https://wiki.debian.org/DebianInstaller/WritableUSBStick>
-set -e
-cd $(dirname "$0")
-. lib/abort
-. lib/abort_if_command_unknown
-. lib/abort_if_not_user
-. lib/abort_if_offline
-. lib/constants_installer
-. lib/expect_n_args
-. lib/get_mountable_device_path
-
-INSTALLER_VERSION=12.10.0
-PATH_MNT_ISO=/mnt/iso
-
-expect_n_args 1 1 'DEVICE (e.g. "sdb")' $@
-abort_if_not_user root
-abort_if_offline
-abort_if_command_unknown mkfs.vfat 
-abort_if_command_unknown parted 
-abort_if_command_unknown rsync
-abort_if_command_unknown wget 
-
-PATH_STICK="$(get_mountable_device_path $1)"
-
-FILENAME_ISO="debian-${INSTALLER_VERSION}-amd64-netinst.iso"
-echo "Retrieving ${FILENAME_ISO}."
-URL_ISO="https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/${FILENAME_ISO}"
-PATH_ISO="/tmp/${FILENAME_ISO}"
-wget --output-document "${PATH_ISO}" "${URL_ISO}"
-
-echo "Preparing partition/filesystem on ${PATH_STICK}."
-parted --script "${PATH_STICK}" mklabel msdos
-parted --script "${PATH_STICK}" mkpart primary fat32 0% 100%
-PATH_PARTITION="${PATH_STICK}1"
-mkfs.vfat "${PATH_PARTITION}" 
-
-echo "Mounting ${PATH_MNT_ISO} and ${PATH_MNT_STICK}."
-mkdir -p "${PATH_MNT_ISO}" "${PATH_MNT_STICK}"
-mount "${PATH_PARTITION}" "${PATH_MNT_STICK}"
-mount -o loop "${PATH_ISO}" "${PATH_MNT_ISO}"
-do_umounts() {
-    set +e
-    echo "Unmounting ${PATH_MNT_ISO}"
-    umount "${PATH_MNT_ISO}"
-    echo "Unmounting ${PATH_MNT_STICK}"
-    umount "${PATH_MNT_STICK}"
-    set -e
-}
-trap do_umounts EXIT INT TERM
-
-echo "Copying contents of ${PATH_MNT_ISO} to ${PATH_MNT_STICK}/."
-PATH_RSYNC_ERRORS=/tmp/rsync_errors
-set +e
-rsync -a "${PATH_MNT_ISO}/" "${PATH_MNT_STICK}/" 2> "${PATH_RSYNC_ERRORS}"
-RESULT=$?
-set -e
-if [ "${RESULT}" != "0" ]; then
-    echo 'rsync errors:'
-    cat "${PATH_RSYNC_ERRORS}"
-    echo 'rsync encountered errors, see above – continue? (Y/N)'
-    rm "${PATH_RSYNC_ERRORS}"
-    read ANSWER
-    FIRST_CHAR=$(echo "${ANSWER}" | cut -c1)
-    if ! [ "${FIRST_CHAR}" = 'y' -o "${FIRST_CHAR}" = 'Y' ]; then
-        abort 'as requested'
-    fi
-fi
-
-echo "Installing preseed file."
-cp "${PATH_PRESEED_CFG}" "${PATH_MNT_STICK}/"
-sed --in-place 's/ --- / --- preseed\/file=\/cdrom\/'"${FILENAME_PRESEED_CFG}"' /g' "${PATH_MNT_STICK}/boot/grub/grub.cfg"
-
-rm "${PATH_ISO}"
-echo "Done!"
diff --git a/bookworm/scripts/update_preseed.sh b/bookworm/scripts/update_preseed.sh
deleted file mode 100755 (executable)
index ffd0938..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-set -e
-cd $(dirname "$0")
-. lib/abort_if_command_unknown
-. lib/constants_installer
-. lib/expect_n_args
-. lib/get_mountable_device_path
-
-expect_n_args 1 1 'DEVICE (e.g. "sdb")' $@
-abort_if_command_unknown pmount
-
-DEVICE_NAME="$1"
-PATH_DEVICE="$(get_mountable_device_path ${DEVICE_NAME})"
-PATH_MOUNTED="/media/$1"
-echo "Mounting ${PATH_DEVICE} …"
-pmount "${DEVICE_NAME}"
-trap "echo 'Unmounting '${PATH_DEVICE}; pumount ${DEVICE_NAME}" EXIT INT TERM
-echo "Copying ${PATH_PRESEED_CFG} …"
-cp "${PATH_PRESEED_CFG}" "${PATH_MOUNTED}/"
diff --git a/testing/home/desktop/.plomlib.sh/expect_n_args b/testing/home/desktop/.plomlib.sh/expect_n_args
new file mode 120000 (symlink)
index 0000000..a0925a1
--- /dev/null
@@ -0,0 +1 @@
+../../../scripts/lib/expect_n_args
\ No newline at end of file
diff --git a/testing/preseed.cfg b/testing/preseed.cfg
new file mode 120000 (symlink)
index 0000000..71c2003
--- /dev/null
@@ -0,0 +1 @@
+../bookworm/preseed.cfg
\ No newline at end of file
diff --git a/testing/scripts/lib/abort_if_command_unknown b/testing/scripts/lib/abort_if_command_unknown
new file mode 100644 (file)
index 0000000..81a3365
--- /dev/null
@@ -0,0 +1,7 @@
+. lib/abort
+
+abort_if_command_unknown() {
+    if ! which "$1" > /dev/null; then
+        abort "Expected command unavailable: ${1}."
+    fi
+}
deleted file mode 120000 (symlink)
index b152dcad0f4d0ed438a6c14b537a1102adb5ef18..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../bookworm/scripts/lib/abort_if_not_user
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..a7b3da39d8b27e31d23be9f0e2099a418e2fdea4
--- /dev/null
@@ -0,0 +1,7 @@
+. lib/abort
+
+abort_if_not_user() {
+    if [ "$(whoami)" != "$1" ]; then
+        abort "Must be run as ${1}."
+    fi
+}
deleted file mode 120000 (symlink)
index c2f519fda60ef596261cf258310faf53d8789eb3..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../bookworm/scripts/lib/abort_if_offline
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..b81c7847858df2497591a500d311fe7b3f532816
--- /dev/null
@@ -0,0 +1,7 @@
+. lib/abort
+
+abort_if_offline() {
+    if ! ping -c1 -W2 1.1.1.1 > /dev/null 2>&1; then
+        abort 'Must be run online.'
+    fi
+}
diff --git a/testing/scripts/lib/constants_installer b/testing/scripts/lib/constants_installer
new file mode 100644 (file)
index 0000000..92e60df
--- /dev/null
@@ -0,0 +1,2 @@
+FILENAME_PRESEED_CFG=preseed.cfg
+PATH_PRESEED_CFG="../${FILENAME_PRESEED_CFG}"
deleted file mode 120000 (symlink)
index b7110253b3f0a4fdc998bab6b9bac7d6a933aa38..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../bookworm/scripts/lib/constants_ssh
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..43e6ee547b8b1990861e36cc410acd02ab10c489
--- /dev/null
@@ -0,0 +1,3 @@
+. lib/constants_user
+PATH_REL_SSH=.ssh
+PATH_USER_SSH="${PATH_USER_HOME}/${PATH_REL_SSH}"
deleted file mode 120000 (symlink)
index 5c37e825f5596e11b427057afebbbb2c759de212..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../bookworm/scripts/lib/expect_n_args
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..950671ad59cbb1e0badf304e206844066c59e569
--- /dev/null
@@ -0,0 +1,21 @@
+. lib/abort
+
+expect_n_args() {
+    _N_MIN_ARGS="$1"
+    _N_MAX_ARGS="$2"
+    _USAGE="$3"
+    shift 3
+    _ABORT_MSG=
+    if [ "$#" -lt "${_N_MIN_ARGS}" ]; then
+        _ABORT_MSG="missing arguments (got $# instead of ${_N_MAX_ARGS})."
+    elif [ "$#" -gt "${_N_MAX_ARGS}" ]; then
+        shift "${_N_MAX_ARGS}"
+        _ABORT_MSG="unexpected arguments beyond expected number (${_N_MAX_ARGS}): $@"
+    fi
+    if [ ! -z "${_ABORT_MSG}" ]; then 
+        if [ ! -z "${_USAGE}" ]; then 
+            _ABORT_MSG="${_ABORT_MSG}\nExpected arguments: ${_USAGE}"
+        fi 
+        abort "Aborting due to ${_ABORT_MSG}"
+    fi
+}
diff --git a/testing/scripts/lib/get_mountable_device_path b/testing/scripts/lib/get_mountable_device_path
new file mode 100644 (file)
index 0000000..b0a1cd5
--- /dev/null
@@ -0,0 +1,11 @@
+. lib/abort
+
+get_mountable_device_path() {
+    _PATH_DEV="/dev/$1"
+    if [ ! -b "${_PATH_DEV}" ]; then
+        abort "No block device at ${_PATH_DEV}."
+    elif [ $(mount | grep -E "^${_PATH_DEV}" | wc -l) -gt 0 ]; then
+        abort "${_PATH_DEV} already mounted."
+    fi
+    printf "${_PATH_DEV}"
+}
diff --git a/testing/scripts/make_writable_installer.sh b/testing/scripts/make_writable_installer.sh
new file mode 100755 (executable)
index 0000000..b5327e7
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh
+# based on <https://wiki.debian.org/DebianInstaller/WritableUSBStick>
+set -e
+cd $(dirname "$0")
+. lib/INSTALLER_VERSION
+. lib/abort
+. lib/abort_if_command_unknown
+. lib/abort_if_not_user
+. lib/abort_if_offline
+. lib/constants_installer
+. lib/expect_n_args
+. lib/get_mountable_device_path
+
+expect_n_args 1 1 'DEVICE (e.g. "sdb")' $@
+abort_if_not_user root
+abort_if_offline
+abort_if_command_unknown mkfs.vfat 
+abort_if_command_unknown parted 
+abort_if_command_unknown rsync
+abort_if_command_unknown wget 
+PATH_STICK="$(get_mountable_device_path $1)"
+
+PATH_MNT_ISO=/mnt/iso
+FILENAME_ISO="debian-${INSTALLER_VERSION}-amd64-netinst.iso"
+echo "Retrieving ${FILENAME_ISO}."
+URL_ISO="https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/${FILENAME_ISO}"
+PATH_ISO="/tmp/${FILENAME_ISO}"
+wget --output-document "${PATH_ISO}" "${URL_ISO}"
+
+echo "Preparing partition/filesystem on ${PATH_STICK}."
+parted --script "${PATH_STICK}" mklabel msdos
+parted --script "${PATH_STICK}" mkpart primary fat32 0% 100%
+PATH_PARTITION="${PATH_STICK}1"
+mkfs.vfat "${PATH_PARTITION}" 
+
+echo "Mounting ${PATH_MNT_ISO} and ${PATH_MNT_STICK}."
+mkdir -p "${PATH_MNT_ISO}" "${PATH_MNT_STICK}"
+mount "${PATH_PARTITION}" "${PATH_MNT_STICK}"
+mount -o loop "${PATH_ISO}" "${PATH_MNT_ISO}"
+do_umounts() {
+    set +e
+    echo "Unmounting ${PATH_MNT_ISO}"
+    umount "${PATH_MNT_ISO}"
+    echo "Unmounting ${PATH_MNT_STICK}"
+    umount "${PATH_MNT_STICK}"
+    set -e
+}
+trap do_umounts EXIT INT TERM
+
+echo "Copying contents of ${PATH_MNT_ISO} to ${PATH_MNT_STICK}/."
+PATH_RSYNC_ERRORS=/tmp/rsync_errors
+set +e
+rsync -a "${PATH_MNT_ISO}/" "${PATH_MNT_STICK}/" 2> "${PATH_RSYNC_ERRORS}"
+RESULT=$?
+set -e
+if [ "${RESULT}" != "0" ]; then
+    echo 'rsync errors:'
+    cat "${PATH_RSYNC_ERRORS}"
+    echo 'rsync encountered errors, see above – continue? (Y/N)'
+    rm "${PATH_RSYNC_ERRORS}"
+    read ANSWER
+    FIRST_CHAR=$(echo "${ANSWER}" | cut -c1)
+    if ! [ "${FIRST_CHAR}" = 'y' -o "${FIRST_CHAR}" = 'Y' ]; then
+        abort 'as requested'
+    fi
+fi
+
+echo "Installing preseed file."
+cp "${PATH_PRESEED_CFG}" "${PATH_MNT_STICK}/"
+sed --in-place 's/ --- / --- preseed\/file=\/cdrom\/'"${FILENAME_PRESEED_CFG}"' /g' "${PATH_MNT_STICK}/boot/grub/grub.cfg"
+
+rm "${PATH_ISO}"
+echo "Done!"
diff --git a/testing/scripts/update_preseed.sh b/testing/scripts/update_preseed.sh
new file mode 100755 (executable)
index 0000000..ffd0938
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+cd $(dirname "$0")
+. lib/abort_if_command_unknown
+. lib/constants_installer
+. lib/expect_n_args
+. lib/get_mountable_device_path
+
+expect_n_args 1 1 'DEVICE (e.g. "sdb")' $@
+abort_if_command_unknown pmount
+
+DEVICE_NAME="$1"
+PATH_DEVICE="$(get_mountable_device_path ${DEVICE_NAME})"
+PATH_MOUNTED="/media/$1"
+echo "Mounting ${PATH_DEVICE} …"
+pmount "${DEVICE_NAME}"
+trap "echo 'Unmounting '${PATH_DEVICE}; pumount ${DEVICE_NAME}" EXIT INT TERM
+echo "Copying ${PATH_PRESEED_CFG} …"
+cp "${PATH_PRESEED_CFG}" "${PATH_MOUNTED}/"