Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boot entries keep accumulating / ThinkPad X220 does not wake up from suspend-to-ram #52

Open
martin-ueding opened this issue Apr 12, 2016 · 13 comments

Comments

@martin-ueding
Copy link

I have a ThinkPad X220 Tablet which runs Fedora 23 with automatic updates,
Chromium and Spotify Copr. Up until Friday night, 2016-03-19, it worked just
fine.

Friday afternoon the new Kernel 4.4.5 was installed. It was only loaded
on Saturday when I started the machine in the afternoon. I suspended the
laptop to RAM and found that it did not woke up. I only got this strange
light show:

https://www.youtube.com/watch?v=ajoWfCtk7yE

The error (sadly) is 100% reproducible. I then went on and started with the
earlier kernels, 4.4.4 and 4.4.3, which worked fine before Friday. The error is
just the same, it does not wake up.

Then I also started a Kubuntu 15.04 from USB and had a slightly
different error. The machine would start the fan and the power light
would turn on, but the wifi was still off and the screen was black.

Using Arch Linux 2016.03.01 I was able to reproduce the error with
Kernel 4.4.1. Therefore I think it is not about the software any more.
This might be somewhere in the hardware or UEFI firmware.

On the fedora-devel mailinglist I posted the above and got some valuable
feedback. In the meantime I noticed that I could not save anything in the UEFI.
It looks like this:

I tried to do an UEFI firmware upgrade using the boot CD images that Lenovo
provides. They are 16-bit DOS and my boot sequence was locked into UEFI only.
Therefore I had to boot a Windows and do the upgrade there. This did not change
much, I did not get any error message in the UEFI/BIOS but it would just freeze
when trying to save something.

Chris Murphy from the fedora-devel list suggested to look at the output of
efibootmgr -v. Currently it looks like the following:

BootCurrent: 000A
Timeout: 0 seconds
BootOrder: 004A,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
Boot0000  Setup FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
Boot0001  Boot Menu     FvFile(126a762d-5758-4fca-8531-201a7f57f850)
Boot0002  Diagnostic Splash Screen      FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
Boot0003  Startup Interrupt Menu        FvFile(f46ee6f4-4785-43a3-923d-7f786c3c8479)
Boot0004  ME Configuration Menu FvFile(82988420-7467-4490-9059-feb448dd1963)
Boot0005  Rescue and Recovery   FvFile(665d3f60-ad3e-4cad-8e26-db46eee9f1b5)
Boot0006* USB CD        VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,86701296aa5a7848b66cd49dd3ba6a55)
Boot0007* USB FDD       VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,6ff015a28830b543a8b8641009461e49)
Boot0008* ATAPI CD0     VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a35401)
Boot0009* ATA HDD2      VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f602)
Boot000A* ATA HDD0      VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)
Boot000B* ATA HDD1      VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f601)                
Boot000C* USB HDD       VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,33e821aaaf33bc4789bd419f88c50803)                  
Boot000D* PCI LAN       VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)                  
Boot000E* ATAPI CD1     VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a35403)                
Boot000F* ATAPI CD2     VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a35404)                
Boot0010  Other CD      VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a35406)                
Boot0011* ATA HDD3      VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f603)                
Boot0012* ATA HDD4      VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f604)                
Boot0013  Other HDD     VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f606)                
Boot0014* IDER BOOT CDROM       PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,1,0)                                                  
Boot0015* IDER BOOT Floppy      PciRoot(0x0)/Pci(0x16,0x2)/Ata(0,0,0)                                                  
Boot0016* ATA HDD       VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f6)                  
Boot0017* ATAPI CD:     VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,aea2090adfde214e8b3a5e471856a354)                  
Boot0018* PCI LAN       VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,78a84aaf2b2afc4ea79cf5cc8f3d3803)                  
Boot0019* kubuntu       HD(1,GPT,9feb65d0-1f99-4f66-8cc1-1e2aa3c71354,0x800,0xf3800)/File(\EFI\kubuntu\shimx64.efi)    
Boot001A* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot001B* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot001C* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot001D* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot001E* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot001F* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0020* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0021* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0022* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0023* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0024* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0025* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0026* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0027* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0028* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)        
Boot0029* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot002A* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot002B* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot002C* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot002D* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot002E* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot002F* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0030* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0031* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0032* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0033* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0034* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0035* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0036* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0037* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0038* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0039* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot003A* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot003B* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot003C* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot003D* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot003E* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot003F* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0040* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0041* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0042* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0043* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0044* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0045* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0046* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0047* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0048* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot0049* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot004A* Fedora        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)

By his suggestion, I deleted a lot of the boot entries. He said that this might
be NVRAM corruption. The first delete that I tried using efibootmgr failed as
it complained about lack of free memory. So some hard limit has been reached
there. Deleing it via the efivars file system helped, and then I could delete
the remainder with efibootmgr.

