Bonding/Link Aggregation on Debian?

I would recommend you have a go at:

#fetch all the vf2 docker setup and scripts
git clone https://github.com/kng/visionfive2-docker.git
cd visionfive2-docker
#build the vf2 ubuntu container with all the packages we need to build the kernel and image
time ./podman_build.sh 
sync

#build all the different vf2 specific stuff
time ./podman_shell.sh build_u-boot.sh
time ./podman_shell.sh build_opensbi.sh
time ./podman_shell.sh build_spl.sh

#build the kernel as tweaked for the vf2 by default
time ./podman_shell.sh build_kernel.sh

#now here come the kernel customization steps
./podman_shell.sh /bin/bash
###***********************IN PODMAN SHELL**********************
### similar setup steps as within the build_kernel.sh script
CORES=$(nproc)
echo $CORES
ROOTFS=/mnt/boot
cd linux
make starfive_visionfive2_defconfig CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv 

#finally now we can run menuconfig
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv menuconfig

###in menuconfig ncurses display
Cursor down to "Device Drivers  --->" and PRESS ENTER
Cursor down to "[*] Network device support  --->" and PRESS ENTER
Cursor down to "< >     Bonding driver support" and PRESS ENTER
PRESS SPACEBAR or PRESS m until it displays "<M>     Bonding driver support"
Cursor over to EXIT and PRESS ENTER
Cursor over to EXIT and PRESS ENTER
Cursor over to EXIT and PRESS ENTER
Eventually it will prompt you: "Do you wish to save your new configuration?"
Cursor over to "< Yes >" and PRESS ENTER
DONE. You have exited menuconfig and the .config file was saved.

# build the kernel with the same steps as within the build_kernel.sh script
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv -j "${CORES}"
mkdir -p ${ROOTFS}
make CROSS_COMPILE=riscv64-linux-gnu- ARCH=riscv INSTALL_PATH=${ROOTFS} zinstall 
ls -l arch/riscv/boot/Image.gz
ls -l arch/riscv/boot/dts/starfive/*.dtb
ls -l ${ROOTFS}
ls -l ${ROOTFS}/config-5.15.0
#this last grep reassures we really did build with the bonding module enabled
grep -n -H BONDING ${ROOTFS}/config-5.15.0

exit
###EXITED PODMAN SHELL

It should be good.
Within ~/riscvplay/visionfive2-docker, there should be: mnt/linux/drivers/net/bonding/bonding.ko
which is held within the Image.gz itself.

1 Like