On 11/9/24 16:12, E Shattow wrote:
On Sat, Nov 9, 2024 at 6:20 AM Heinrich Schuchardt
<[email protected]> wrote:

Hello Jerome,

Using the old network stack U-Boot's dhcp command can be used to
download via TFTP. This fails with the lwIP stack:

StarFive # dhcp $kernel_addr_r 192.168.1.103:/vf2/grubriscv64.efi
ethernet@16030000 Waiting for PHY auto negotiation to complete.... done
DHCP client bound to address 192.168.1.47 (233 ms)
StarFive # tftpboot $kernel_addr_r 192.168.1.103:/vf2/grubriscv64.efi
Using ethernet@16030000 device
TFTP from server 192.168.1.103; our IP address is 192.168.1.47
Filename '/vf2/grubriscv64.efi'.
Load address: 0x40200000
Loading: #################################################################
           #################################################################
           #################################################################
           #################################################################
           #########
           4.1 MiB/s

We should try to provide the old functionality to make the move to lwIP
seamless.

In the CI QEMU instances we already have

test/py/tests/test_net.py

to test tftpboot. We should add an equivalent dhcp test.

Best regards

Heinrich

It is useful to have dhcp assignment without the side-effect of trying
to load files. Your script can be updated to:

The dhcp command was explicitly built to support booting by retrieving a filename from the DHCP server and then loading it from a TFTP server. The recovery of many routers and IoT devices depends on this feature.

There is an environment variable autostart that controls if the file is only loaded or booted.

If we want to change the behavior, it should be via a well reviewed patch and not as a side-effect.

Best regards

Heinrich


dhcp ; tftpboot $kernel_addr_r 192.168.1.103:/vf2/grubriscv64.efi

I agree this is a change in the user interface, but this change makes
sense to me. There needs to be a way to boot tftp using the DHCP
optioned tftp server, but a command 'dhcp' does not have boot in the
name it is not clear what this command does. All other commands that
do a boot action have 'boot' in the name? Perhaps dhcpboot or to make
tftpboot with an option to use DHCP options for the tftp server
location.

I don't think 'dhcp' should do anything except DHCP.

-E

Reply via email to