grub4dos icon indicating copy to clipboard operation
grub4dos copied to clipboard

grubefi - add 'shell' command to run UEFI shell?

Open steve6375 opened this issue 4 years ago • 12 comments

Useful if booted via grub2 or other efi loader. Can go straight to UEFI shell.

steve6375 avatar Aug 03 '21 09:08 steve6375

to run UEFI shell

Which "uefi shell" to run? Is it the one that is embedded in the UEFI firmware or where?

a1ive avatar Aug 03 '21 11:08 a1ive

yes - embedded UEFI shell if possible. same as 'shell' command in grubfm?

steve6375 avatar Aug 03 '21 12:08 steve6375

No. shell.mod in grub2 comes with a UEFI Shell application. https://raw.githubusercontent.com/a1ive/grub/master/include/grub/i386/efi/shell_efi.h There is no way for an external program to load the built-in shell unless it is set as a startup item (Boot####) in the UEFI settings page.

a1ive avatar Aug 03 '21 12:08 a1ive

Is there a way to boot the shell.efi ? https://github.com/tianocore/edk2/blob/UDK2018/ShellBinPkg/UefiShell/X64/Shell.efi It does not seem to work using chainloader...

steve6375 avatar Aug 09 '21 09:08 steve6375

https://github.com/tianocore/edk2/blob/UDK2018/ShellBinPkg/UefiShell/X64/Shell.efi

chainloader /boot/Shell.efi
boot

works on VmWare Player.

a1ive avatar Aug 09 '21 11:08 a1ive

I tested on VBox 5 and IdeaPad 300.

  1. UEFI64 boot to a1ive grubfm
  2. boot to bootx64.efi of grub4efi from grubfm
  3. then run chainloader shell.efi from grub4efi shell it just returns back to command line...

steve6375 avatar Aug 09 '21 12:08 steve6375

On Asus Z87 PC. both grubfm and grub4efi try to run it and then hang. grub4efi actually shows the device list output by the efi shell console but then hangs. Seems like the shell.efi code is rather fussy...?

steve6375 avatar Aug 09 '21 12:08 steve6375

On Asus Z87 PC. both grubfm and grub4efi try to run it and then hang. grub4efi actually shows the device list output by the efi shell console but then hangs.

do not use graphical mode. switch to text mode (terminal_output console) before chainloading shell.efi.

Seems like the shell.efi code is rather fussy...?

Yes.

a1ive avatar Aug 09 '21 12:08 a1ive

Thanks! Seems to work for grubfm. But how do we switch back to pure console mode for grub4efi once we are in graphics mode? I tried graphicsmode 3 but that didn't help. also terminal console command any suggestions?

steve6375 avatar Aug 09 '21 12:08 steve6375

I don't know either.

a1ive avatar Aug 09 '21 13:08 a1ive

it works if I put commands in main menu.lst for grub4efi. So I need to undo the graphicsmode change somehow...

steve6375 avatar Aug 09 '21 13:08 steve6375

I used graphicsmode -1 1024

and now it works!!!

steve6375 avatar Aug 09 '21 13:08 steve6375