Cli

From Syslinux Wiki
Jump to: navigation, search

Description

Syslinux's boot prompt provides a very simplistic command line interface for loading modules and booting kernels.

Keystrokes

The command line prompt supports the following keystrokes:

  [Enter]                Boot specified command
  [BackSpace]            Erase one character back
  [Ctrl-U]               Erase whole command
  [Ctrl-V]               Display current Syslinux version
  [Ctrl-W]               Erase one word back
  [Ctrl-X]               Force text mode
  [Tab]                  List matching labels
  [F1]..[F12]            Display "help" screens (if configured)
  [Ctrl-F][digit]        Equivalent to F1..F10
  [Ctrl-C]               Interrupt boot in progress
  [Esc]                  Interrupt boot in progress
  [Ctrl-N]               Display network info [PXELINUX 3.50-4.xx only]

Additional keystrokes that are supported since version 5.00:

  [Del]                  Erase one character forward
  [Ctrl-K]               Erase text from cursor till end of command

  [Ctrl-L]               Clear screen

  [Ctrl-R]               "reverse-i-search" mode

  Arrows: 
  [left]|[right]         move cursor one position
  [up]|[down]            move through command history
  [Ctrl-B]               Equivalent to [left]
  [Ctrl-F]               Equivalent to [right]
  [Ctrl-P]               Equivalent to [up]
  [Ctrl-N]               Equivalent to [down]
  
  [Home]                 Move cursor to beginning of command
  [End]                  Move cursor to end of command
  [Ctrl-A]               Equivalent to [Home]
  [Ctrl-E]               Equivalent to [End]
  
  [Ctrl-J]               Equivalent to [Enter]
  [Ctrl-M]               Equivalent to [Enter]
  [Ctrl-D]               Equivalent to [Del]
  [Ctrl-H]               Equivalent to [Backspace]
  [Ctrl-I]               Equivalent to [Tab]


Configuration location and name

Note: In the following paragraphs, the "/" directory represents the root of the filesystem in which Syslinux (in its several variants) is (going to be) installed.


BIOS

SYSLINUX / EXTLINUX default to searching for the config file in the installed directory (containing ldlinux.sys or extlinux.sys).

[3.35+] SYSLINUX also searches for the config file in "/boot/syslinux/", "/syslinux/" and "/", in this order.

The first configuration file that is found stops the search and the configuration file is parsed / used.

[-3.xx] SYSLINUX uses syslinux.cfg as config file name. EXTLINUX (merged into SYSLINUX as of 4.00) used extlinux.conf.

[4.00+] In each searched-for directory, SYSLINUX searches first for extlinux.conf and then for syslinux.cfg before falling back to the next directory.

[-4.02] ISOLINUX uses isolinux.cfg as config file name, searching first in "/boot/isolinux/" [2.00+] , then in "/isolinux/" and then in "/".

[4.03+] ISOLINUX searches for isolinux.cfg and then for syslinux.cfg in "/boot/isolinux/" before searching for the same files in "/isolinux/", "/boot/syslinux/", "/syslinux/", and "/", in this order.


Since version 4.03, the resulting behavior is that the same "/[[boot/]syslinux/]syslinux.cfg" file can optionally be used for SYSLINUX / EXTLINUX / ISOLINUX, while specific isolinux.cfg and/or extlinux.conf files would take precedence if present.

Since version 4.03, the resulting behavior is that any of the respective config files (or even all of them) — namely isolinux.cfg, and/or extlinux.conf, and/or syslinux.cfg — can optionally be located together in the same "/[[boot/]syslinux/]" directory.


UEFI

SYSLINUX defaults to searching for the configuration file in the installed directory, where syslinux.efi is located and containing also its corresponding ldlinux.* " file.

[6.04+] In each searched-for directory, SYSLINUX searches first for either:

  • syslia32.cfg when booting in EFI_ia32 mode
  • syslx64.cfg when booting in EFI_x64 mode

and finally SYSLINUX searches for syslinux.cfg before falling back to the next directory.

