cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dave_os
Serial Port
Posts: 12
Registered: ‎03-04-2017
Location: GB
Views: 2,443
Message 1 of 7

Add EFI Shell to Boot Menu X1 Carbon 5th Gen

Hi,

I am dual booting Windows 10 and Ubuntu 17.04 on an X1 Carbon by using efibootmgr from within Ubuntu to update the EFI boot list. i.e. I am using the Boot Menu firmware of the Thinkpad (accessed by hitting F12 at boot) as my Boot Manager. This is working well, but I would like to have the option to drop into an EFI Shell in case something goes wrong.

 

Most online instructions describe running EFI Shell from a USB drive, but I can't see any reason why it couldn't be loaded from my HDD ESP like any other .EFI file.

 

However  on my Thinkpad, if I do either of the following, when selecting the appropriate option in the F12 boot menu, I simply get a flash of black screen, and returned to the boot menu.

 

- copy the Shell_Full.efi binary (obtained from here) to \EFI\shell\shellx64.efi and create appropriate boot entry using efibootmgr in linux (specifically: sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L "UEFI shellx64.efi in shell" -l "\EFI\shell\shellx64.efi")

OR

- format a USB as fat32, flag partition ESP and Boot, make directory EFI\BOOT and copy same binary there as bootx64.efi

 

Both of these should work - in particular the USB approach. The fact that neither does makes me wonder if the X1 Firmware has some objection to the EFI Shell, or if I am missing a step.

 

Anyone out there tried this or could suggest how to troubleshoot?

Community SeniorMod
Community SeniorMod
Posts: 6,993
Registered: ‎01-13-2008
Location: US
Views: 2,432
Message 2 of 7

Re: Add EFI Shell to Boot Menu X1 Carbon 5th Gen

Hello and welcome,

 

Is that shell signed?  Secure boot on or off?

 

I use grub2 to chainload an EFI shell - among other things.  Just tested on my Gen1 X1 Yoga.

 

If secure boot is ON I can boot grub and then Ubuntu, but selecting the shell throws an error.  Secure OFF lets me boot the shell.  Perhaps your laptop just loops w/out displaying an error.

 

Z.


The large print: please read the Community Participation Rules before posting. Include as much information as possible: model, machine type, operating system, and a descriptive subject line. Do not include personal information: serial number, telephone number, email address, etc.


The fine print: I do not work for, nor do I speak for Lenovo. Unsolicited private messages will be ignored - questions and answers belong in the forum so that others may contribute and benefit. ... GeezBlog

 

  Communities:   English    Deutsch    Español    Português    Русскоязычное    Česká    Slovenská    Українська   Polski    Moto English

dave_os
Serial Port
Posts: 12
Registered: ‎03-04-2017
Location: GB
Views: 2,417
Message 3 of 7

Re: Add EFI Shell to Boot Menu X1 Carbon 5th Gen

Great question on shell signing - that is an issue I didn't think of. I grabbed the shell binary directly from the sourceforge site of the official Intel sponsored open-source project that writes the EDK (http://www.tianocore.org/). That doesn't mean it is signed though, perhaps I need a MOK. It would be good to know precisely though, as I don't feel like going through that process to hit another dead end.

 

That said, Secure boot is OFF (primarily because Ubuntu install says it is necessary to use proprietary drivers, which I wish to do, not sure this is strictly true, or if necessary with the mostly Intel chipset of the X1).

 

Also interesting that you are chainloading from Grub to EFI shell. Which Grub commands will load an EFI file?

Community SeniorMod
Community SeniorMod
Posts: 6,993
Registered: ‎01-13-2008
Location: US
Views: 2,410
Message 4 of 7

Re: Add EFI Shell to Boot Menu X1 Carbon 5th Gen

This is the entry in my hand-built grub.cfg (actually a modified Live USB Ubuntu 16.04 grub.cfg) using the path where I stashed the shell:

 

# Chainload EFI Shell Tool

menuentry "EFI Shell UEFI chainload" {
   chainloader /bootable/EFI_Shell/BootX64.efi
}

 

FWIW,

Z.


The large print: please read the Community Participation Rules before posting. Include as much information as possible: model, machine type, operating system, and a descriptive subject line. Do not include personal information: serial number, telephone number, email address, etc.


The fine print: I do not work for, nor do I speak for Lenovo. Unsolicited private messages will be ignored - questions and answers belong in the forum so that others may contribute and benefit. ... GeezBlog

 

  Communities:   English    Deutsch    Español    Português    Русскоязычное    Česká    Slovenská    Українська   Polski    Moto English

dave_os
Serial Port
Posts: 12
Registered: ‎03-04-2017
Location: GB
Views: 2,403
Message 5 of 7

Re: Add EFI Shell to Boot Menu X1 Carbon 5th Gen

Many thanks,

Interestingly, what happens if I use the Boot Menu to choose my ubuntu entry (created by the Ubuntu intstaller) I get a single line of text  for 2-3 seconds at the top of black screen saying 'Booting in insecure mode' before Grub launches.

 

When I drop to Grub command line hower, if I try to ls I get an error: Secure Boot prevents loading of (hd0,gpt5)/grub/grub_x86/ls.mod.

 

Interesting, it would seem Grub 'thinks' we are in Secure Boot, even if the firmware is reporting otherwise.

 

Thanks for help so far, will need to do some more digging.

 

Final question though: where did you get your shell binary from? and did it match the one of the following in terms of size/filename:

922272 Shell.efi 
771136 Shell_Full.efi

 

 

 

Community SeniorMod
Community SeniorMod
Posts: 6,993
Registered: ‎01-13-2008
Location: US
Views: 2,388
Message 6 of 7

Re: Add EFI Shell to Boot Menu X1 Carbon 5th Gen


@dave_os wrote:
...

Final question though: where did you get your shell binary from? and did it match the one of the following in terms of size/filename:

922272 Shell.efi 
771136 Shell_Full.efi

 


My file doesn't match either of those.  It came to me from an engineer some time ago when I was chasing a BIOS issue.   I don't know what the original source was.  It was several years ago.

 

Sorry I can't be more specific, I'm a little out of my depth.  Happy to help any way I can, but I don't have any real experience with the shell.  I did do a lot of multiboot fiddling back in the day...

 

Z.


The large print: please read the Community Participation Rules before posting. Include as much information as possible: model, machine type, operating system, and a descriptive subject line. Do not include personal information: serial number, telephone number, email address, etc.


The fine print: I do not work for, nor do I speak for Lenovo. Unsolicited private messages will be ignored - questions and answers belong in the forum so that others may contribute and benefit. ... GeezBlog

 

  Communities:   English    Deutsch    Español    Português    Русскоязычное    Česká    Slovenská    Українська   Polski    Moto English

dave_os
Serial Port
Posts: 12
Registered: ‎03-04-2017
Location: GB
Views: 2,356
Message 7 of 7

Re: Add EFI Shell to Boot Menu X1 Carbon 5th Gen

Many thanks again

 

Your first guess was right!

 

I had Secure Boot enabled. I was confused by a message which appears saying 'Booting in Insecure Mode' which apparently does NOT mean that Secure Boot is switched off.

 

Double checking Secure Boot option in firmware and disabling allowed me to boot into EFI Shell.

Check out current deals!


Shop current deals

Top Kudoed Authors