From 6891dfe41a1958a78b47eb5dce297884c805934d Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 14 Mar 2021 17:06:28 +0100 Subject: [PATCH] [alpine] setup bond0 by default --- alpine-rebuild-initramfs.sh | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/alpine-rebuild-initramfs.sh b/alpine-rebuild-initramfs.sh index daa32d7..d00df16 100755 --- a/alpine-rebuild-initramfs.sh +++ b/alpine-rebuild-initramfs.sh @@ -12,7 +12,7 @@ set -x SSH_KEYS=$1; shift MAJOR_VERSION=3.13 -MINOR_VERSION=1 +MINOR_VERSION=2 IMAGE=alpine-minirootfs-$MAJOR_VERSION.$MINOR_VERSION-x86_64.tar.gz RESOLVCONF=/etc/resolv.conf @@ -21,6 +21,9 @@ working_directory=$(pwd -P) #rootfs_tmpdir=$(mktemp -d) rootfs_tmpdir=alpine_${MAJOR_VERSION}-${MINOR_VERSION}-rootfs +initramfs="$working_directory/initramfs-alpine-${MAJOR_VERSION}.${MINOR_VERSION}" +kernel="$working_directory/kernel-alpine-${MAJOR_VERSION}.${MINOR_VERSION}" + mkdir -p ${rootfs_tmpdir} rootfs_url="http://dl-cdn.alpinelinux.org/alpine/v$MAJOR_VERSION/releases/x86_64/$IMAGE" @@ -66,19 +69,39 @@ iface lo inet loopback auto eth0 iface eth0 inet6 manual - pre-up ip link set eth0 up + bond-master bond0 + post-up /sbin/ip link set \$IFACE up + post-up /sbin/ip link set \$IFACE mtu 9000 + +auto eth1 +iface eth1 inet6 manual + bond-master bond0 + post-up /sbin/ip link set \$IFACE up + post-up /sbin/ip link set \$IFACE mtu 9000 + +auto bond0 +iface bond0 inet6 manual + bond-miimon 500 + bond-mode 4 + post-up /sbin/ip link set \$IFACE up + post-up /sbin/ip link set \$IFACE mtu 9000 + bond-slaves none + EOF sudo tee "$rootfs_tmpdir/etc/hostname" < "$working_directory/alpine-initramfs.gz") -cp "$rootfs_tmpdir/boot/vmlinuz-lts" "$working_directory/alpine-kernel" +(cd $rootfs_tmpdir; sudo find . | sudo cpio -H newc -o | gzip -9 > ${initramfs}) +cp "$rootfs_tmpdir/boot/vmlinuz-lts" "${kernel}" echo rm -rf "$rootfs_tmpdir" -echo "Use alpine-initramfs.gz alpine-kernel from $working_directory"! +echo "Use ${initramfs} and ${kernel} from $working_directory"! exit 0