Current working directory URI setting

Name

  cwduri

Details

Type String
DHCP option number not applicable
ISC dhcpd syntax not applicable

Examples

Show script's own URI

  #!ipxe
  
  echo This script was loaded from ${cwuri}
  echo This script is in the directory ${cwduri}

Boot Fedora installer

  #!ipxe
  
  kernel images/pxeboot/vmlinux inst.repo=${cwduri}
  initrd images/pxeboot/initrd.img
  boot

Description

Represents the directory portion of the current working URI, i.e. the base URI relative to which any relative URIs will be resolved.

See also

Notes

When executing an iPXE script, the current working URI is set to the URI of the script itself. This allows the script to download subsequent files using relative paths, which will be interpreted as being relative to the script's own URI.

You can use the cwduri setting to construct URI strings that can be passed to the booted operating system via its own command line. For example, suppose that you have a web server containing a Fedora distribution mirror, and a script that allows the user to select a version to be installed:

  #!ipxe
  
  menu Select Fedora version
  item 38 Fedora 38
  item 39 Fedora 39
  item 40 Fedora 40
  choose fedver
  
  set repo ${cwduri}/releases/${fedver}/Everything/x86_64/os
  kernel ${repo}/images/pxeboot/vmlinux inst.repo=${repo}
  initrd ${repo}/images/pxeboot/initrd.img
  boot
cfg/cwduri.txt ยท Last modified: 2024/03/19 14: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.