User avatar
clicky
Posts: 511
Joined: Thu Oct 25, 2012 7:34 am

Help Building Raspery Pi OS 64 Kernel

Sat Jul 25, 2020 7:46 pm

I've embarked on mission to set up microk8s on tiny Pi4 cluster (1x Pi4 2GB + 2+ x Pi4 4GB workers) and got quite far... but got stuck on provided beta 64bit kernel lacking 'CONFIG_CFS_BANDWIDTH=y' config flag... (it seems to be needed for 'cpu.cfs_period_us' in cgroups)

So, it seems that the most straight forward is to just drop in place new version of kernel but with that one extra config flag set. And, if I get pretty much like for like version of it - then the rest should not cause any other issues (I hope).

I've got some experience building kernels, but that was pre year 2000 and even then it was a bit scary going through myriad of config parameters and trying to understand what they mean...

What I am hoping is that there's some simpler recipe like in https://www.raspberrypi.org/documentati ... uilding.md
So, I would be very grateful if someone close to the subject point me to how to configure it to build 64bit version, how to add config parameter 'CONFIG_CFS_BANDWIDTH=y' in, ensure it is made with all other stuff original beta 64bit kernel is made and warn me if there are any gotchas in the process. Theoretically I should, after the end of the process, be able to just update image (which file?) and modules (where?). I'm happy to put time into trying to get it - but quick bootstrap of the process would be really appreciated :)

PS I do have Pi4 with 64bit Raspberry Pi OS and SSD ready for the job...

User avatar
clicky
Posts: 511
Joined: Thu Oct 25, 2012 7:34 am

Re: Help Building Raspery Pi OS 64 Kernel

Sun Jul 26, 2020 6:43 pm

I've figured it out (phrase very fitting for this):

https://www.raspberrypi.org/documentati ... uilding.md - setting up all needed packages and github reference

Code: Select all

make bcm2711_defconfig
before adding `CONFIG_CFS_BANDWIDTH=y` to .config file (doh)

Code: Select all

ARCH=arm64 make -j4 Image.gz modules dtbs
instead of `zImage` (and extra ARCH envvar!!!)

And - it seems to be working now. Microk8s are happy with existence of `cpu.cfs_period_us` and `cpu.cfs_quota_us` in `/sys/fs/cgroup/cpu,cpuacct/`

lucj
Posts: 1
Joined: Tue Dec 15, 2020 7:44 am

Re: Help Building Raspery Pi OS 64 Kernel

Tue Dec 15, 2020 7:59 am

Thanks for this procedure, It's been a long time I've last built a Kernel.
Just a little question though :)

After the following command

Code: Select all

make bcm2711_defconfig
The configuration string was already in .config, is that normal ?
CONFIG_CFS_BANDWIDTH=y


You use Image.gz instead of zImage,

Code: Select all

ARCH=arm64 make -j4 Image.gz modules dtbs
Can the Kernel, Modules and Device be installed with the following commands (also replacing zImage with Image.gz or is there any other steps) ?

Code: Select all

sudo make modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/Image.gz /boot/$KERNEL.img 
Thanks a lot

Return to “General discussion”