Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iPXE keeping state
2013-05-16, 00:47
Post: #1
iPXE keeping state
I'm very new at iPXE so please bear with me if this question is silly. I have a machine where the BIOS boot order is set to network,HDD. I'm using iPXE to boot and install an OS but at the end of the installation, the OS requires a restart. When it comes back up, it again gets into iPXE and launches a reinstall, hence an infinite loop. Is there a way to have iPXE keep state, say a counter so the second request will boot the hard drive instead of the .ipxe script that loads the installer? There is no interaction in the system.

Thanks in advance!
Find all posts by this user
Quote this message in a reply
2013-05-16, 13:16
Post: #2
RE: iPXE keeping state
If you want all this to happen without user intervention, then the only way is to use some form of server-side method to keep state. iPXE itself isn't capable of storing any state (unless you have one of those very rare network cards that can store information in NVRAM). If you use my menu example, https://gist.github.com/robinsmidsrod/2234639, you can create a script in the bootstrap/ folder after the hostname, uuid or mac of the machine in question. Since the default in that menu is to exit and perform a local boot, you only need create that override script whenever you need to install the machine, and when you're done with that, you can remove that file again.

If you don't need fully automated, then you can just use the menu more-or-less as-is and just choose the install option in the menu when required, and it will by default just exit and start the OS. At home I have all machines setup to boot from network by default, and for most of them I just fall-through and boot local after 5 seconds. It does make the boot a little slower, but it's not a big problem (for me).

If you don't like to keep this state in a script file, you can create the menu dynamically using a scripting language like PHP, Perl or Python. Then you can keep the state of what option to boot in whatever way you want.

If you want it fully automated, you'll need to modify the Windows installer image to notify your boot server after a successful installation. This could be something as simple as putting a file with a special name in a special location on one of your file servers that is checked during the boot process. If the file exists and contain e.g. the word "SUCCESS" then you should no longer boot the installer, but just exit and continue local boot.
Visit this user's website Find all posts by this user
Quote this message in a reply
2013-05-20, 19:13
Post: #3
RE: iPXE keeping state
okay thanks. I'll put the logic in the script.
Find all posts by this user
Quote this message in a reply
2013-05-21, 19:05
Post: #4
RE: iPXE keeping state
(2013-05-20 19:13)dynamyte Wrote:  okay thanks. I'll put the logic in the script.

You may want to investigate the prompt command, which would allow your script to include code such as:

Code:
prompt --key 0x197e --timeout 2000 Press F12 to install... && goto install || exit

Michael
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)