3 uefi shell scripting, 1 startup scripting, 2 create a startup script – Kontron CP6002 uEFI BIOS User Manual
Page 72: 3 examples of startup scripts, Startup scripting, Create a startup script, Examples of startup scripts, Automatic booting from usb memory stick, Execute shell script on other harddrive, The uefi shell cp6002 uefi bios

The uEFI Shell
CP6002 uEFI BIOS
Page 66
ID 1039-1612, Rev. 2.0
7.3
uEFI Shell Scripting
7.3.1
Startup Scripting
If the ESC key is not pressed and the timeout is run out, either the Kontron flash-stored startup
is executed, if present, or the uEFI specified
startup.nsh
script located under
\efi\boot\
on any of the attached drives is executed. If none of the startup scripts is present, or the startup
script terminates, the default boot order is continued.
If the shell is started with no interaction, it tries to execute some startup scripts automatically.
It searches for scripts 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 any of the attached FAT formatted disk drives un-
der
\efi\boot\startup.nsh.
If both startup scripts are absent, the shell terminates and the default boot order is continued.
7.3.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.nsh
type shell script, simply save the
script on any FAT-formatted drive attached to the system under
\efi\boot\startup.nsh.
To create a Kontron flash-stored startup script, the script is to be saved anywhere on a FAT-
formatted drive attached to the system and stored to flash using the built-in uEFI Shell com-
mand kbootnsh.
7.3.3
Examples of Startup Scripts
7.3.3.1
Automatic Booting from USB Memory Stick
Automatic booting is made from a USB memory stick, if present, otherwise the boot is made
from the harddrive.
kboot -t usb-harddrive
kboot -t harddrive
If neither a USB memory stick nor a harddrive is present, the boot order is continued.
7.3.3.2
Switch On Clock Spreading Prior to Booting from Harddrive
kclsp -e
kboot -t harddrive
If no harddrive is present, the default order is continued.
7.3.3.3
Execute Shell Script on Other Harddrive
This example executes the shell script named
bootme.nsh
located in the root of the first de-
tected disc drive (
fs0
).
shell> fs0:
fs0:\> bootme.nsh