4

U-boot now supports booting Linux from an HTTP server

 1 year ago
source link: https://www.cnx-software.com/2023/01/25/u-boot-now-supports-booting-linux-from-an-http-server/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

U-boot now supports booting Linux from an HTTP server

Up until now, U-boot would only support the User datagram protocol (UDP) allowing for TFTP and NFS boot, but Linaro has now added support for TCP and HTTP in U-boot in order to boot Linux from common web servers.

TFTP boot from U-boot has been supported for years, as around the year 2006 I remember implementing TFTP Linux boot for a Karaoke system in order to lower the BoM cost by selecting a smaller flash device, and I also explained how to boot Linux on a TV box with TFTP back in 2014. This requires installing a TFTP server on your server, which is quite a trivial task, but HTTP servers are omnipresent, so it’s a welcome addition to U-boot.

U-Boot HTTP

If you want to use HTTP to boot Linux, it needs to be enabled in the U-boot config:

CONFIG_PROT_TCP=y
CONFIG_PROT_TCP_SACK=y
CONFIG_CMD_WGET=y

The top and bottom options are pretty obvious, and the second config enables Selective Acknowledgment (SACK) for maximum performance of the TCP protocol.

Once you have installed an HTTP server in the server hosting the Linux image, you can boot Linux on the target device running U-boot as follows:

setenv autoload 0;dhcp
setenv serverip 192.168.0.1
wget $loadaddr ~/vmlinuz

Alternatively, it is also possible to load Linux with a single command line after an IP address is acquired through DHCP:

wget $loadaddr 192.168.0.1:~/vmlinuz

U-boot Linux HTTP boot

The advantage of using HTTP over TFTP is limited, but that’s just the start of the work done as part of the Arm SystemReady project, as Linaro plans to implement HTTPS support and eventually integrate it with UEFI HTTP boot in order to allow U-boot to have a standardized and secure way to download boot images from a web server.

Via the Linaro Blog

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK