Set random hostname when installing

This commit is contained in:
Fierelier 2022-08-22 11:11:14 +02:00
parent 6bea24455b
commit 476ce0976a

View File

@ -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 </dev/urandom|xxd -p -u)" >"/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