The first configuration file that is found stops the search and the configuration file is parsed / used.

Note that syslinux.efi could be optionally renamed.


Working directory

Note: In the following paragraphs, the "/" directory represents the root of the filesystem in which Syslinux (in its several variants) is (going to be) installed.


When booting, the initial working directory for SYSLINUX / ISOLINUX will be the directory containing the initial configuration file.


[-4.xx] If no initial configuration file is found, then SYSLINUX / EXTLINUX / ISOLINUX defaults to "/".

[5.00+] If no initial configuration file is found, then SYSLINUX / ISOLINUX defaults to the install-time working directory (where " ldlinux.* " is located).


When booting, the initial working directory for PXELINUX will be the parent directory of pxelinux.0 unless overridden with DHCP option 210. If no configuration file is found, then PXELINUX will start a timer to reboot the system in an attempt to restart the boot process and resolve a possible transient issue.


All (paths to) file names inside the configuration file are relative to the Working Directory, unless preceded with a slash. This is also valid for the command line interface.


Path rules

The objective of the PATH directive is to search for c32 library modules, which are dependencies of other c32 modules. Since there is no absolute distinction between "main" c32 modules and "library" modules, the PATH directive applies to all c32 modules, and only to them.

The PATH directive is not a replacement for using actual paths in the configuration file. With the introduction of c32 dependencies (or "library modules"), there is a need to tell the main modules where to search for their respective dependencies, according to the directory structure that the user sets up.

The current working directory (CWD) is always searched first, before PATH, when attempting to open a file name. The CWD is not affected when specifying a file with an absolute path. For example, given the following file system layout,

  /boot/
    	/bin/
      		ls.c32
      		libls.c32
    	/foo/
      		libls.c32

assuming that the current working directory is /boot/foo, and assuming that libls.c32 is a dependency of ls.c32, then executing /boot/bin/ls.c32 will cause /boot/foo/libls.c32 to be loaded, not /boot/bin/libls.c32, even if /boot/bin is specified in the PATH directive of a configuration file.

The reason that things work this way is that typically a user will install all library files in the Syslinux installation directory, as specified with the "--directory" installer option. This method allows users to omit the PATH directive from their configuration file and still have things work correctly.


Alternate file names

For kernel-like file names given on the command line, Syslinux will attempt to append file name extensions to the specified file name when the file is not found, in the following order:

  .0     [PXELINUX only]
  .bin   [ISOLINUX only]
  .bs    [SYSLINUX only]
  .bss   [SYSLINUX only]
  .c32
  .cbt   [-4.xx]
  .com   [-4.xx]
  .img   [ISOLINUX 1.65-4.04 only]

This feature is valid when typing commands directly in the CLI. In the Syslinux configuration file, this feature is valid for kernel-like directives for corresponding file name extensions.

For example, let's assume that a file named "ls" (without file name extension) does not exist, and that ls.c32 is present and that the config file includes:

  LABEL mylabel
  COM32 ls

Note that the above command lacks file name extension, i.e. ls.c32.

Then typing in mylabel (or executing it from a boot menu) will effectively find and launch ls.c32, since the COM32 directive expects this type of files (.c32 modules) and the ls file name (without extension) is not present.

In the above example, changing from "COM32 ls" to "KERNEL ls" will not find ls.c32, as the KERNEL directive is generic and does not expect a specific file type. In this case, typing in mylabel (or executing it from a boot menu) will not find ls.c32.

In either case, when executing ls (without file name extension) in the CLI, Syslinux will try first to find the exact file name as typed in, ls (without extension), and if it is not found then Syslinux will search for a matching file according to the above list of file name extensions, in the specified order.

Conversely, renaming the ls.c32 file to ls (without file name extension) will not accomplish the desired result; executing ls (without file name extension) will fail. Syslinux modules are expected to have a .c32 file name extension.

The purpose of this feature is to ease typing commands in the Syslinux CLI. It is recommended to use full names in the configuration file.


See also