Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cmd:chain [2014/03/10 13:53]
mcb30
cmd:chain [2021/02/15 16:46] (current)
mcb30
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 27: Line 30:
  
     initrd http://​192.168.0.1/​initrd.img     initrd http://​192.168.0.1/​initrd.img
-    chain http://​192.168.0.1/​vmlinuz vga=788+    chain http://​192.168.0.1/​vmlinuz vga=788 ​console=ttyS0,​115200n8 console=tty0 
 + 
 +=== Download, run, and automatically free a menu script === 
 + 
 +    chain --autofree http://​10.0.0.1/​scripts/​menu.ipxe 
 + 
 +=== Terminate the current script and run a new script === 
 + 
 +    chain --replace http://​10.0.0.1/​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.1394459581.txt.gz · Last modified: 2014/03/10 13:53 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.