He further suggested to delete everything in EFI/BOOT/ and run dnf reinstall shim grub2-efi, which I did as well as grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg. After that, the checksum of
/boot/efi/EFI/BOOT/BOOTX64.EFI has not changed, though.

After I deleted the boot entries, I could make changes in the UEFI/BIOS screen
again. Also the laptop consistently wakes up from the suspend again.

As a workaround, I wrote a little script that deletes the Fedora boot entries
once there are over fifty.

In case it is of any interest, this is the output of lsblk:

NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                             8:0    0 465,8G  0 disk  
├─sda1                                          8:1    0   200M  0 part  /boot/efi
├─sda2                                          8:2    0   500M  0 part  /boot
└─sda3                                          8:3    0 465,1G  0 part  
  └─luks-3f530000-b2c3-4ba3-9e85-1a96494cc25d 253:0    0 465,1G  0 crypt 
    ├─fedora_martin--friese-root              253:1    0    50G  0 lvm   /
    ├─fedora_martin--friese-swap              253:2    0   7,8G  0 lvm   [SWAP]
    └─fedora_martin--friese-home              253:3    0 407,3G  0 lvm   /home

I am not sure whether this is the right place to report this bug. Is this
something which could be fixed withing this project?

@lcp
Copy link
Collaborator

lcp commented Apr 13, 2016

Could you try to boot /EFI/BOOT/bootx64.efi and compare "efibootmgr -v" after booting?

@martin-ueding
Copy link
Author

I am not sure how to boot this explicitly. In the UEFI boot screen I can select the disk to boot from. Then I see the Fedora GRUB where I can only select the kernels. I think to boot /EFI/BOOT/bootx64.efi, I would have to do something before the GRUB, right?

@lcp
Copy link
Collaborator

lcp commented Apr 21, 2016

Some firmware UI provides "Boot From File". Booting from a certain disk is basically equivalent to booting /EFI/BOOT/bootx64.efi anyway. Since the only chance that shim creates the boot options is when it boots from /EFI/BOOT/bootx64.efi and chainloads /EFI/BOOT/fallback.efi, I would like to know if fallback.efi creates the boot options blindly in your case.

@martin-ueding
Copy link
Author

My UI does not provide that much. This is what I have in my boot menu:

img_20160501_214224959
img_20160501_214230557

Booting the HDD (which is an SSD) will just give me the Fedora GRUB:

img_20160501_214236530

This BIOS Update entry is from myself. I added in in order to flash the firmware (does not work in UEFI mode) in order to get around this bug perhaps. So this entry is after the bug appeared.

In the UEFI setup I found the following which I found quite interesting:

img_20160501_214134767_hdr

Either way, running efibootmgr -v before and after one reboot gives the following:

--- boot1.txt   2016-05-01 21:39:47.337991862 +0200
+++ boot2.txt   2016-05-01 21:44:06.182270460 +0200
@@ -1,6 +1,6 @@
 BootCurrent: 000A
 Timeout: 0 seconds
-BootOrder: 004A,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
+BootOrder: 004C,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
 Boot0000  Setup        FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
 Boot0001  Boot Menu    FvFile(126a762d-5758-4fca-8531-201a7f57f850)
 Boot0002  Diagnostic Splash Screen     FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
@@ -76,3 +76,5 @@
 Boot0048* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot0049* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot004A* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot004B* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot004C* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)

I saw GRUB twice before taking this diff. I reset the computer with CtrlAltDel as I wanted to get back into the boot menu. Therefore I would say that it adds one boot entry per boot.

I am sorry that I cannot boot from a particular file. Perhaps one could modify my GRUB such that it boots the thing you are interested in?

@vathpela
Copy link
Contributor

vathpela commented May 2, 2016

Well, you could try doing something like:
efibootmgr -b 50 -C -L setup -l '\EFI\BOOT\BOOTX64.EFI' -d /dev/sda -p 1
efibootmgr -n 50

And in theory it should try to boot BOOTX64.EFI once. I think what lcp's suspicion is that either the firmware is duplicating entries on boot for no good reason, or it's /always/ booting BOOTX64.EFI erroneously, and we're also wrongly re-creating boot entries instead of using existing ones when that happens.

I'm also wondering what "Boot Order Lock" actually does, and if it's interfering with or confusing our code in some way.

@martin-ueding
Copy link
Author

I just ran your commands and rebooted by machine exactly once. Now I the output of efibootmgr -v differs like so:

--- boot10.txt  2016-05-02 17:58:14.293268556 +0200
+++ boot11.txt  2016-05-02 17:59:07.881023069 +0200
@@ -1,7 +1,6 @@
-BootNext: 0050
-BootCurrent: 000A
+BootCurrent: 0050
 Timeout: 0 seconds
-BootOrder: 004B,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
+BootOrder: 004C,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
 Boot0000  Setup        FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
 Boot0001  Boot Menu    FvFile(126a762d-5758-4fca-8531-201a7f57f850)
 Boot0002  Diagnostic Splash Screen     FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
