Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPXE as a chain-load target
2013-10-16, 09:56
Post: #1
iPXE as a chain-load target
So the plan is:

1 - Start GRUB2 over PXE as my initial booloader (to give me the whizzy graphics), using a script-generated config file based on a folder of ISOs

2 - When an entry is selected, chain-load iPXE (for the sanboot capability)

3 - Chain-load (via sanboot or memdisk) the required ISO

All good in theory, but the documentation doesn't suggest any way to pass parameters into iPXE other than via DHCP.

My current thinking is to roll a custom TFTP server and undionly hard-wired to run a script from that server. I can then embed the ISO name or index into the chain-load path (e.g. tftp://myserver/path/undionly?iso=hiren.iso) and reuse it when the script is requested (e.g. tftp://mysever/path/dynscript.ipxe)

The TFTP server would then return undionly and remember the iso param from this request (keyed to the asking IP or MAC). When asked for the hard-coded script from the same IP it would use the retained param to return a script that proceeded directly into a sanboot of the requested ISO.

This is a bit easier than my original idea of implementing an http module for GRUB2, but it's still a fairly involved solution!

So my question: Is there an easier way to pass parameters directly into iPXE when chain-loading it from GRUB2? I could then use an off-the-shelf TFTP implementation and my server-side logic would be restricted to generating the grub config file.
Find all posts by this user
Quote this message in a reply
2013-10-20, 10:00
Post: #2
RE: iPXE as a chain-load target
This is what the "scriptlet" feature does for you. You can load ipxe.lkrn just like any other Linux kernel from grub, and you can specify a command line. The command line is basically a mini-ipxe-script. The most common way to use this feature is like this:

Code:
# Syslinux syntax, can't recall grub syntax
KERNEL ipxe.lkrn
APPEND dhcp && chain http://myserver/boot.ipxe

If you're want to just boot a custom script for each type of ISO you have, then you could do something like this:

Code:
# Syslinux syntax, can't recall grub syntax
KERNEL ipxe.lkrn
APPEND dhcp && chain http://myserver/hiren.ipxe

or you could let boot.ipxe use a variable to boot everything using one script, like this:

Code:
# Syslinux syntax, can't recall grub syntax
KERNEL ipxe.lkrn
APPEND dhcp && set cd hiren && chain http://myserver/boot.ipxe
# in boot.ipxe
sanboot ${cd}.iso
Visit this user's website Find all posts by this user
Quote this message in a reply
2013-10-20, 13:54
Post: #3
RE: iPXE as a chain-load target
So I moved to lpxelinux 6.02. It doesn't quite get me the theming I was after from grub2, but the vesamenu support is "good enough" for now.

I can't get any response from ipxe at all, and no mention of the iso in my http server logs.
Despite trying almost every possible permutation of:
- loading ipxe.lkrn from TFTP
- loading ipxe.lkrn from HTTP (possible with lpxelinux)
- direct to sanboot from the syslinux config: "APPEND dhcp && sanboot http://server/hiren.iso"
- direct-to-shell from the syslinux config: "APPEND shell"
- putting the sanboot command in an ipxe script
- trying the script both with and without the "#!ipxe" header
- trying the script both with and without "dhcp"
- trying the syslinux config both with and without "dhcp &&"
Find all posts by this user
Quote this message in a reply
2013-10-22, 10:06
Post: #4
RE: iPXE as a chain-load target
Syslinux 6.x has some issues with iPXE. You should use a version of syslinux older than v6 until it has been resolved.
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)