Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
scripting [2009/02/17 18:43] mcb30 imported from information cut from the HTTP boot page - originally by gluneau. |
scripting [2009/12/19 11:50] (current) sha0 Note about 'chain' command |
||
---|---|---|---|
Line 9: | Line 9: | ||
initrd http://etherboot.org/gtest/initrd.bz2 | initrd http://etherboot.org/gtest/initrd.bz2 | ||
boot | boot | ||
+ | |||
+ | or using the 'chain' command, this would be equivalent to: | ||
+ | |||
+ | #!gpxe | ||
+ | initrd http://etherboot.org/gtest/initrd.bz2 | ||
+ | chain http://etherboot.org/gtest/bz2bzImage root=100 | ||
or this will boot from iSCSI: | or this will boot from iSCSI: | ||
Line 15: | Line 21: | ||
sanboot iscsi:192.168.2.23::::iqn.1994-04.org.netbsd.iscsi-target:target1 | sanboot iscsi:192.168.2.23::::iqn.1994-04.org.netbsd.iscsi-target:target1 | ||
+ | |||
+ | === Embedded images === | ||
+ | gPXE normally fetches images over the network using TFTP, HTTP, iSCSI, or other network protocols. It is also possible to //embed// an image file inside gPXE and make it available without fetching over the network. | ||
+ | |||
+ | By embedding gPXE scripts, you can customize gPXE's behavior before its first network access. For example, static network configuration can be done by embedding a gPXE script. | ||
+ | |||
+ | Images are embedded when building gPXE with ''make'': | ||
+ | <code> | ||
+ | $ make EMBEDDED_IMAGE=../contrib/scripts/static.gpxe | ||
+ | </code> | ||
+ | |||
+ | This builds a gPXE image which executes the ''static.gpxe'' script on startup. The ''static.gpxe'' sample script works with QEMU's user network stack: | ||
+ | <code> | ||
+ | #!gpxe | ||
+ | ifopen net0 | ||
+ | set net0/ip 10.0.2.15 | ||
+ | set net0/netmask 255.255.255.0 | ||
+ | set net0/gateway 10.0.2.2 | ||
+ | set net0/dns 10.0.2.3 | ||
+ | kernel http://etherboot.org/gtest/gtest.gpxe | ||
+ | boot | ||
+ | </code> | ||
+ | |||
+ | Multiple images can be embedded: | ||
+ | <code> | ||
+ | $ make EMBEDDED_IMAGE=../contrib/scripts/gpxelinux.gpxe,/usr/lib/syslinux/pxelinux.0 | ||
+ | </code> | ||
+ | |||
+ | This builds a gPXE image which executes the ''gpxelinux.gpxe'' script on startup. The ''gpxelinux.gpxe'' script performs DHCP before loading the embedded ''pxelinux.0'' image and executing it: | ||
+ | <code> | ||
+ | #!gpxe | ||
+ | dhcp net0 | ||
+ | imgload img1 | ||
+ | boot | ||
+ | </code> | ||
+ | |||
+ | See the [[:appnotes:autobootchainurl|patched autoboot invocation]] for cases when the right interface to boot need to be found automatically. | ||
+ | |||
+ | see [[soc/2008/stefanha/journal/week8#sat_19_2008|Stefanha's Summer of Code 2008 Week 8 journal]] |