First off, this is only my first week working on this new format so I’m not an expert, but I am having fun cracking it.
- On your Fog Server Web interface go to: Fog Configuration
- Select: FOG PXE Boot Menu Configuration
- Expand: Advanced Configuration Option
You will get an empty text entry box.
- Add the following text:
menu
item --gap – ------------- Advanced Menu --------------
item RETURN Return to the Top Menu
choose --default RETURN --timeout 30000 target && goto ${target}
:RETURN
boot [URL]http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac[/URL]} ||
prompt
goto MENU
autoboot
[/CODE]
- Let’s tear this text apart using the reference at [url]http://ipxe.org/cmd[/url]:
- The script label. A reference pointer you can “GOTO”. In this case it is called “MENU”
Bmenu[/B]
- COMMAND: Create a menu with the specified name and title. If no name is specified, the default (unnamed) menu will be created.
Bitem --gap – ------------- Advanced Menu --------------[/B]
- COMMAND: Add a menu ITEM with the specified label and display text.
- OPTION: Add a menu separator. If the --gap option is specified, the menu item will function as a menu separator (which cannot be selected by the user).
- OPTION: The double dashes prevent iPXE from interpreting the dashes used in the readable display text of “------------- Advanced Menu --------------” as an option.
B------------- Advanced Menu --------------[/B]
- DISPLAYTEXT: The readable display text I assigned to this menu item
Bitem RETURN Return to the Top Menu[/B]
- COMMAND: Add a menu ITEM with the specified label and display text.
- OPTION: the script label (RETURN) that will be run if you select it.
- DISPLAYTEXT: The readable display text I assigned to this menu item
Bchoose --default RETURN --timeout 30000 target && goto ${target}[/B]
- COMMAND (and many options): In 30000 milliseconds (30 seconds) the iPXE Menu will by default CHOOSE to go to the script label RETURN.
Bboot [URL=‘http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac’][U][COLOR=#0066cc]http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac[/COLOR][/U][/URL]} ||[/B]
Bprompt[/B]
Bgoto MENU[/B]
- The script label. A reference pointer you can “GOTO”. In this case it is called “RETURN”
- COMMAND (and many options): Download and BOOT an executable image
- COMMAND: PROMPT the user to press a key, displaying the specified text and waiting for the specified timeout (in milliseconds). If no timeout is explicitly specified, or if a zero timeout is specified, then iPXE will wait indefinitely.
- COMMAND: Jump to a script label. In this case “MENU”
Bautoboot[/B]
- COMMAND: Boot from a network interface. iPXE will open the first specified network interface and attempt to boot from it
- PXE boot a sample client and you will now see a new option at the bottom of the list “Advanced Menu”
- Select that option and you will now be directed to the very simple menu you just entered at #4.
- Now let’s add an ISO to boot from.
- Repeat Steps 1-3
- Add booting to a simple .ISO by making your entire text now look like:
menu
item --gap – ------------- Advanced Menu --------------
item WINPE50 Boot to a Windows PE 5.0 x86 (Win8.1)
item RETURN Return to the Top Menu
choose --default RETURN --timeout 30000 target && goto ${target}
:WINPE50
imgfetch [URL]http://${fog-ip}/iso/winpe50_x86.iso[/URL]
boot memdisk iso raw ||
goto MENU
:RETURN
boot [URL]http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac[/URL]} ||
prompt
goto MENU
autoboot
[/CODE]
- Let’s tear the added text apart using the reference at [url]http://ipxe.org/cmd[/url]:
Bitem PE50 Boot to a Windows PE 5.0 x86 (Win8.1)[/B]
- COMMAND: Add a menu (ITEM) with the SCRIPT LABEL (PE50) and display text (Boot to a Windows PE 5.0 x86 (Win8.1))
Bimgfetch [url]http://${fog-ip}/iso/winpe50_x86.iso[/url][/B]
Bboot memdisk iso raw ||[/B]
Bgoto MENU[/B]
- The script label (WINPE50)
- COMMAND: Download (IMGFETCH) an image from the specified URL ([url]http://${fog-ip}/iso/winpe50_x86.iso[/url])
- COMMAND: BOOT the currently selected image.
- if the first two COMMANDS fail somehow, GOTO the script label MENU all over again.
- Let’s expand that to include 3 more .ISOs and an iPXE shell!
menu
item --gap – ------------- iPXE Boot Menu -------------
item WINPE31 Boot PE 3.1 x86 (Win7)
item WINPE40 Boot PE 4.0 x86 (Win8.0)
item WINPE50 Boot PE 5.0 x86 (Win8.1)
item GANDALF32 Boot Gandalf’s PE 5.1 x86 (Win8.1u)
item SHELL iPXE Shell
item RETURN Return to the Top Menu
choose --default WINPE50 --timeout 30000 target && goto ${target}
:WINPE31
imgfetch [URL]http://${fog-ip}/iso/winpe31_x86.iso[/URL]
boot memdisk iso raw ||
goto MENU
:WINPE40
imgfetch [URL]http://${fog-ip}/iso/winpe40_x86.iso[/URL]
boot memdisk iso raw ||
goto MENU
:WINPE50
imgfetch [URL]http://${fog-ip}/iso/winpe50_x86.iso[/URL]
boot memdisk iso raw ||
goto MENU
:GANDALF32
imgfetch [URL]http://${fog-ip}/iso/Gandalf_Win8.1uPE_x86v3.iso[/URL]
boot memdisk iso raw ||
goto MENU
:SHELL
shell ||
goto MENU
:RETURN
boot [URL]http://${fog-ip}/${fog-webroot}/service/ipxe/boot.php?mac=${net0/mac[/URL]} ||
prompt
goto MENU
autoboot
[/CODE]
You will notice that where most people use chain, I use boot. Where others use initrd, I use imgfetch. If you go to [url]http://ipxe.org/cmd[/url] you’ll see that some commands have aliases that behave the exact same way. I prefer the command aliases I use simply because they appeal to my way of thinking and reading the language.
The commands IMGFETCH and BOOT seem to contraindicate or duplicate legacy methodology and confuses me a bit. I’m going to try some variants to clear this up for myself some more.
BTW, I store my .ISOs and any other iPXE menu-driven materials in /var/www/html/iso (Ubuntu). I think the Debian equivalent would be /var/www/iso .