Bug 971158 - efibootmgr cannot change anything
efibootmgr cannot change anything
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: efibootmgr (Show other bugs)
18
Unspecified Linux
unspecified Severity medium
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-05 16:14 EDT by Moritz Baumann
Modified: 2014-02-05 16:41 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-05 16:41:36 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
sosreport (607.12 KB, application/octet-stream)
2013-06-05 16:32 EDT, Moritz Baumann
no flags Details
# find /sys/firmware/efi > ~/sys_firmware_efi (36.53 KB, text/plain)
2013-06-05 16:44 EDT, Moritz Baumann
no flags Details

  None (edit)
Description Moritz Baumann 2013-06-05 16:14:48 EDT
Description of problem:
when I try to change either nextboot (-n) or bootorder (-o) with efibootmgr nothing happens. exit code is 1 but the program silently fails (I'm not complaining so much about the silent failing, but about the failing).

Version-Release number of selected component (if applicable):

efibootmgr-0.5.4-14.fc18.x86_64

How reproducible:

Always.

Steps to Reproduce:
1. run "efibootmgr"

[root@localhost ~]# efibootmgr 
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,0002,0003
Boot0000* Windows Boot Manager
Boot0001* Fedora
Boot0002* CD/DVD Drive 

2. change bootorder (and strace open/write)

[root@localhost ~]# strace -e open,write efibootmgr -o 0000,0001,0002
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libpci.so.3", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib64/libresolv.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/sys/firmware/efi/vars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
open("/sys/firmware/efi/vars/Boot0001-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
open("/sys/firmware/efi/vars/Boot0002-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
open("/sys/firmware/efi/vars/Boot0003-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
open("/sys/firmware/efi/vars/BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_RDONLY) = 3
open("/sys/firmware/efi/vars/BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c/raw_var", O_WRONLY) = 3
write(3, "B\0o\0o\0t\0O\0r\0d\0e\0r\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2084) = -1 EIO (Input/output error)
+++ exited with 1 +++

3. dmesg shows

[ 2535.484994] efivars: get_variable() failed 0x8000000000000005!
[ 2535.488310] efivars: set_variable() failed: status=8000000000000009


Actual results:

Nothing is changed

Expected results:

Bootorder showing the new bootorder.

Additional info:

first I got the 

write(3, "B\0o\0o\0t\0000\0000\0000\0003\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2084) = -1 ENOSPC (No space left on device)

(see #922275) but after some hints from other tickets and adamw from #fedora-qa I deleted /sys/firmware/efi/efivars/dump-type0-* and rebooted several times.

from mjg59 I got the following info 

<mjg59> Your BootOrder variable is more than 1K big
<mjg59> And the legacy efi/vars interface can't handle that
Comment 1 Moritz Baumann 2013-06-05 16:17:26 EDT
Mainboard is a ASUS P8Z68-V PRO 

Bios 
Version: 3603 
Release Date: 11/09/2012
Comment 2 Moritz Baumann 2013-06-05 16:32:28 EDT
Created attachment 757358 [details]
sosreport
Comment 3 Moritz Baumann 2013-06-05 16:44:56 EDT
Created attachment 757368 [details]
# find /sys/firmware/efi > ~/sys_firmware_efi
Comment 4 Moritz Baumann 2013-06-08 03:01:22 EDT
two days later I am able to change settings with efibootmgr again.

But efibootmgr cannot access all variables.
After a "dmesg -c" I get the following:

[root@localhost ~]# efibootmgr 
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,0002,0003
Boot0000* Windows Boot Manager
Boot0001* Fedora
Boot0002* CD/DVD Drive 
[root@localhost ~]# dmesg -c
[ 3004.092108] efivars: get_variable() failed 0x8000000000000005!
[root@localhost ~]# efibootmgr -n 0
BootNext: 0000
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,0002,0003
Boot0000* Windows Boot Manager
Boot0001* Fedora
Boot0002* CD/DVD Drive 
[root@localhost ~]# dmesg
[ 3113.148680] efivars: get_variable() failed 0x8000000000000005!
Comment 5 Moritz Baumann 2013-06-08 03:03:39 EDT
something else that is strange:

The bootorder goes from 0-3 but there are only bootentries from 0-2.

I did remove the 3 with "efibootmgr -o 1,0,2" but something (maybe entering bios or changing bootorder there) keeps putting it back.
Comment 6 Lingzhu Xiang 2013-06-09 05:26:37 EDT
You should specify kernel version with report. Recent kernel has changed an anti-bricking mechanism that might affect your result.

8000000000000009 is -9. 9 is EFI_OUT_OF_RESOURCES is ENOSPC. But that should be fixed in latest kernel. So apparently you've been able to change something with efibootmgr and latest kernel.

0x8000000000000005 is -5. 5 is EFI_BUFFER_TOO_SMALL. Buffer was too small to hold some variable. You can strace which variable was being too large. Maybe Boot0003? You can dump it with /sys/firmware/efi/vars/$variable/data or /sys/firmware/efi/efivars/$variable.

Firmware might restore boot entries if it thinks those are corrupted or missing. Windows Boot Manager might do the same thing. Boot entries being restored is not surprising.
Comment 7 Moritz Baumann 2013-06-10 18:14:29 EDT
sorry I reported against: kernel-3.9.4-200.fc18.x86_64

I have upgraded to kernel: kernel-3.9.4-301.fc19.x86_64

now I don't get any more errors.

setting nextboot to windows with efibootmgr works as expected (with 3.9.4-301)

Setting bootorder shows the changes I want, but internally the efivars get messed up with 3.9.4-301.


An example:



[root@localhost ~]# efibootmgr 
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,0002,0003
Boot0000* Windows Boot Manager
Boot0001* Fedora
Boot0002  CD/DVD Drive 
Boot0003  Hard Drive 
[root@localhost ~]# efibootmgr -o 1,0
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* Windows Boot Manager
Boot0001* Fedora
Boot0002  CD/DVD Drive 
Boot0003  Hard Drive 

But after reboot the bootorder shows to some invalid entry and I have to press [f8] and manually select fedora. 
After I booted in to system the boot order is the same as listed first.
Comment 8 Moritz Baumann 2013-06-10 18:19:01 EDT
From UEFI-Bios I had removed all entries but Fedora and Windows Boot Mgr.

Observation. It could  that this bug only triggers if I have 2 external usb drives or an aditional flash card reader attached. Will check tomorrow.
Comment 9 Peter Jones 2013-06-18 15:17:54 EDT
I think your firmware is creating boot entries for e.g. "boot HD0 as a removable device", adding them to the boot order, and then removing them if they're not selected, but failing to remove them from the boot order.
Comment 10 Fedora Admin XMLRPC Client 2013-10-09 16:38:19 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 11 Fedora End Of Life 2013-12-21 08:52:46 EST
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 12 Fedora End Of Life 2014-02-05 16:41:36 EST
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.