From: Plom Heller Date: Tue, 8 Sep 2026 20:33:59 +0000 (+0200) Subject: Use boot label as hostname. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/pick_tasks?a=commitdiff_plain;ds=sidebyside;p=confplom Use boot label as hostname. --- diff --git a/setup_scripts/install_debian.sh b/setup_scripts/install_debian.sh index fa4d353..4561424 100755 --- a/setup_scripts/install_debian.sh +++ b/setup_scripts/install_debian.sh @@ -8,6 +8,8 @@ FNAME_VMLINUZ=vmlinuz PATH_CRYPTTAB=/etc/crypttab PATH_EFI=/boot/efi PATH_FSTAB=/etc/fstab +PATH_HOSTNAME=/etc/hostname +PATH_HOSTS=/etc/hosts PATH_INTERFACES=/etc/network/interfaces PATH_NM_CONNECTIONS=/etc/NetworkManager/system-connections @@ -27,6 +29,8 @@ PATH_EFI_NAME_BOOT="${PATH_EFI}/${NAME_BOOT}" PATH_MNT_APT_SOURCES="${PATH_MNT_ROOT}/etc/apt/sources.list" PATH_MNT_CRYPTTAB="${PATH_MNT_ROOT}${PATH_CRYPTTAB}" PATH_MNT_FSTAB="${PATH_MNT_ROOT}${PATH_FSTAB}" +PATH_MNT_HOSTNAME="${PATH_MNT_ROOT}${PATH_HOSTNAME}" +PATH_MNT_HOSTS="${PATH_MNT_ROOT}${PATH_HOSTS}" PATH_MNT_NM_CONN="${PATH_MNT_ROOT}${PATH_NM_CONNECTIONS}/${FNAME_NM_CONN}" PATH_MNT_NM_CONNECTIONS="${PATH_MNT_ROOT}${PATH_NM_CONNECTIONS}" PATH_VG=$(path_vg "${NAME_LUKSVG}") @@ -78,6 +82,10 @@ printf '%s UUID=%s none luks\n' \ "${NAME_LUKSVG}" "$(cryptsetup luksUUID "${PARTITION}")" \ >| "${PATH_MNT_CRYPTTAB}" +msg 'Setting up hostname …' +printf '%s\n' "${NAME_BOOT}" >| "${PATH_MNT_HOSTNAME}" +printf '127.0.1.1\t%s\n' "${NAME_BOOT}" >> "${PATH_MNT_HOSTS}" + # for firmware-iwlwifi below (as debootstrap only enables "main" by default) msg 'Enabling non-free-firmware component in target sources.list …' sed -i 's/ main$/ main non-free-firmware/' "${PATH_MNT_APT_SOURCES}"