Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Server Variables Not Resolving Reliably
2017-11-13, 12:05
Post: #1
Server Variables Not Resolving Reliably
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)
Find all posts by this user
Quote this message in a reply
2017-11-13, 22:56
Post: #2
RE: Server Variables Not Resolving Reliably
Post the error message you get, if possible take a screenshot of iPXE downloading and then showing the error.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2017-11-14, 11:01
Post: #3
RE: Server Variables Not Resolving Reliably
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
Find all posts by this user
Quote this message in a reply
2017-11-14, 17:38
Post: #4
RE: Server Variables Not Resolving Reliably
(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.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
2017-11-15, 09:19
Post: #5
RE: Server Variables Not Resolving Reliably
(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
Find all posts by this user
Quote this message in a reply
2017-11-15, 13:59
Post: #6
RE: Server Variables Not Resolving Reliably
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...

"Thus far, you have been adrift within the sheltered harbor of my patience..."
Find all posts by this user
Quote this message in a reply
2017-11-15, 19:40
Post: #7
RE: Server Variables Not Resolving Reliably
(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!

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)