From e3e6477d47e28aaccb10c1e851611825ae1c43a9 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Mon, 30 Sep 2024 10:46:35 +0200 Subject: [PATCH 1/3] uboot: Skip bootmenu when in developer mode When a device is in developer mode, drop the user directly into the shell instead of having to go via the bootmenu, since this is usually what you want in that case. Emit a note about how to access the menu, for the rare cases when that is needed. --- board/common/uboot/scripts/ixboot.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/board/common/uboot/scripts/ixboot.sh b/board/common/uboot/scripts/ixboot.sh index d6ca963e2..33c878655 100644 --- a/board/common/uboot/scripts/ixboot.sh +++ b/board/common/uboot/scripts/ixboot.sh @@ -1,4 +1,4 @@ -echo "Press Ctrl-C NOW to enter boot menu" +echo "Press Ctrl-C NOW to override the default boot sequence" if sleep "${ixbootdelay}"; then run ixbootorder @@ -7,8 +7,12 @@ if sleep "${ixbootdelay}"; then reset fi -bootmenu if test "${dev_mode}" != "yes"; then + bootmenu pause "Console shell access PROHIBITED. Press any key to reset..." reset fi + +echo +echo 'Run "bootmenu" to interactively select a boot device' +echo From 69b93507a9e0363dca82efeacdc8adb6070fb748 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Mon, 30 Sep 2024 11:05:01 +0200 Subject: [PATCH 2/3] uboot: Honor static network settings If the user has manually configured all required network parameters, honor that setup, by skipping DHCP, and directly fetch the image. --- board/common/uboot/scripts/ixprepdhcp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/common/uboot/scripts/ixprepdhcp.sh b/board/common/uboot/scripts/ixprepdhcp.sh index ef4f66296..0fe7dbca2 100644 --- a/board/common/uboot/scripts/ixprepdhcp.sh +++ b/board/common/uboot/scripts/ixprepdhcp.sh @@ -1,6 +1,6 @@ setenv autoload no -if dhcp; then +if test -n "${ipaddr}" -a -n "${netmask}" -a -n "${serverip}" -a -n "${bootfile}" || dhcp; then setenv proto tftp setenv dltool tftpboot From a127925d9e83d66fbe6a347342e04409702a6196 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Tue, 1 Oct 2024 15:44:32 +0200 Subject: [PATCH 3/3] uboot: Add leading slash to path when using HTTP RFC 7230, section 5.3.1 specifies that the path must start with a slash. ...and nginx is not amused by its absence. --- board/common/uboot/scripts/ixprepdhcp.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/board/common/uboot/scripts/ixprepdhcp.sh b/board/common/uboot/scripts/ixprepdhcp.sh index 0fe7dbca2..935a1a843 100644 --- a/board/common/uboot/scripts/ixprepdhcp.sh +++ b/board/common/uboot/scripts/ixprepdhcp.sh @@ -4,9 +4,12 @@ if test -n "${ipaddr}" -a -n "${netmask}" -a -n "${serverip}" -a -n "${bootfile} setenv proto tftp setenv dltool tftpboot - if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}" && setexpr bootfile sub "^(http|tftp)://([^/]+?)/(.*)" "\2:\3"; then + if setexpr proto sub "^(http|tftp)://.*" "\\1" "${bootfile}"; then if test "${proto}" = "http"; then setenv dltool wget + setexpr bootfile sub "^http://([^/]+?)/(.*)" "\1:/\2" + else + setexpr bootfile sub "^tftp://([^/]+?)/(.*)" "\1:\2" fi fi