DirkS
Posts: 10345
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sun Apr 26, 2020 8:33 pm

fac13 wrote:
Sun Apr 26, 2020 7:32 pm
I’d welcome something from the project leaders to encourage continued patience.
This is probably as good as it gets: viewtopic.php?f=63&t=271935&p=1649157#p1648490

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sun Apr 26, 2020 8:38 pm


DirkS
Posts: 10345
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sun Apr 26, 2020 10:53 pm

dickon wrote:
Sun Apr 26, 2020 8:38 pm
Such as viewtopic.php?f=63&t=271935 ?
Yes, that's what said...

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Apr 27, 2020 8:29 am

You did. I was hunting for the thing during the window between you posting and me posting, and for some reason it didn't do its usual 'are you sure you want to post this, given this new post' thing. I then attempted to delete mine, but it said I couldn't.

Bit odd.

beldzhang
Posts: 10
Joined: Tue Jan 14, 2020 5:53 am

Re: Raspberry Pi4 bootloader - network boot support - BETA

Wed Apr 29, 2020 3:02 am

ibot3 wrote:
Mon Mar 23, 2020 1:14 pm
Did anyone ever had success with netbooting a Pi4 with DHCP relay?
Base on my knowledge, DHCP relay is nothing related to the client, it require the relay agent forward the packet properly,
and the server response correctly.

Because I write my own server and support relay long time ago, but I have no any idea about dnsmasq ...

I will do a test after my current develop work done.

ik5pvx
Posts: 4
Joined: Mon May 11, 2020 7:57 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon May 11, 2020 8:04 pm

Hello,
I'm trying to get the pi4 to netboot, following the guide at (1). I've updated the firmware, configured the boot order, flashed the eeprom with these parameters:

Code: Select all

    root@rasp2:~# rpi-eeprom-update 
    BCM2711 detected
    BOOTLOADER: up-to-date
    CURRENT: Thu Apr 16 17:11:26 UTC 2020 (1587057086)
     LATEST: Thu Apr 16 17:11:26 UTC 2020 (1587057086)
     FW DIR: /lib/firmware/raspberrypi/bootloader/critical
    VL805: up-to-date
    CURRENT: 000137ad
     LATEST: 000137ad

    root@rasp2:~# vcgencmd bootloader_version
    Apr 16 2020 18:11:26
    version a5e1b95f320810c69441557c5f5f0a7f2460dfb8 (release)
    timestamp 1587057086
    
    root@rasp2:~# vcgencmd bootloader_config
    [all]
    BOOT_UART=0
    WAKE_ON_GPIO=1
    POWER_OFF_ON_HALT=0
    DHCP_TIMEOUT=45000
    DHCP_REQ_TIMEOUT=4000
    TFTP_FILE_TIMEOUT=30000
    TFTP_IP=
    TFTP_PREFIX=0
    BOOT_ORDER=0x21
    SD_BOOT_MAX_RETRIES=3
    NET_BOOT_MAX_RETRIES=5
    [none]
    FREEZE_VERSION=0


