Debian Linux Kernel Handbook

Please read the reference Debian Linux Kernel Handbook.

How to compile your own kernel from current Debian git sources

The source code for the Debian Linux kernel is maintained within the salsa gitlab server. The master branch currently is based on linux-6.6.y, the sid branch is based on linux-6.5.y, the bookworm branch is based on linux-6.1.y and the bullseye branch is based on linux-5.10.y.

You can checkout these branches and recompile locally a current Debian kernel with this script: kernel.sh. This uses about 6 GB of disk space.

You can also cross-compile armhf and arm64 kernels on amd64, also adding all raspberry-pi patches is fully scripted:

# cross-compile a generic armhf kernel:
./kernel.sh armhf
# cross-compile a generic arm64 kernel:
./kernel.sh arm64
# cross-compile an armhf kernel with all raspbian-pi patches included:
./kernel.sh rpi-armhf
# cross-compile an arm64 kernel with all raspbian-pi patches included:
./kernel.sh rpi-arm64

You can download already compiled kernels from the release page.

This mailinglist discusses rpi support for the upstream/mainline kernel: http://lists.infradead.org/pipermail/linux-rpi-kernel/

German Heise to current Raspi-4 Support: https://www.heise.de/ct/artikel/Linux-5-5-Raspi-4-Unterstuetzung-reift-32-Bit-x86-Support-verkuemmert-4605827.html

UEFI firmware for Raspberry Pi 4B: https://rpi4-uefi.dev/

archive of older debian packages

If you want to download older debian software packages, please look at https://snapshot.debian.org/.

openocd and JTAG

openocd and JTAG setup for RaspberryPi 3B: https://metebalci.com/blog/bare-metal-raspberry-pi-3b-jtag/

Blocking kernel updates with dpkg

If you compile your own kernel images and don’t want official kernels to be installed automatically, you can change the dpkg status from ‘install’ to ‘hold’:

# list all installed linux-image deb packages:
dpkg -l | grep linux-image
# change one specific package to 'hold'
echo linux-image-amd64 hold | sudo dpkg --set-selections
# list current status of the package:
dpkg -l linux-image-amd64
# reset status to normal 'install':
echo linux-image-amd64 install | sudo dpkg --set-selections
# list current status of the package:
dpkg -l linux-image-amd64

Or you can use apt-mark directly:

apt-mark hold linux-image-amd64

Linux Test Project LTP

Compile and install ltp into /opt/ltp:

sudo apt-get install build-essential autoconf libtool libtool-bin bison flex git libacl1-dev libssl-dev
sudo apt-get install quotatool
git clone --depth 1 https://github.com/linux-test-project/ltp
pushd ltp
make autotools
./configure
make -j 8
sudo make install
popd
# Execute the tests:
sudo LANG=en_US.UTF-8 /opt/ltp/runltp -Q

Note: Please keep IPv6 enabled for LTP tests.

If your host is not properly configured within DNS and you want to pass IP lookup tests, you can add your host to /etc/hosts:

echo -e "127.0.0.2\t$HOSTNAME" >> /etc/hosts
echo -e "::2\t\t$HOSTNAME" >> /etc/hosts

Fuego Test System

Fuego packages Jenkins into a Docker container to run LTP on embedded boards. See also:

Syzkaller

To start syzkaller locally for arm32 and arm64, you can use the script syzkaller.sh. If you build both the 32bit and 64bit tests, this uses about 20 GB of disk space.

Automated Linux Kernel Testing