@@ -78,4 +77,5 @@
 Boot0049* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot004A* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot004B* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot004C* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot0050* setup        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\BOOT\BOOTX64.EFI)

Does that help? Is there something more that I could try out?

I start to understand a bit. Before running your commands, I had BootCurrent: 000A. Going to that line, I see

Boot000A* ATA HDD0  VenMsg(bc7838d2-0f82-4d60-8316-c068ee79d25b,91af625956449f41a7b91f4f892ab0f600)

The line with the boot order says

BootOrder: 004B,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013

So before getting to the thing that actually started the system before (000A), it has been at 004B. That is

Boot004B* Fedora    HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)

and the last item in the list. From this I would guess that it actually boots shim.efi as the first try. From there it gets redirected to 000A. That is all that I see in that file.

@martin-ueding
Copy link
Author

I have now checked what this “Boot order Lock is about”:

Select “Enabled” to lock Boot Priority Order.

That is particularly unhelpful. I have just disabled that feature now. Perhaps it does something, I am not sure how to test this difference.

Either way, after rebooting many times (I tried to figure out which keys are for Setup and Boot Menu to label print it), I obtain the following diff:

--- boot11.txt  2016-05-02 17:59:07.881023069 +0200
+++ boot12.txt  2016-05-02 18:11:31.178204346 +0200
@@ -1,6 +1,6 @@
-BootCurrent: 0050
+BootCurrent: 000A
 Timeout: 0 seconds
-BootOrder: 004C,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
+BootOrder: 0053,000A,0009,0006,0007,0008,000B,000C,000D,000E,000F,0010,0011,0012,0013
 Boot0000  Setup        FvFile(721c8b66-426c-4e86-8e99-3457c46ab0b9)
 Boot0001  Boot Menu    FvFile(126a762d-5758-4fca-8531-201a7f57f850)
 Boot0002  Diagnostic Splash Screen     FvFile(a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380)
@@ -78,4 +78,10 @@
 Boot004A* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot004B* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot004C* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot004D* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot004E* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot004F* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
 Boot0050* setup        HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\BOOT\BOOTX64.EFI)
+Boot0051* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot0052* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
+Boot0053* Fedora       HD(1,GPT,18add345-44b0-44dd-9aa9-feae671b7d2e,0x800,0x64000)/File(\EFI\fedora\shim.efi)

I would now just assume that shim.efi always redirects to 000A as I always have BootCurrent: 000A except for the time where I ran your commands beforehand. Then it was actually BootCurrent: 0050. So the BOOTX64.EFI is what actually brings up the machine. But it also creates a new boot entry as we have seen with the previous test using your commands.

So my current model is:

  • shim.efi just redirects to 000A where it boots BOOTX64.EFI.
  • BOOTX64.EFI brings up the machine and creates a new boot entry for shim.efi without looking for other ones there. Then it adds the new boot entry as the first in the BootOrder replacing the previous one there. But it does not concatenate anything, it just replaces the first entry.

@lcp
Copy link
Collaborator

lcp commented May 3, 2016

I suspect the firmware ignores the efi images other than bootx64.efi so it kept going back to the HDD, i.e. 000A, but I still don't know why fallback.efi kept creating those duplicate boot options.

@martin-ueding
Copy link
Author

martin-ueding commented May 11, 2016

Hmm, okay. Is there something I can do to help diagnosing this issue any further?

In the meantime I will just regularly clean out the superfluous boot entries with a script, that should be fine now.

@martin-ueding
Copy link
Author

I found one more piece of information that I should have provided earlier. One one reboot I saw the following:

shim

It is hard to read, it says:

System BootOrder not found. Initializing defaults.
Creating boot entry "Boot0129" with label "Fedora" for the file "\EFI\fedora\shim.efi"
Could not create variable: 9

Perhaps that is related to the code 0x9 from the previous screenshots? I am not really sure when I saw this. Perhaps it was after trying to reset the UEFI, I am not sure. But I think that this is from before I cleaned out anything using efibootmgr.

@ghost
Copy link

ghost commented Jul 16, 2018

Same issue with a kernel upgrade corrupting NVRAM on my Thinkpad T420 with Fedora 28.

Same BootOrder error message, can't save BIOS settings (status 0x9), complete system freezes every few hours, resume from suspend no longer works.

Edit: manually deleting the latest boot entry from /sys/firmware/efi/efivars fixed my system.

@martin-ueding
Copy link
Author

Ever since that issue occured on my laptop, I have a little Python script running via cron which cleans up excessive boot entries in the UEFI. So far this has saved me from any further problems with that issue.

@Jiab77
Copy link

Jiab77 commented Nov 4, 2018

Well done for your script @martin-ueding! On my side with an Ubuntu based distrib, I used a bash for loop to clean bad entries automatically added on each boot loop... I also had to define the BootNext value manually using: sudo efibootmgr -n [boot id] -v and watch if it stays as BootCurrent on next reboots.

More info / details in my gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants