Add networking + missing packages to netboot image
This commit is contained in:
parent
b1321a3823
commit
518809bbf6
1 changed files with 17 additions and 3 deletions
|
@ -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 update
|
||||||
chroot "$chroot_dir" apt-get install -y firmware-bnx2
|
chroot "$chroot_dir" apt-get install -y firmware-bnx2
|
||||||
|
|
||||||
# SSH server, DNS updates from RAs.
|
# SSH server, DNS updates from RAs, LVM2.
|
||||||
chroot "$chroot_dir" apt-get install -y openssh-server rdnssd
|
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.
|
# Install and extract kernel.
|
||||||
chroot "$chroot_dir" apt-get install -y linux-image-amd64
|
chroot "$chroot_dir" apt-get install -y linux-image-amd64
|
||||||
cp "$chroot_dir"/boot/vmlinuz-* "$output_dir/kernel-$basename"
|
cp "$chroot_dir"/boot/vmlinuz-* "$output_dir/kernel-$basename"
|
||||||
|
|
||||||
# Deploy SSH keys.
|
# Deploy SSH keys, set default password.
|
||||||
mkdir -p "$chroot_dir/root/.ssh"
|
mkdir -p "$chroot_dir/root/.ssh"
|
||||||
for user in tfloure; do
|
for user in tfloure; do
|
||||||
curl "https://meta.recycled.cloud/~$user.keys" >> "$chroot_dir/root/.ssh/authorized_keys"
|
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.
|
# 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"
|
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.
|
# Build initramfs from generated installation.
|
||||||
(cd "$chroot_dir"; find . | cpio -H newc -o | gzip -9 > "../initramfs-$basename")
|
(cd "$chroot_dir"; find . | cpio -H newc -o | gzip -9 > "../initramfs-$basename")
|
||||||
|
|
Loading…
Reference in a new issue