4.27.2.1. Using a Startup Script

4.27.2.1. Using a Startup Script

It is recommended that you configure the ELILO Boot Manager to boot Red Hat Enterprise Linux automatically. However, if you require additional commands to be executed before starting the ELILO boot loader, you can create a startup script named startup.nsh. The last command should be elilo to boot into Linux.

The startup.nsh script should be in the /boot/efi partition (/boot/efi/startup.nsh) and contain the following text:

echo -off your set of commands elilo

If you want to pass options to the boot loader (refer to Section 4.27.1, “Post-Installation Boot Loader Options”) add them after elilo.

You can either create this file after booting into Red Hat Enterprise Linux or use the editor built into the EFI shell. To use the EFI shell, at the Shell> prompt, change devices to the system partition (mounted as /boot/efi in Linux). For example, if fs0 is the system boot partition, type fs0: at the EFI Shell prompt. Type ls to make sure you are in the correct partition. Then type edit startup.nsh. Type the contents of the file and save it.

The next time the system boots, EFI detects the startup.nsh file and use it to boot the system. To stop EFI from loading the file, type Ctrl-c . This aborts the process, and returns you to the EFI shell prompt.


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.