Building custom kernel for the b3's debian system is one area where documentation is ... well absent. It's not overly complicated but I admit I never took the time to write it. Note that the goal is to create a kernel deb package.
You can either build this package directly on the b3 (at least 8 hours) or cross-compile it on another system (~20-30 minutes on a reasonably modern computer). To cross compile, you need to install cross compilation tools and dependencies with the following commands on a debian system or chroot :
Code: Select all
dpkg --add-architecture armel
apt update
apt install crossbuild-essential-armel device-tree-compiler u-boot-tools bc gawk bison flex libncurses-dev libssl-dev devscripts git git-buildpackage
If you compile directly on a b3, you just need to install build dependencies :
Code: Select all
apt update
apt install build-essential device-tree-compiler u-boot-tools bc gawk bison flex libncurses-dev libssl-dev devscripts git git-buildpackage
After that, you can clone the repository (as a regular user of course):
Code: Select all
git clone https://github.com/Excito/kernel-5.10.git
I use quilt to manage the patches, you should configure it following
this guide.
Now everything is in place. You could compile a binary-only package with these commands:
- Cross-compiling :
Code: Select all
dpkg-buildpackage -aarmel -us -uc -b
- Directly on the b3 :
There are a serie of patches for the platform which include the kernel configuration itself. If you want to edit this configuration, begin by applying all the patches (configuration is the last one) :
Then apply the configuration (remove ARCH=arm if you run this directly on the b3) :
You can then edit the configuration with the usual tools :
Once you're happy with your configuration, generate the new configuration file and refresh the configuration patch:
Code: Select all
make ARCH=arm savedefconfig
mv defconfig arch/arm/bubba3_defconfig
quilt refresh
After that you can recompile the binary package with the above dpkg-buildpackage command, upload and test it on the b3.
In order to compile a newer version, you need first to port the patches in debian/patches for this version. This is a different beast as sometimes kernel changes between the versions break things and you need to update the patches. Quilt makes this easy though as long as you're careful.
Note that as bookworm is in soft freeze, it seems that the included kernel will be 6.1 series. I will soon start working on creating a 6.1 package for the b3.