Differences between revisions 37 and 38
Revision 37 as of 2020-08-30 19:22:36
Size: 6238
Editor: ?ibu
Comment: USB issue fixed in debian 5.8 kernel
Revision 38 as of 2020-11-03 06:47:27
Size: 6575
Editor: ?RobertSchuettler
Comment: Added TOC + Quickstart section (for the impatient) on the top
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Status on 2020-03-30 = #language en

<<TableOfContents(3)>>

== Quickstart ==

Images that can simply be copied to an SD card are available via: [[https://raspi.debian.net/]]

Take your pick from [[https://raspi.debian.net/tested-images/]] to get a basic Debian system running on your RaspberryPi in no time. Then apt install whatever you like.

== Status on 2020-03-30 ==
Line 19: Line 29:
= Random notes = == Random notes ==

Quickstart

Images that can simply be copied to an SD card are available via: https://raspi.debian.net/

Take your pick from https://raspi.debian.net/tested-images/ to get a basic Debian system running on your RaspberryPi in no time. Then apt install whatever you like.

Status on 2020-03-30

  • What works:
    • Booting Linux 5.5 from unstable, using raspi-firmware from unstable (directly -- as for RPI3 images)
    • Same with Linux 5.6
    • Same with u-boot (both with 5.5 and 5.6), after modifying the u-boot package in Debian testing/unstable/experimental to add the rpi4 target (See 958668)

  • The rpi4 branch of image-specs builds an image that works, taking a number of shortcuts

  • There are also debos recipes available

  • TODOs:
    • Kernel: 5.5 has partial support (see table here). 5.6 is better. 5.7 will be even better.

    • Modify u-boot package to support booting using it.
    • Integrate ability to boot with u-boot in raspi-firmware
    • Test that everything works fine:
      • Ethernet
      • Wifi
      • GPIO
      • ...

Random notes

Raspberry PI 4 8G

  • USB doesn't work up to kernel 5.7 for the hardware variant of PI4 with 8GB RAM
  • This issue has a fix in kernel 5.8 (currently in experimental): https://lkml.org/lkml/2020/5/5/998

Other distros

Raspbian

  • ships only a armhf image
  • 4.19 kernel

Ubuntu

openSUSE

Debian

  • customizing the images for RPI3 and using the 5.5-rc5 kernel in experimental
    • works: initial boot, HDMI
    • doen't work; serial console, network, keyboard

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)

FIXME this doesn't work for the RPI4. I'm not sure why. Maybe because of one of the cmd line parameters passed to the kernel in that case?

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

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

FIXME

# https://a-delacruz.github.io/ubuntu/rpi3-setup-64bit-uboot.html
# mkimage -A arm64 -O linux -T script -d boot.txt boot.scr
# vmlinuz and initrd must be converted. See https://linux-sunxi.org/Initial_Ramdisk or https://andrei.gherzan.ro/linux/uboot-on-rpi/
#   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 https://www.suse.com/media/article/UEFI_on_Top_of_U-Boot.pdf

Network boot

Some info at http://lig-membres.imag.fr/duble/software/raspberry-pi-netboot/

Various technical tips

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

https://www.raspberrypi.org/documentation/usage/gpio/
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

monitor DHCP traffic using tcpdump

tcpdump -i eth0 -pvn port 67 and port 68

Build a kernel

See BuildADebianKernelPackage

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

https://stackoverflow.com/questions/7505164/how-do-you-non-interactively-turn-on-features-in-a-linux-kernel-config-file/39440863#39440863

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