diff --git a/debian-build-netboot.sh b/debian-build-netboot.sh index 2241b4a..60885ff 100755 --- a/debian-build-netboot.sh +++ b/debian-build-netboot.sh @@ -27,14 +27,17 @@ echo "deb http://deb.debian.org/debian/ $release main contrib non-free" > "$chro chroot "$chroot_dir" apt-get update chroot "$chroot_dir" apt-get install -y firmware-bnx2 -# SSH server, DNS updates from RAs. -chroot "$chroot_dir" apt-get install -y openssh-server rdnssd +# SSH server, DNS updates from RAs, LVM2. +chroot "$chroot_dir" apt-get install -y openssh-server rdnssd lvm2 + +# Useful things for cdist manifests to run properly. +chroot "$chroot_dir" apt-get install -y lsb-release ca-certificates # 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. +# Deploy SSH keys, set default password. mkdir -p "$chroot_dir/root/.ssh" for user in tfloure; do curl "https://meta.recycled.cloud/~$user.keys" >> "$chroot_dir/root/.ssh/authorized_keys" @@ -48,5 +51,16 @@ ln -fs /sbin/init "$chroot_dir/init" # Display IP addresses on login screen. echo '* * * * * root ip -6 -o addr show | grep -E -v " lo " > /etc/issue' > "$chroot_dir/etc/cron.d/ipv6addr" +# Configure networking. +cat << EOF > "$chroot_dir/etc/network/interfaces" +auto lo +iface lo inet loopback + +auto eth0 +allow-hotplug eth0 +iface eth0 inet dhcp +iface eth0 inet6 auto +EOF + # Build initramfs from generated installation. (cd "$chroot_dir"; find . | cpio -H newc -o | gzip -9 > "../initramfs-$basename")