iPXE keeping state - Printable Version +- iPXE discussion forum (https://forum.ipxe.org) +-- Forum: iPXE user forums (/forumdisplay.php?fid=1) +--- Forum: General (/forumdisplay.php?fid=2) +--- Thread: iPXE keeping state (/showthread.php?tid=6913) |
iPXE keeping state - dynamyte - 2013-05-16 00:47 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! RE: iPXE keeping state - robinsmidsrod - 2013-05-16 13:16 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. RE: iPXE keeping state - dynamyte - 2013-05-20 19:13 okay thanks. I'll put the logic in the script. RE: iPXE keeping state - mcb30 - 2013-05-21 19:05 (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 |