# UEFI Shell



## rrsum (Thursday at 10:19 PM)

I am confused about UEFI shells.  I think I understand the UEFI boot process, but I need to update a card using a UEFI flash process.  I'm on 13.1 amd64 with an ASUS motherboard.  The ASUS firmware has an option to boot to a UEFI shell.  Is loader.efi (which exists as /boot/efi/efi/boot/bootx64.efi, among other places) a UEFI shell or does it just function as a loader?  Do I need to download a UEFI shell and put it in /boot/efi/efi/boot/shellx64.efi? (or actually build a USB memstick with the same).

Can anyone explain all this, or point me to an explanation?

Thanks in advance.


----------



## richardtoohey2 (Thursday at 10:27 PM)

Not all UEFI systems have the shell.






						How to Use UEFI Interactive Shell and Its Common Commands
					

The newer generation UEFI motherboards come with UEFI Interactive Shell. The UEFI interactive shell is a simple shell program (like bash) responsible for booting your operating system. You can also use the UEFI interactive shell to run EFI shell commands and scripts. It can be used to update the...




					linuxhint.com
				




They can be useful if you have any unusual booting requirements but not something you’d probably need that often.


----------



## _martin (Thursday at 10:27 PM)

UEFI shell is a shell of a firmware (BIOS in PCs). It resembles a bit of a DOS prompt. It has nothing to do with any OS or their loaders.

Usually what you do is you boot to the prompt or you select to boot to this shell via BIOS menu. Once you are there you have few built-in commands to look around. `help` or alike command should give you a list. `map` gives you a map of devices.

But even if you do this blindly, let's say you have FAT32 USB key with all your firmware. Doing `fs0:` will try to "cd" to this FS. If not try fs1: and so on.
Once you changed to the USB you can execute whatever you need to upgrade the FW on the card. Almost always you have these commands in README or similar file attached to a fw.


----------



## Phishfry (Thursday at 11:14 PM)

Some flashers even use a script to execute the flashing under EFI.

startup.nsh
storcli.efi /c0 download file=HBA_9400-8i_Mixed_Profile.bin


----------



## rrsum (Thursday at 11:47 PM)

Okay, thanks a bunch for the replies, although at least one of my questions was not answered, but still very helpful.  Here are my take a ways:

1.  No, loader.efi is not a UEFI shell.  It just loads!
2.  A UEFI shell, at least on modern mobos, is provided by the mobo.
3. To update a UEFI card, put all the required data and UEFI flash programs on a USB in a FAT32 efi gpt partition, and reboot to the mobo UEFI shell.  Then flash the card!

Sound right?  And thanks again.


----------



## Phishfry (Thursday at 11:54 PM)

rrsum said:


> on a USB in a FAT32 efi gpt partition


MBR or GPT scheme will work. Type partition of FAT or EFI

startup.nsh is a startup script. It is used in alot of flashing programs.
It simplifies long commands.


----------



## SirDice (Yesterday at 10:19 AM)

rrsum said:


> A UEFI shell, at least on modern mobos, is provided by the mobo.


Not always included though, or may be an older version. But you can download a full UEFI shell here: https://github.com/tianocore/edk2/releases/
Save it on the efi partition, if you use rEFInd store it as EFI/Tools/Shellx64.efi then rEFInd will automatically detect it and you can start the shell from the rEFInd boot menu.


----------

