home · contact · privacy
Fix.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 19 Aug 2025 18:03:06 +0000 (20:03 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 19 Aug 2025 18:03:06 +0000 (20:03 +0200)
trixie/scripts/lib/core_setup.sh [changed from symlink to file mode: 0644]

deleted file mode 120000 (symlink)
index da497f294cbbf17c2701c720c7d8aac0b0f8609b..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../bookworm/scripts/lib/core_setup.sh
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..892a80c6386e114179c79d552c28b36a83754843
--- /dev/null
@@ -0,0 +1,46 @@
+. lib/apt_digested.sh
+. lib/constants_etc.sh  # PATH_ETC
+. lib/constants_user.sh  # USERNAME
+. lib/copy_dirtrees_of_tags.sh
+. lib/prefixed_msg.sh
+
+core_setup() {
+prefixed_msg_init 'core_setup'
+prefixed_msg 'starting (performing standard installation setup steps)'
+
+_HOSTNAME="$1"
+_FQDN="$2"
+_EXTERNAL_IP="$3"
+_INSTALL_TAGS="$4"
+
+./minimize_installation.sh ${_INSTALL_TAGS}
+
+prefixed_msg 'And now: dist-upgrade …'
+apt_digested '-q -q dist-upgrade'
+
+prefixed_msg "Setting up user: ${USERNAME}"
+adduser --quiet --disabled-password --gecos "" "${USERNAME}"
+usermod -a -G sudo "${USERNAME}"
+
+prefixed_msg 'Copying over files, directories …'
+copy_dirtrees_of_tags ${_INSTALL_TAGS}
+
+prefixed_msg 'Setting hostname …'
+hostnamectl hostname "${_HOSTNAME}"
+
+prefixed_msg "Adapting ${_PATH_HOSTS} …"
+_PATH_HOSTS="${PATH_ETC}/hosts"
+if [ -z "${_FQDN}" ]; then
+    sed -i 's/REPLACE_WITH_FQDN/REPLACE_WITH_HOSTNAME.local REPLACE_WITH_HOSTNAME.localdomain/g' "${_PATH_HOSTS}"
+else
+    sed -i 's/REPLACE_WITH_FQDN/'"${_FQDN}"'/g' "${_PATH_HOSTS}"
+    sed -i "s/#REPLACE_WITH_EXTERNAL_IP/${_EXTERNAL_IP}/g" "${_PATH_HOSTS}"
+fi
+sed -i 's/REPLACE_WITH_HOSTNAME/'"${_HOSTNAME}"'/g' "${_PATH_HOSTS}"
+
+prefixed_msg 'Syncing clock …'
+ntpdate-debian -s
+
+prefixed_msg 'finished'
+prefixed_msg_exit
+}