This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
cmd:chain [2015/08/14 00:13]
cmd:chain [2021/02/15 16:46] (current)
Line 3: Line 3:
 ===== Synopsis ===== ===== Synopsis =====
-    chain [--name <​name>​] [--timeout <​timeout>​] [<​uri|image>​] [<​arguments>​...]+    chain [--name <​name>​] [--timeout <​timeout>​] ​[--autofree] [--replace] 
 +          ​[<​uri|image>​] [<​arguments>​...]
 or or
-    imgexec [--name <​name>​] [--timeout <​timeout>​] [<​uri|image>​] [<​arguments>​...]+    imgexec [--name <​name>​] [--timeout <​timeout>​] ​[--autofree] [--replace] 
 +            ​[<​uri|image>​] [<​arguments>​...]
 or or
-    boot [--name <​name>​] [--timeout <​timeout>​] [<​uri|image>​] [<​arguments>​...]+    boot [--name <​name>​] [--timeout <​timeout>​] ​[--autofree] [--replace] 
 +         [<​uri|image>​] [<​arguments>​...]
Line 28: Line 31:
     initrd http://​​initrd.img     initrd http://​​initrd.img
     chain http://​​vmlinuz vga=788 console=ttyS0,​115200n8 console=tty0     chain http://​​vmlinuz vga=788 console=ttyS0,​115200n8 console=tty0
 +=== Download, run, and automatically free a menu script ===
 +    chain --autofree http://​​scripts/​menu.ipxe
 +=== Terminate the current script and run a new script ===
 +    chain --replace http://​​scripts/​script.ipxe
 === Boot the currently-selected image === === Boot the currently-selected image ===
Line 49: Line 60:
 then iPXE will download and boot ''​%%http://​boot.ipxe.org/​demo/​pxelinux.0%%''​. then iPXE will download and boot ''​%%http://​boot.ipxe.org/​demo/​pxelinux.0%%''​.
 +If the ''​%%--autofree%%''​ option is specified then the image will be freed automatically after terminating. ​ Otherwise, the image will remain present and can be freed using ''​[[:​cmd:​imgfree]]''​.
 +If the ''​%%--replace%%''​ option is specified then the image will replace the currently executing script (similar to the Unix ''​exec()''​ system call). ​ Otherwise, the current script will continue execution once the image returns.
 ===== Command status ===== ===== Command status =====
Line 68: Line 84:
 There is no difference between the commands ''​chain'',​ ''​imgexec''​ and ''​boot''​. There is no difference between the commands ''​chain'',​ ''​imgexec''​ and ''​boot''​.
 +If your script will exit immediately after the ''​chain''​ command then you can use the ''​%%--replace%%''​ option to minimise memory usage.
 +If you have a series of scripts that jump to each other and do not ever return (such as a menu system implemented as several separate iPXE script files) then you can use both ''​%%--autofree%%''​ and ''​%%--replace%%''​ to avoid running out of memory.
 ===== Backwards compatibility ===== ===== Backwards compatibility =====
cmd/chain.1439511190.txt.gz · Last modified: 2015/08/14 00:13 by mcb30
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Driven by DokuWiki
All uses of this content must include an attribution to the iPXE project and the URL https://ipxe.org
References to "iPXE" may not be altered or removed.