Merge pull request #728 from kernelkit/uboot-http-netboot-fixes

U-Boot HTTP Netboot Fixes

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2024-10-17 16:31:24 +02:00
committed by GitHub
+5 -4
View File
@@ -1,19 +1,20 @@
setenv autoload no
if test -n "${ipaddr}" -a -n "${netmask}" -a -n "${serverip}" -a -n "${bootfile}" || dhcp; then
if test -n "${ipaddr}" || dhcp; then
setenv proto tftp
setenv dltool tftpboot
setenv dlfile "${bootfile}"
if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}"; then
if test "${proto}" = "http"; then
setenv dltool wget
setexpr bootfile sub "^http://([^/]+?)/(.*)" "\1:/\2"
setexpr dlfile sub "^http://([^/]+?)/(.*)" "\\1:/\\2" "${bootfile}"
else
setexpr bootfile sub "^tftp://([^/]+?)/(.*)" "\1:\2"
setexpr dlfile sub "^tftp://([^/]+?)/(.*)" "\\1:\\2" "${bootfile}"
fi
fi
if ${dltool} ${ramdisk_addr_r} "${bootfile}"; then
if ${dltool} ${ramdisk_addr_r} "${dlfile}"; then
setenv old_fdt_addr ${fdt_addr}
if fdt addr ${ramdisk_addr_r}; then
fdt get value sqoffs /images/rootfs data-position