From 481a21798daf0a805f048cabb65f3a80fc60fd06 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 31 Jul 2008 16:55:46 +0100 Subject: [autoboot] Retain initial-slash (if present) when constructing TFTP URIs When we boot from a DHCP-supplied filename, we previously relied on the fact that the current working URI is set to tftp://[next-server]/ in order to resolve the filename into a full tftp:// URI. However, this process will eliminate the distinction between filenames with and without initial slashes: cwuri="tftp://10.0.0.1/" filename="vmlinuz" => URI="tftp://10.0.0.1/vmlinuz" cwuri="tftp://10.0.0.1/" filename="/vmlinuz" => URI="tftp://10.0.0.1/vmlinuz" This distinction is important for some TFTP servers. We now explicitly construct a string of the form "tftp://[next-server]/filename" so that a filename with an initial slash will result in a URI containing a double-slash, e.g. "tftp://10.0.0.1//vmlinuz" The TFTP code always strips a single initial slash, and so ends up presenting the correct path to the server. URIs entered explicitly by users at the command line must include a double slash if they want an initial slash presented to the TFTP server: "kernel tftp://10.0.0.1/vmlinuz" => filename="vmlinuz" "kernel tftp://10.0.0.1//vmlinuz" => filename="/vmlinuz" --- src/include/gpxe/settings.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include') diff --git a/src/include/gpxe/settings.h b/src/include/gpxe/settings.h index ae5a259d..78f3e698 100644 --- a/src/include/gpxe/settings.h +++ b/src/include/gpxe/settings.h @@ -215,6 +215,7 @@ extern struct setting password_setting __setting; extern struct setting priority_setting __setting; extern struct setting bios_drive_setting __setting; extern struct setting uuid_setting __setting; +extern struct setting next_server_setting __setting; /** * Initialise a settings block -- cgit v1.2.3-55-g7522