From 7eacf4c8f545ac50b61b95e477dab6be77913cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Sat, 25 Jan 2020 18:20:38 +0100 Subject: [PATCH] Ubuntu image: add haveged, nosplash boot, uncloud-init --- ubuntu-unclound-image.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/ubuntu-unclound-image.sh b/ubuntu-unclound-image.sh index 54e933f..c9ffeb7 100755 --- a/ubuntu-unclound-image.sh +++ b/ubuntu-unclound-image.sh @@ -120,11 +120,15 @@ run_root DEBIAN_FRONTEND=noninteractive apt-get -y install locales linux-base li # Configure grub. run_root grub-install --target=i386-pc "${NBD_DEVICE}" +sed -i 's/quiet splash/nosplash/' /mnt/etc/default/grub run_root grub-mkconfig -o /boot/grub/grub.cfg # Install en configure SSH daemon. The service is enabled by default. run_root apt-get -y install openssh-server +# Use haveged as entropy source. +run_root apt-get -y install haveged + # Generate fstab file. boot_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p1") root_uuid=$(blkid --match-tag UUID --output value "${NBD_DEVICE}p2") @@ -141,9 +145,19 @@ rm -f /var/lib/systemd/random-seed # Remove temporary files and reclaim freed disk space. run_root apt-get clean -# FIXME: add fnux's SSH key for testing purposes. -mkdir -p /mnt/root/.ssh -curl https://key.wf/fnux > /mnt/root/.ssh/authorized_keys +# Manually install uncloud-init. +uncloud_init_dir=/tmp/uncloud-init +run_root apt-get install -y git curl grep make + +mkdir -p "$uncloud_init_dir" +run_root git clone https://code.ungleich.ch/uncloud/uncloud-init.git "$uncloud_init_dir" +run_root make -C "$uncloud_init_dir" install +run_root rm -r "$uncloud_init_dir" + +run_root systemctl enable uncloud-init + +# Remove resolv.conf, as it is handled by uncloud-init. +run_root rm /etc/resolv.conf # Make sure everything is written to disk before exiting. sync