Linux kernel based on the mainline 5.17.5 kernel for Banana Pi M2 Zero with WiFi (and wireguard)
- I built this on Ubuntu 22.04 x86_64 with the Arm GNU Toolchain (arm-none-linux-gnueabihf), so download and extract it and set the bin dir to PATH:
export PATH=$PATH:/opt/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin
- Install the following tools and libs:
sudo apt-get install flex bison g++ libgmp3-dev libmpc-dev
- Build from this project root.
make INSTALL_MOD_PATH=output ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- m2z_lima_defconfig zImage modules modules_install dtbs -j$(nproc)
- Copy over the output/* (lib/modules) into rootfs of memory card (Follow the instructions here to install ubuntu in the memory card):
sudo cp -vfr ./output/* /
sync
- Install into the /boot dir of the memory card:
export KV=$(strings ./arch/arm/boot/Image | grep "Linux version" -m 1 | awk '{print $3}')
sudo cp -fv ./arch/arm/boot/zImage /boot/zImage_${KV}
sync
sudo cp -fv ./arch/arm/boot/dts/bpi-m2-zero-v4.dtb /boot/bpi-m2-zero.dtb_${KV}
sync
- Update the symlinks to point to new dtb and zImage inside /boot
cd /boot/
sudo ln -sf bpi-m2-zero.dtb_${KV} bpi-m2-zero.dtb
sudo ln -sf zImage_${KV} zImage
-
Used the m2z_lima_defconfig from https://github.com/avafinger/linux-5.6.y with some modifications to it. (This and some from here, although I'm not sure if the latter was necessary for wifi to be working)
-
Added sun8iw7p1smp_bpi-m2z_defconfig and m2z_defconfig.
-
Added bpi-m2-zero-v4.dts, along with the headers it requires and modified the Makefile to accomodate this.