💾 Archived View for mstdn.design › logs › 2021-03-29-debian.krnl-bld.gmi captured on 2021-12-03 at 14:04:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

back to homepage

Building A Debian Style Kernel For Your Raspberry Pi.

03-29-2021

I'm sure this is mere child's play for many people, however, even though I've

hacked my way building kernels for the Raspberry Pi, I've finally found out

where the kernel's repositories lie. It's always the same with ARM devices, one

size does not fit all and all kernels built for these remarkable devices, must

be tailor made. Even though I've had a bit of luck building kernels for the pine

phone, I decided to risk making an unnecessary kernel build for my Raspberry Pi

4b, 8GB. I used the same commands that I used for the pine phone, with some

important differences. In the past, I would go into these endeavors blindly

and with crossed fingers and it was usually hit or miss.

Only with the ARM kernels, mind you, as I've said there just isn't any

homogenized way to build kernels for the varied ARM processors out in the wild.

Frankly, I was damn happy and surprised to see it boot up. I'm actually running

real Debian on my Raspberry Pi, I mention this only, because when this new

custom kernel that I built, kernel 5.10.25, booted up, there were a host of

raspberries, at the top of the screen during the kernel boot process. Yes, just

like how it does with Raspbian and Raspberry OS. It was really gratifying to

see that I had done the configuration and compilation correctly and that it

booted with no issues.

There are unofficial Debian images for the Raspberry Pi, which I'll post the

links to. I think that the Raspberry Pi and the pinephone make a very lovely

couple. They're both very compact and in their current configurations very

powerful indeed. Admittedly, there are phones with bigger more powerful CPU's,

GPU's and RAM that dwarf both the Pi and the phone but the two Linux machines

are running native Linux at lightening speeds without all the bloat of Android

and Android Apps. I'll argue that both the Pi and the pinephone are ultimately

more useful devices than any Android phone.

Now I don't want to confuse anyone into thinking that the kernel compilation for

the pine phone and the Raspberry Pi are identical because they are not. The

pinephone uses an Allwinner Chip and the Pi uses a Broadcom. However, where

they do share similarities, is what I'd like to point out here.

ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j4 bindeb-pkg

KERNELRELEASE="5.10.25" KDEB_PKGVERSION="1"

ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make -j4 bindeb-pkg

KERNELRELEASE="5.10.25" KDEB_PKGVERSION="1"

It would seem that generating the correct, corresponding configuration file,

(.config) is the most important step for success, when compiling ARM kernels.

This is the method I used, I'm sure there are many ways to do the same thing.

I have been having success doing things this way and I plan to continue so.

One more point, just as there are different steps used to successfully

configure, customize and compile kernels for ARM, there are also too, specific

ways to compile kernels for members of the different Raspberry Pi versions and

variants. Something to keep in mind if you're going to do anything like this.

Thanks for reading and Adieu.

https://people.debian.org/~stapelberg/raspberrypi3/

https://raspi.debian.net/tested-images

https://gitlab.com/mobian1/wiki/-/wikis/Kernel-Build

https://www.raspberrypi.org/documentation/linux/kernel/building.md