Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Load menu.ipxe onto iPXE usb image?
2013-04-10, 23:40 (This post was last modified: 2013-04-11 01:49 by stefanlasiewski.)
Post: #1
Load menu.ipxe onto iPXE usb image?
I built ipxe.usb and I copied the image to the USB drive at /dev/sdb . When the servers boot from USB, I can see iPXE.

Code:
stefanl@sl6:~/src/ipxe/src $ make
stefanl@sl6:~/src/ipxe/src $ sudo su -c "cat bin/ipxe.usb > /dev/sdb"

I would like to make use of iPXE scripts like `menu.ipxe` and `bootstrap.ipxe`, which are mentioned elsewhere in this forum.

-= Stefan
Visit this user's website Find all posts by this user
Quote this message in a reply
2013-04-11, 21:34 (This post was last modified: 2013-04-11 21:47 by MultimediaMan.)
Post: #2
RE: Load menu.ipxe onto iPXE usb image?
The nice thing about the USB/Disk Based iPXE is that you can embed a large *.ipxe script into it. Unfortunately, you can't embed anything past that and expect to use it usefully.

So, you can build an embedded menu, but the any names/ addresses referenced in the embedded menu would have to be present on the network it was booted up on. You can make use of many iPXE/DHCP Option variables to make the menu useful as long as the directory structure/naming convention was followed.

Take for instance two sites: A correctly configured DNS Server, a DHCP server, and a webserver are at each location. The Webserver at site "a" is 192.168.0.12 and is named http://www.webserver.site-a.myplace.com, and the Webserver at site "b" is 192.168.59.12 and is named http://www.webserver.site-b.myplace.com.

"Really Bad" Embedded Code Example 1:

Code:
#!ipxe
set path http://192.168.0.12
chain ${path}/bootme.ipxe

"Bad" Embedded Code Example 2:

Code:
#!ipxe
set path http://www.webserver-a.site-a.myplace.com
chain ${path}/bootme.ipxe

"Good" Embedded Code Example:

Code:
#!ipxe
set path ${17}
chain ${path}/bootme.ipxe

The variable in both cases is ${path}, but in the "bad" examples it is hardcoded to a specific IP Address or a fixed name.

In the good example path is aliased to DHCP Option 17 (root-path); and is whatever the DHCP server says it is. Thus if you are at site "a" and have a correctly configured webserver and DHCP server, your embedded script will work as long as the Root-Path (DHCP option 17) is set, and the DHCP server has the file in the same relative location.

"Good" Example Explanation and Detail:

At site "a" the root path is http://www.webserver.site-a.myplace.com and the webserver has bootme.ipxe in the root directory.

At site "b" the root path is http://www.webserver.site-b.myplace.com and the webserver has bootme.ipxe in the root directory.

Your "Good" embedded script would work at either location. Whereas the "bad" script would only work on a network with a webserver at 192.168.0.12

A "Better" Example to think about:

At site "a" and "b" the root path is http://www.webserver and the DNS suffix (DHCP Option 15) is then used in the embedded script like this:

Code:
#!ipxe
set path ${17}
chain ${path}.${15}/bootme.ipxe

To create an embedded script in USB/Disk based image is easy: create the script, and embed it using the following syntax:

Code:
make /bin/ipxe.usb EMBED=menu.ipxe

You can only embed one script into iPXE.

Does this help?

M^3

"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
2013-04-12, 01:12
Post: #3
RE: Load menu.ipxe onto iPXE usb image?
(2013-04-11 21:34)MultimediaMan Wrote:  So, you can build an embedded menu, but the any names/ addresses referenced in the embedded menu would have to be present on the network it was booted up on. You can make use of many iPXE/DHCP Option variables to make the menu useful as long as the directory structure/naming convention was followed.

Ah, this would be for the occasions when a DHCP server is not available. My hope is to use a menu.ipxe to be served of of the network-boot servers, and use that same menu.ipxe on a thumbdrive for the occasion when the DHCP server is not available. This would simplify things-- one script, one procedure.

(2013-04-11 21:34)MultimediaMan Wrote:  Does this help?

Absolutely. Thank you.
Visit this user's website Find all posts by this user
Quote this message in a reply
2013-04-12, 01:22 (This post was last modified: 2013-04-12 01:23 by MultimediaMan.)
Post: #4
RE: Load menu.ipxe onto iPXE usb image?
OK, now it's more clear: you want more of a "Boot disk" version of iPXE... but not having a DHCP Server is somewhat problematic for creating scripts and naming variables, but there are workarounds.

Consider: ipxe.usb is essentially ipxe.lkrn for USB/Disk. So any drivers embedded into iPXE... which means that net0 might not be "net0" if there are multiple NICs in the system.

a) Creating a menu to dump all of the Interfaces/NICs/MACs might be beneficial.

b) Create a submenu to select and set an IP address to an interface might also be a good idea.

Basically, you could make iPXE Menu version of Redhat's 'system-config-network' TUI - and that would be very cool indeed. Because config is kinda clunky.

"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
2013-04-12, 15:50 (This post was last modified: 2013-04-12 15:50 by robinsmidsrod.)
Post: #5
RE: Load menu.ipxe onto iPXE usb image?
Stefan: You might like this embedded script that is designed to let you interactively choose which network adapter to boot via DHCP. https://gist.github.com/robinsmidsrod/3871687

Use the same method mentioned above to embed it into the iPXE binary you would like to use.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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