raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.15k stars 1.68k forks source link

pi3 network boot broken #1913

Open cleverca22 opened 1 month ago

cleverca22 commented 1 month ago

Describe the bug tftp client in start.elf is broken

To reproduce attempt to network boot a pi3 with the latest firmware, using https://github.com/openSUSE/xinetd and https://github.com/mmaraya/netkit-ftp/tree/master

Expected behaviour the rpi to actually boot

Actual behaviour all tftp transfers finish and then act like the file didnt exist

Logs If applicable, add the relevant output from dmesg or similar.

[clever@amd-nixos:~/apps/rpi/firmware/boot]$ git bisect bad
11a76e07ef1b6304a378c4ee3da200fe6facea46 is the first bad commit
commit 11a76e07ef1b6304a378c4ee3da200fe6facea46
Author: popcornmix <popcornmix@gmail.com>
Date:   Thu Apr 16 12:40:43 2020 +0100

    firmware: Switch to building from common firmware branch

Additional context

[root@router:/tftproot/arch64_be]# cat xinetd.conf
service tftp
{ 
  protocol    = udp

  socket_type = dgram

  wait        = yes
  user        = nobody
  server      = /nix/store/bpkwjqrfbg32cky75fz219p4367gy16j-netkit-tftp-0.17/sbin/in.tftpd
  server_args = /tftproot

}
[root@router:/tftproot/arch64_be]# ps aux | grep xinet
root        3721  0.0  0.0   6064  2944 pts/1    S+   Aug03   0:00 xinetd/xinetd -syslog daemon -dontfork -stayalive -f /nix/store/8188a7il2r5yw1bfm3ji3896cb8akm0l-xinetd.conf

MESS:00:00:11.811188:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:11.815249:0: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
MESS:00:00:11.834101:0: brfs: File read: -2 bytes
...
MESS:00:00:12.233990:0: dtb_file 'bcm2710-rpi-3-b.dtb'
MESS:00:00:13.260260:0: brfs: File read: /mfs/sd/bcm2710-rpi-3-b.dtb
MESS:00:00:13.264916:0: Loading 'bcm2710-rpi-3-b.dtb' to 0x100 size 0x0
MESS:00:00:13.317771:0: brfs: File read: -2 bytes
MESS:00:00:13.324590:0: dterror: out of memory
MESS:00:00:14.516181:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:14.538462:0: brfs: File read: -2 bytes
MESS:00:00:18.777509:0: brfs: File read: /mfs/sd/cmdline.txt
MESS:00:00:18.781461:0: Failed to read command line file 'cmdline.txt
MESS:00:00:21.112313:0: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not defined
MESS:00:00:21.296502:0: brfs: File read: -2 bytes
MESS:00:00:21.338002:0: No compatible kernel found

Screenshot_2024-08-04_11-37-25 when booting, every tftp request ends with the rpi sending "Early terminate" and the uart logs then claiming -2 bytes read it then ignores the kernel specified in config.txt, and tries loading the default path, and fails

unfortunately, a bisect of the firmware repo points to the commit where the pi4 code got merged in, and it has remained broke until latest master

timg236 commented 3 weeks ago

Pi3B and Pi3B+ seem to be working ok with network boot here with Bookworm 64-bit

Did you upgrade bootcode.bin as well as start.elf

root@pxe:/tftpboot/44bee3d2# sha256sum bootcode.bin 6505bbc8798698bd8f1dff30789b22289ebb865ccba7833b87705264525cbe46 bootcode.bin

start.elf VC_BUILD_ID_USER: dom VC_BUILD_ID_TIME: 15:31:28 VC_BUILD_ID_VARIANT: start VC_BUILD_ID_TIME: May 24 2024 VC_BUILD_ID_BRANCH: bcm2711_2 VC_BUILD_ID_HOSTNAME: buildbot VC_BUILD_ID_PLATFORM: raspberrypi_linux VC_BUILD_ID_VERSION: 4942b7633c0ff1af1ee95a51a33b56a9dae47529 (clean)