3 uefi shell scripting, 1 startup scripting, 2 create a startup script – Kontron AM4020 uEFI BIOS User Manual
Page 60: 3 examples of startup scripts, Uefi shell scripting, Startup scripting, Create a startup script, Examples of startup scripts, Automatic booting from usb flash drive, Execute shell script on other harddrive
The uEFI Shell
AM4020 uEFI BIOS
Page 54
ID 1036-5670, Rev. 3.0
P R E L I M I N A R Y
6.3
uEFI Shell Scripting
6.3.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 any of the attached FAT formatted disk drives
under \efi\boot\startup.nsh.
3. If none of the startup scripts is present or the startup script terminates, the default boot
order is continued.
6.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 shell script, simply save the script on any
FAT-formatted drive attached to the system under the file name \efi\boot\startup.nsh.
To copy the startup script to the flash use the kbootnsh 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 flash bank.
6.3.3
Examples of Startup Scripts
6.3.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.
If neither a USB flash drive nor a harddrive is present, the boot order is continued.
6.3.3.2
Switch On Clock Spreading Prior to Booting from Harddrive
If no harddrive is present, the default order is continued.
6.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).
kboot -t usb-harddrive
kboot -t harddrive
kclsp -e
kboot -t harddrive
fs0:
bootme.nsh