iPXE discussion forum

Full Version: Server Variables Not Resolving Reliably
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am booting a Hyper-V guest using Tiny PXE Server.

My iPXE script starts

Code:
#!ipxe
set BootServer http://${dhcp-server}

However, BootServer and dhcp-server do not working later in the script, I always receive could not boot image, file not found.

Code:
initrd ${BootServer}/boot/BCD
initrd ${BootServer}/boot/boot.sdi
initrd ${BootServer}/sources/boot.wim

If i hard code the ip in the following then it boots fine.

Code:
initrd http://10.0.1.62/boot/BCD
initrd http://10.0.1.62/boot/boot.sdi
initrd http://10.0.1.62/sources/boot.wim

I am using a menu, and so to check the variable I use it in the Menu Title and it displays the correct http://10.0.1.62

Why are these variables not working??

iPXE 1.0.0+ (30f9)
Post the error message you get, if possible take a screenshot of iPXE downloading and then showing the error.
I cant upload files??????................

Error is "Could not boot image: No such file or directory"

Code:
#!ipxe
set boot-url http://${next-server}
# set boot-url http://${dhcp-server}

# Set Menu Timeout
set menu-timeout 5000
set submenu-timeout ${menu-timeout}

# Set Menu Default to Exit after timeout
isset ${menu-default} || set menu-default exit
#console --picture http://${boot-url}/ipxe.png

######## MAIN MENU ###################
:start
menu Mike's PXE Boot Menu ${boot-url}
item --gap -- ----- Choose the Boot Option required -----
item WIMBootHTTP-ISO Boot to ISO over HTTP
item WIMBootHTTP-WIM Boot to WIM over HTTP
item WIMBootTFTP Boot to WIM over TFTP
item reboot Reboot
choose --default exit --timeout 30000 target && goto $

:WIMBootHTTP-ISO
kernel wimboot
initrd ${boot-url}/images/LiteTouchPE_x64.iso
kernel ${boot-url}/memdisk iso raw
boot

:WIMBootHTTP-ISO
kernel wimboot
initrd ${boot-url}/boot/BCD
initrd ${boot-url}/boot/boot.sdi
initrd ${boot-url}/sources/boot.wim
boot

:WIMBootTFTP
kernel wimboot
initrd /boot/BCD
initrd /boot/boot.sdi
initrd /sources/boot.wim
boot

:reboot
Reboot

:exit
exit
(2017-11-14 11:01)MikhailCompo Wrote: [ -> ]I cant upload files??????................

No uploads allowed, please use some kind of imagepaste service.

(2017-11-14 11:01)MikhailCompo Wrote: [ -> ]Error is "Could not boot image: No such file or directory"

That's not the full error message, all errors from iPXE has an url to ipxe.org, always include it.
(2017-11-14 17:38)NiKiZe Wrote: [ -> ]
(2017-11-14 11:01)MikhailCompo Wrote: [ -> ]I cant upload files??????................

No uploads allowed, please use some kind of imagepaste service.

(2017-11-14 11:01)MikhailCompo Wrote: [ -> ]Error is "Could not boot image: No such file or directory"

That's not the full error message, all errors from iPXE has an url to ipxe.org, always include it.

Error 2d02808e
Code:
choose --default exit --timeout 30000 target && goto $

The
Code:
&& goto $
is probably bollixing this. The goto points to an undefined variable.

Try something like
Code:
|| exit
...

With any scripting language which doesn't have an IDE or ISE and particularly with "goto" which invites "spaghetti code", the echo command can be a very useful tool help debug where in the script you are having issues:

Code:
set boot-url http://${next-server}
echo ${boot-url}

# Set Menu Timeout
set menu-timeout 5000
set submenu-timeout ${menu-timeout}
echo ${submenu-timeout}

etc...
(2017-11-15 09:19)MikhailCompo Wrote: [ -> ]Error 2d02808e

Again post the full error message including the full link.
So http://ipxe.org/err/2d02808e

Also follow that link and read it after posting.
This helps both the poster, and anyone that finds this later having the same issue.

Thanks!

MultimediaMan awesome digging there, Thanks!
Reference URL's