Files
infix/board/common/uboot/scripts/ixprepdhcp.sh
T
Tobias Waldekranz ba73f3e832 uboot: HTTP netboot support
If we receive an option 67 (bootfile) matching http://IP/rootfs.itb,
use U-Boot's wget implementation to download the file. The web server
must listen on port 80. tftp:// is also supported.

Without a protocol prefix, assume that the bootfile should be fetched
using TFTP from ${serverip}.
2024-06-17 14:59:27 +02:00

29 lines
824 B
Bash

setenv autoload no
if dhcp; then
setenv proto tftp
setenv dltool tftpboot
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}" && setexpr bootfile sub "^(http|tftp)://([^/]+?)/(.*)" "\2:\3"; then
if test "${proto}" = "http"; then
setenv dltool wget
fi
fi
if ${dltool} ${ramdisk_addr_r} "${bootfile}"; then
setenv old_fdt_addr ${fdt_addr}
if fdt addr ${ramdisk_addr_r}; then
fdt get value sqoffs /images/rootfs data-position
fdt get value sqsize /images/rootfs data-size
fdt addr ${old_fdt_addr}
setexpr sqaddr ${ramdisk_addr_r} + ${sqoffs}
setexpr sqblkcnt ${sqsize} / 0x200
setexpr sqkbsize ${sqsize} / 0x400
setenv bootargs_root "root=/dev/ram0 ramdisk_size=0x${sqkbsize} initrd=0x${sqaddr},${sqsize}"
setenv prepared ok
fi
fi
fi