add udev-trigger for loading the network card

This commit is contained in:
Nico Schottelius 2019-12-01 01:18:21 +01:00
parent 080922ac39
commit 704f2dab7c

View file

@ -40,25 +40,38 @@ cat "$RESOLVCONF" > $rootfs_tmpdir/etc/resolv.conf
# Make sure init is found by the kernel. # Make sure init is found by the kernel.
run_root ln -s /sbin/init /init run_root ln -s /sbin/init /init
# Servers have static addresses, disable the standard
# alpine setting of using tempaddr = 2
cat > "$rootfs_tmpdir/etc/sysctl.d/99-ipv6.conf" <<EOF
net.ipv6.conf.default.use_tempaddr = 0
net.ipv6.conf.all.use_tempaddr = 0
net.ipv6.conf.all.accept_ra = 1
EOF
cat > "$rootfs_tmpdir/etc/network/interfaces" <<EOF cat > "$rootfs_tmpdir/etc/network/interfaces" <<EOF
auto lo auto lo
iface lo inet loopback iface lo inet loopback
auto eth0 auto eth0
iface eth0 inet6 manual iface eth0 inet6 manual
pre-up modprobe ipv6 && sysctl -w net.ipv6.conf.eth0.accept_ra=1 pre-up ip link set eth0 up
post-up ip addr show dev eth0 | grep inet6 >> /etc/issue post-up ip addr show dev eth0 | grep inet6 >> /etc/issue
post-up echo post post up >> /etc/issue
EOF EOF
cat > "$rootfs_tmpdir/etc/hostname" <<EOF cat > "$rootfs_tmpdir/etc/hostname" <<EOF
alpine-unconfigured alpine-unconfigured
EOF EOF
echo ipv6 >> "$rootfs_tmpdir/etc/modules"
# Layer atop base rootfs. # Layer atop base rootfs.
run_root apk update run_root apk update
run_root apk upgrade run_root apk upgrade
run_root apk add openssh linux-vanilla openrc udev run_root apk add openssh linux-vanilla openrc udev
run_root rc-update add udev run_root rc-update add udev
run_root rc-update add udev-trigger
run_root rc-update add sshd run_root rc-update add sshd
run_root rc-update add networking run_root rc-update add networking
run_root rc-update add hostname run_root rc-update add hostname
@ -71,7 +84,7 @@ run_root rc-update add hostname
cp "$rootfs_tmpdir/boot/vmlinuz-vanilla" "$working_directory/alpine-kernel" cp "$rootfs_tmpdir/boot/vmlinuz-vanilla" "$working_directory/alpine-kernel"
# Cleanup. # Cleanup.
rm -r "$rootfs_tmpdir" #rm -r "$rootfs_tmpdir"
# Upload to netboot server. - needs to be done outside sudo # Upload to netboot server. - needs to be done outside sudo
echo "Use alpine-initramfs.gz alpine-kernel from $working_directory"! echo "Use alpine-initramfs.gz alpine-kernel from $working_directory"!