From 476ce0976a06aad7064048736f41d540c6da3a31 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Mon, 22 Aug 2022 11:11:14 +0200 Subject: [PATCH] Set random hostname when installing --- mods/live-installer/data/bin/login | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mods/live-installer/data/bin/login b/mods/live-installer/data/bin/login index 74e5f6d..ec543fe 100755 --- a/mods/live-installer/data/bin/login +++ b/mods/live-installer/data/bin/login @@ -77,6 +77,10 @@ while true; do echo "Adding files ..." unsquashfs -f -d "/media/install" "/lib/live/mount/medium/live/filesystem.squashfs" + # Set hostname + echo "Setting hostname ..." + echo "$(head -c4 "/media/install/etc/hostname" + # Write fstab echo "Writing fstab ..." echo "UUID=$(blkid -o value -s UUID "$PART_DATA") / ext4 errors=remount-ro 0 1" >>"/media/install/etc/fstab" @@ -85,6 +89,7 @@ while true; do # Remove live-specific packages echo "Removing live-specific packages ..." wdvn-chroot "/media/install" apt -y remove live-boot live-boot-initramfs-tools + wdvn-chroot "/media/install" update-initramfs -u rm "/media/install/bin/login" mv "/media/install/bin/login.oobe" "/media/install/bin/login" @@ -93,7 +98,6 @@ while true; do wdvn-chroot "/media/install" grub-install --target=i386-efi --uefi-secure-boot --efi-directory="/efi" --boot-directory="/boot" "$DEVICE" wdvn-chroot "/media/install" grub-install --target=x86_64-efi --uefi-secure-boot --efi-directory="/efi" --boot-directory="/boot" "$DEVICE" wdvn-chroot "/media/install" grub-install --target=i386-pc --boot-directory="/boot" "$DEVICE" - wdvn-chroot "/media/install" update-grub # Unmount