default the host in fetch urls to be ROOTSERVER if it is blank
authorRussell Stuart <russell-debian@stuart.id.au>
Sat, 26 Dec 2015 09:01:45 +0000 (10:01 +0100)
committerEvgeni Golov <evgeni@debian.org>
Sat, 26 Dec 2015 09:03:02 +0000 (10:03 +0100)
Reason: this would mean I don't have to customise live.cfg for each
server I deploy it on (because the tftp server also serves the root
image).

So:

     append fetch=tftp:///path/file.ext

doesn't work now, but after the patch this would be
assumed since the host is blank:

     append fetch=tftp://${ROOTSERVER}/path/file.ext

Closes: #800498

components/9990-mount-http.sh

index d0f4900..2e68fe6 100755 (executable)
@@ -25,6 +25,9 @@ do_httpmount ()
                                                mount -t ramfs ram "${mountpoint}"
                                                mkdir -p "${dest}"
                                        fi
+                                       case "${url}" in
+                                               *:///*) url="${url%%:///*}://${ROOTSERVER}/${url##*:///}" ;;
+                                       esac
                                        if [ "${webfile}" = "FETCH" ]
                                        then
                                                case "$url" in