]> git.ozlabs.org Git - petitboot/commitdiff
pb-udhcpc: Fix generation of TFTP URLs
authorJeremy Kerr <jk@ozlabs.org>
Wed, 10 Apr 2013 02:02:20 +0000 (12:02 +1000)
committerGeoff Levand <geoff@infradead.org>
Wed, 10 Apr 2013 18:12:35 +0000 (11:12 -0700)
DHCP boot-file parameters may not contain a preceeding slash. In this
case, the current udhcp script will not form a correct URL.

This change adds the slash unconditionally; in the case that the
pathname already has a preceeding slash, the URL parser will handle this
correctly.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
utils/pb-udhcpc

index 45c801909f3a72c62dbf0c80cea434b0ce76c74d..91d40f6c01f37eb89ea468cd8ee9a8afca8b699e 100644 (file)
@@ -15,7 +15,7 @@ pb_add () {
 
        [ ${k_server_ip} != ${rootpath} ] || k_server_ip=${serverid}
 
 
        [ ${k_server_ip} != ${rootpath} ] || k_server_ip=${serverid}
 
-       printf "add@/net/${interface}\0name=netboot\0image=tftp://${siaddr}${boot_file}\0args=root=/dev/nfs ip=any nfsroot=${k_server_ip}:${k_root_dir}\0" | pb-event
+       printf "add@/net/${interface}\0name=netboot\0image=tftp://${siaddr}/${boot_file}\0args=root=/dev/nfs ip=any nfsroot=${k_server_ip}:${k_root_dir}\0" | pb-event
 }
 
 pb_remove () {
 }
 
 pb_remove () {