This page provides details about Raspberry Pi 4. You probably want to read the RaspberryPi page first (and maybe look at the images available at, and then decide whether you want to read this page.

Current status (11/2020)

Pulse Audio and Sound don't work as of 04/07/2021

You won't get sound using pulse audio using and the current debian installs using HDMI or A/V.

Random notes


Raspberry PI 4 8G

Other distros

Raspbian Raspberry Pi OS



Upstream kernel

Boot methods

There are several ways to boot...

Directly load kernel and initramfs from RPI firmware

That's what the Debian images currently do.

RPI firmware loads u-boot, which loads kernel/initramfs

That's what the Ubuntu images do, and is promising.


# mkimage -A arm64 -O linux -T script -d boot.txt boot.scr
# vmlinuz and initrd must be converted. See or
#   mkimage -A arm64 -T ramdisk -C none -n uInitrd -d initrd.img uInitrd
#   mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d vmlinuz uImage
#setenv bootargs earlyprintk console=ttyS0,115200 console=tty1 root=LABEL=writable rw
#fdt addr ${fdt_addr} && fdt get value bootargs /chosen bootargs

RPI firmware loads u-boot, which loads grub using EFI, which loads kernel/initramfs

That's what OpenSUSE does. See

Tianocore EDK II on RPI4 is used to boot iPXE as a Network Boot/Installer for Debian

This method provides a UEFI Network boot environment with a user GUI. SD Card or USB is not required. Requirements:

Tianocore EDK II on RPI4 is used to boot Debian

This method provides a UEFI boot environment on the SD card with a user GUI.

Network boot

Some info at

Various technical tips

changing command line

At least in bullseye, raspi-firmware overwrites /boot/firmware/cmdline.txt . This is done on every call of update-initramfs. There is a config file /etc/default/raspi-firmware to adjust the behavior. Extra command line options should go into /etc/default/raspi-extra-cmdline .

loop-mounting images

# fdisk -l 2020-02-13-raspbian-buster-lite.img
Disk 2020-02-13-raspbian-buster-lite.img: 1,7 GiB, 1849688064 bytes, 3612672 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x738a4d67

Device                               Boot  Start     End Sectors  Size Id Type
2020-02-13-raspbian-buster-lite.img1        8192  532479  524288  256M  c W95 FAT32 (LBA)
2020-02-13-raspbian-buster-lite.img2      532480 3612671 3080192  1,5G 83 Linux

# mount -o loop,offset=$((8192*512)) 2020-02-13-raspbian-buster-lite.img mountpoint

serial console
Red: +5V.
Green: Tx.
White : Rx.
Black: GND.

black on GND,
white on TXD (GPIO 14)
Green on RXD (GPIO 15)

add enable_uart=1 to /boot/config.txt

then screen /dev/ttyUSB0 115200

On a Raspberry Pi 4B 4G with bullseye/linux 5.10.13-1, the serial stopped working after the vc4 module was loaded. As a workaround, add module_blacklist=vc4 to the command line to make it work

monitor DHCP traffic using tcpdump

tcpdump -i eth0 -pvn port 67 and port 68

Root file system on a USB disk

As of bullseye/linux 5.10.13-1, the xhci/USB3 controller is not initialized until the reset_raspberrypi is loaded. This is by default not included in the initramdisk, making it impossible to use a usb disk as root filesystem. To make it work create an updated initramdisk by booting the Raspberry Pi from a MicroSD card or via network with the same kernel. Add reset_raspberrypi to /etc/initramfs-tools/modules of the running file system and run update-initramfs -k all -u (977694) Then copy the new /boot/initrd.img-{kernel}-amd64 to same location on your USB disk.

Many USB3 enclosures (especially with jmicron chip) do not work with uas. To make them work find out the device/vendor id with lsusb and add usb-storage.quirks=152d:9561:u to your kernel command line (replace 152d:9561 with your device/vendor id).


needs some firmware:

wget -O /lib/firmware/brcm/BCM4345C5.hcd
wget -O /lib/firmware/brcm/BCM4345C0.hcd

Build a kernel as a Debian package

See BuildADebianKernelPackage

To disable DEBUG_INFO before build: scripts/config --disable DEBUG_INFO

vmlinuz must be decompressed in /boot/firmware, or RPI4 won't boot. (zcat vmlinuz-... > vmlinux-... ; then point config.txt to vmlinuz)

Building a custom kernel from upstream (mainline) sources

# disable debug info
scripts/config --disable DEBUG_INFO
# build uncompressed kernel
sed -i '/KBUILD_IMAGE/ s/.gz//' arch/arm64/Makefile
# build debs
make -j `nproc` bindeb-pkg

Building a custom kernel from sources

# generate config
make bcm2711_defconfig
# disable debug info
scripts/config --disable DEBUG_INFO
# build uncompressed kernel
sed -i '/KBUILD_IMAGE/ s/.gz//' arch/arm64/Makefile
# build debs
make -j `nproc` bindeb-pkg

Then copy and install the generated deb.

After installing:

Example config.txt:

# Enable DRM VC4 V3D driver on top of the dispmanx display stack

(You don't need an initrd)

Example cmdline.txt:

console=tty1 console=ttyS0,115200 root=/dev/mmcblk0p2 rw elevator=deadline net.ifnames=0  rootwait

Accelerated 3D graphics on Debian

To get accelerated 3D graphics on Debian, you will need the following (status on 02/2021):

Example config.txt:


initramfs initrd.img

Example cmdline.txt:

console=tty0 console=ttyS1,115200 root=/dev/mmcblk1p2 rw net.ifnames=0  rootwait

GPIO support

All examples below are based on the "blinking led" schema. See

The Debian kernel is compiled with CONFIG_STRICT_DEVMEM=y. You need to add iomem=relaxed to the kernel command line (/boot/firmware/cmdline.txt) to allow mmap on /dev/mem.

using RPi.GPIO (python3-rpi.gpio)

RPi.GPIO doesn't support the RPI 4 currently. See this bug (with a patch that makes it working).

Debian bug: 976114


Debian has gpiozero version 1.4.1, which doesn't work with the RPI 4. After fixing RPi.GPIO, gpiozero 1.5.1 (current git) works.

Debian bug: 976118