Add ONE VM networking to netboot image

This commit is contained in:
Timothée Floure 2020-10-11 14:47:32 +02:00
parent 81df531312
commit ad3acd5ebe
1 changed files with 15 additions and 2 deletions

View File

@ -30,14 +30,17 @@ chroot "$chroot_dir" apt-get install -y firmware-bnx2
# SSH server, DNS updates from RAs, LVM2.
chroot "$chroot_dir" apt-get install -y openssh-server rdnssd lvm2
# Network tools.
chroot "$chroot_dir" apt-get install -y vlan bridge-utils
# Useful things for cdist manifests to run properly and humans to be happy.
chroot "$chroot_dir" apt-get install -y lsb-release ca-certificates vim locales bridge-utils
chroot "$chroot_dir" apt-get install -y lsb-release ca-certificates vim locales
# Install and extract kernel.
chroot "$chroot_dir" apt-get install -y linux-image-amd64
cp "$chroot_dir"/boot/vmlinuz-* "$output_dir/kernel-$basename"
# Deploy SSH keys, set default password.
# Deploy SSH keys.
mkdir -p "$chroot_dir/root/.ssh"
for user in tfloure; do
curl "https://meta.recycled.cloud/~$user.keys" >> "$chroot_dir/root/.ssh/authorized_keys"
@ -60,6 +63,16 @@ auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 auto
# OpenNebula VM vlan
auto eth0.10
iface eth0.10 inet6 auto
vlan-raw-device eth0
# OpenNebula VM bridge
auto br-vms
iface br-vms inet6 auto
bridge_ports eth0.10
EOF
# Build initramfs from generated installation.