read boot interface at boot
This commit is contained in:
parent
3824bb6d94
commit
279f86a1f0
1 changed files with 30 additions and 7 deletions
|
@ -23,15 +23,11 @@ keyurl=https://code.ungleich.ch/ungleich-public/__ungleich_staff_ssh_access/raw/
|
||||||
|
|
||||||
debootstrap "${suite}" "${dir}"
|
debootstrap "${suite}" "${dir}"
|
||||||
|
|
||||||
chroot ${dir} apt install -y openssh-server rdnssd linux-image-amd64
|
# need non-free for firmware-bnx2
|
||||||
|
echo 'deb http://pkgmaster.devuan.org/merged ${suite} main contrib non-free' > ${dir}/etc/apt/sources.list
|
||||||
|
|
||||||
cat > ${dir}/etc/network/interfaces << EOF
|
chroot ${dir} apt install -y openssh-server rdnssd linux-image-amd64 firmware-bnx2
|
||||||
auto lo
|
|
||||||
iface lo inet loopback
|
|
||||||
|
|
||||||
auto eth0
|
|
||||||
iface eth0 inet6 auto
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cp ${dir}/boot/vmlinuz-* ${kernel}
|
cp ${dir}/boot/vmlinuz-* ${kernel}
|
||||||
|
|
||||||
|
@ -43,6 +39,33 @@ for key in balazs dominique jinguk nico; do
|
||||||
curl -s ${keyurl}/${key}.pub >> ${dir}/root/.ssh/authorized_keys
|
curl -s ${keyurl}/${key}.pub >> ${dir}/root/.ssh/authorized_keys
|
||||||
done
|
done
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# networking
|
||||||
|
|
||||||
|
# always lo
|
||||||
|
cat > ${dir}/etc/network/interfaces << EOF
|
||||||
|
auto lo
|
||||||
|
iface lo inet loopback
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# find the boot interfaces at boot
|
||||||
|
cat > ${dir}/etc/rc.local <<EOF
|
||||||
|
mac=\$(cat /proc/cmdline | tr ' ' '\n' | awk -F= '/bootdev/ { print \$2 }')
|
||||||
|
dev=\$(ip -o link | awk -F: "/\$mac/ { print \\\$2 }" | sed 's/ *//g')
|
||||||
|
|
||||||
|
cat > /etc/network/interfaces.d/bootinterface << eof
|
||||||
|
auto \$dev
|
||||||
|
iface \$dev inet6 auto
|
||||||
|
eof
|
||||||
|
|
||||||
|
ifup "\${dev}"
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
# ensure there is /init in the initramfs -> otherwise there is a kernel panic
|
# ensure there is /init in the initramfs -> otherwise there is a kernel panic
|
||||||
# reason: initramfs is designed to be PRE regular os, so /init usually hands over to /sbin/init
|
# reason: initramfs is designed to be PRE regular os, so /init usually hands over to /sbin/init
|
||||||
# in our case, they are just the same
|
# in our case, they are just the same
|
||||||
|
|
Loading…
Reference in a new issue