Ubuntu image: add haveged, nosplash boot, uncloud-init
This commit is contained in:
parent
5bac25f2a8
commit
7eacf4c8f5
1 changed files with 17 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue