
CP3005 – User Guide Rev. 1.8
// 109
The uEFI Shell commands are not case-sensitive. Each uEFI Shell command is provided with
a detailed online help that can be invoked by entering “<cmd> <space> <-?>” in the command
line. To display the uEFI Shell command list, enter <help> or <?> in the command line.
13.4.
uEFI Shell Scripting
13.4.1.
Startup Scripting
If the ESC key is not pressed and the timeout is run out, the uEFI Shell tries to execute some startup scripts
automatically. It searches for scripts and executes them in the following order:
1.
Kontron flash-stored startup script
2.
If there is no Kontron flash-stored startup script present, the uEFI-specified startup.nsh script is used. This
script must be located on the root of any of the attached FAT formatted disk drive.
3.
If none of the startup scripts is present or the startup script terminates, the default boot order is continued.
13.4.2.
Create a Startup Script
Startup scripts can be created using the uEFI Shell built-in editor edit or under any OS with a plain text editor of your
choice. To create a startup shell script, simply save the script on the root of any FAT-formatted drive attached to the
system. To copy the startup script to the flash use the kbootscript uEFI Shell command.
In case there is no mass storage device attached, the startup script can be generated in a RAM disk and stored in the
SPI boot flash using the kmkramdisk uEFI Shell command.
13.4.3.
Examples of Startup Scripts
13.4.3.1.
Automatic Booting from USB Flash Drive
Automatic booting is made from a USB flash drive, if present, otherwise the boot is made from the harddrive.
kboot -t usb-harddrive
kboot -t harddrive
If neither a USB flash drive nor a harddrive is present, the boot order is continued.
13.4.3.2.
Execute Shell Script on Other Harddrive
This example (startup.nsh) executes the shell script named bootme.nsh located in the root of the first detected disc
drive (fs0).
fs0:
bootme.nsh
13.4.3.3.
Enable Watchdog and Control PXE Boot
The uEFI Shell provides environment variables used to control the execution flow.
The following sample start-up script shows two uEFI Shell environment variables, wdt_enable and pxe_first, used
to control the boot process and the Watchdog.
echo -off
echo “Executing sample startup.nsh...”
if %wdt_enable% == “on” then