With the SD card in, the pi4 boots normally, as expected. Without the SD card, I get the solid green led, which according to (2) could mean that the EEPROM is corrupted. After quite a long time (I didn't measure it, but it seems longer than 3 retries of 30 seconds trying to find the SD card), the led green goes off and starts blinking 4 dits. This should mean it couldn't find the appropriate start.elf and the rest of the boot files.

I don't see any DHCP packets at all with tcpdump on the tftp server, during this process. On the other hand, I do see them when the pi4 boots with the SD card inserted.

I can't find any documentation for vcgencmd bootloader* so I'm not sure if I'm reading the parameters directly out of the eeprom, or if I'm reading them out of the boot file in the /lib/firmware/... directory.

So, what I'm doing wrong, how can I move past this?

1. https://www.raspberrypi.org/documentati ... _config.md

2. viewtopic.php?f=28&t=58151#p1485558

alkersan
Posts: 15
Joined: Thu Mar 26, 2020 5:13 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sat May 16, 2020 7:04 pm

ik5pvx wrote:
Mon May 11, 2020 8:04 pm
With the SD card in, the pi4 boots normally, as expected. Without the SD card, I get the solid green led, which according to (2) could mean that the EEPROM is corrupted. After quite a long time (I didn't measure it, but it seems longer than 3 retries of 30 seconds trying to find the SD card), the led green goes off and starts blinking 4 dits. This should mean it couldn't find the appropriate start.elf and the rest of the boot files.

I don't see any DHCP packets at all with tcpdump on the tftp server, during this process. On the other hand, I do see them when the pi4 boots with the SD card inserted.
AFAIK without sdcard and SD_BOOT_MAX_RETRIES=3 - those 3 attempts will happen almost unnoticeable (maybe up to 1 second), because there is no timeout for awaiting sdcard readiness. I think that during that "long time" you're referring to - it actually tries to obtain network configuration (i.e. DHCP timeout 45s), especially given that you don't see DHCP packets.

Could you provide a bit more info about your network setup? What do you use for DHCP and TFTP servers? Just from the top of my head - you're not trying to netboot over wi-fi, right?

ik5pvx
Posts: 4
Joined: Mon May 11, 2020 7:57 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sun May 17, 2020 7:23 pm

Could you provide a bit more info about your network setup? What do you use for DHCP and TFTP servers?
The network is fairly straightforward. There's a dumb switch (unmanaged), both the router, the raspberry and the tftp server are connected to it.

The router provides DHCP, this is the relevant config:

Code: Select all

ip dhcp pool RASP2-ETH0
   host 192.168.128.17 255.255.255.0
   client-identifier 01dc.a632.4c2a.f5
   default-router 192.168.128.254 
   dns-server 8.8.8.8 1.1.1.1 
   option 150 ip 192.168.128.1 
   option 66 ip 192.168.128.1 
!         
the two options are two different ways of telling the client where to find the tftp server. When using the SD card, the raspberry gets the ip address correctly from the router.

The tftp server is atftpd, running on my main pc. The router can save its config to the tftp server correctly, so I know that part works.

I'm aware that wifi is not working for netboot (yet, hopefully :-))

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sun May 17, 2020 8:08 pm

Option 66 needs to be a text dotted-quad, rather than a packed IP address, at least according to what I have here. And you're not setting option 43 to 'Raspberry Pi Boot'.

Wifi booting is a *whole* lot of pain I very much doubt will happen. Not least because the wifi firmware seems to be a tad bigger than the 32k budget would allow.

kpf
Posts: 15
Joined: Fri Mar 23, 2018 11:20 am

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sun May 17, 2020 8:55 pm

For what it's worth, I have quite a few Pis (both 3s and 4s) networking booting just fine *without* Option 43 set. I don't have any special options set beyond the ones required for the subnet and the TFTP server. As noted above, that option is a string option, not an IPv4 address option, so it has to be an IPv4 address in text form. In the outside world it can also be a hostname, but I doubt the Pi's boot firmware will do a DNS lookup to translate a name to an IP address!

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Sun May 17, 2020 9:06 pm

Interesting. I might try that, then.

ik5pvx
Posts: 4
Joined: Mon May 11, 2020 7:57 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon May 18, 2020 9:29 pm

dickon wrote:
Sun May 17, 2020 8:08 pm
And you're not setting option 43 to 'Raspberry Pi Boot'.
What are you setting in option 43 then? It's a vendor specific option, it looks like it need to be encoded.

Anyway, I ran some packet capture on the router, I've noticed that PXE boot uses the hardware identifier (aka the mac address) while the dhcp client once linux has booted sends the client identifier (aka the mac address but with a 0x01 in front of it). Or at least, this is what the router tells me. This means that my previous config didn't recognize the client, and it was giving it a random address from the pool, instead of the fixed one I want. That is now solved, and it get the intended address.

Then there's the fact that I see the client making requests, the router making the offer, and then the client keeps making the same request over and over. There's obviously something
the pxe code doesn't like in the router response.

Finally, I've changed the config on the router to use the hostname for option 66. No change.

I've attached the packet capture, if anyone is interested.
pippo.pcap.gz
packet capture at the router
(702 Bytes) Downloaded 17 times

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon May 18, 2020 9:38 pm

Code: Select all

option option-43 code 43 = text;
with

Code: Select all

                option option-43 "Raspberry Pi Boot   ";
in the appropriate machine-specific stanza. It's in the docs somewhere.

It isn't PXE. Calling it such doesn't make it so.

[Edit:]
Oh, and change 66 back to the dotted-quad, but as a *text* field, not a packed IP address
[/Edit:]

ik5pvx
Posts: 4
Joined: Mon May 11, 2020 7:57 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon May 18, 2020 10:00 pm

dickon wrote:
Mon May 18, 2020 9:38 pm

Oh, and change 66 back to the dotted-quad, but as a *text* field, not a packed IP address

ok this did it (actually I was trying this right after sending my previous message)

This is what is needed on a cisco router to make it work. No other config is necessary:

Code: Select all

ip dhcp pool RASP2-ETH0
   host 192.168.128.17 255.255.255.0
   hardware-address dca6.324c.2af5
   default-router 192.168.128.254 
   option 66 ascii 192.168.128.1
 !  
Next step: read how to pass boot parameters to the kernel so that it knows where to find the nfs root.

User avatar
dickon
Posts: 1411
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon May 18, 2020 10:05 pm

cmdline.txt. Usual nfsroot= clause in that.

Fastlan
Posts: 2
Joined: Tue May 19, 2020 9:32 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Thu May 28, 2020 11:53 pm

Just setup a tftp server on my ubuntu VM on my desktop pc to network boot my raspberry pi 4. All goes well until it gets stuck on a rainbow screen, in tcpdump its hanging on armstub. Not sure what this means, would a boot delay setting help?
Pi specs:
RPI 4
OS for net boot: Ubuntu server 20.04
No SD card

Return to “Advanced users”