3 uefi shell scripting, 1 startup scripting, 2 create a startup script – Kontron AM5030 uEFI User Manual
Page 68: 3 examples of startup scripts, 1 automatic booting from usb memory stick, 3 execute shell script on other harddrive, Uefi shell scripting, Startup scripting, Create a startup script, Examples of startup scripts
The uEFI Shell
AM5030 uEFI BIOS
Page 62
ID 1037-1209, Rev. 1.0
P R E L I M I N A R Y
8.3
uEFI Shell Scripting
8.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.
8.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.
8.3.3
Examples of Startup Scripts
8.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.
8.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.
8.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).
fs0:
bootme.nsh