This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
scripting [2011/05/26 09:49] mcb30 |
scripting [2011/12/02 21:35] mcb30 |
||
---|---|---|---|
Line 98: | Line 98: | ||
===== Advanced topics ===== | ===== Advanced topics ===== | ||
+ | |||
+ | {{ :clipart:bootroms.jpeg?350x190|Some PXE ROMs}} | ||
+ | |||
+ | ==== Embedded scripts ==== | ||
+ | |||
+ | You can [[:embed]] a script within iPXE to override its default behaviour. For example, you may wish to build a version of iPXE containing an [[:embed|embedded script]] that uses DHCP to obtain an IP address but then boots from a predefined SAN target. | ||
==== Dynamic scripts ==== | ==== Dynamic scripts ==== | ||
Line 115: | Line 121: | ||
set initiator-iqn iqn.2010-04.org.ipxe:BKQ42M1 | set initiator-iqn iqn.2010-04.org.ipxe:BKQ42M1 | ||
sanboot iscsi:192.168.0.20::::iqn.2010-04.org.ipxe:winxp | sanboot iscsi:192.168.0.20::::iqn.2010-04.org.ipxe:winxp | ||
- | |||
- | {{ :clipart:bootroms.jpeg?350x190|Some PXE ROMs}} | ||
- | |||
- | ==== Embedded scripts ==== | ||
- | |||
- | You can embed a script within iPXE to override its default behaviour.((When you embed a script, you will no longer see the "Press Ctrl-B for the iPXE command line" prompt at startup or if booting fails. If you wish, you can provide your own replacement prompt using the ''[[:cmd:prompt]]'' command.)) For example, if you want to obtain an IP address using DHCP but then always boot from a fixed URL (ignoring any boot filename provided by DHCP), then you could embed a script such as: | ||
- | |||
- | #!ipxe | ||
- | | ||
- | dhcp | ||
- | chain http://bootserver/boot.php?asset=${asset} | ||
- | |||
- | To embed this script within iPXE, add ''EMBED=<script>'' when you [[:download|build]] iPXE. For example, to embed a script saved as ''myscript.ipxe'' into a [[:howto:chainloading|chainloadable]] iPXE image: | ||
- | |||
- | make bin/undionly.kpxe EMBED=myscript.ipxe | ||