Bug 47631 - efivars.c: fails for duplicate Boot entry
Summary: efivars.c: fails for duplicate Boot entry
Status: RESOLVED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: x86-64 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: platform_x86_64@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-17 17:01 UTC by Flo G
Modified: 2013-05-02 12:28 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.6-rc6
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg output (262.76 KB, text/plain)
2012-09-17 17:01 UTC, Flo G
Details
output of lspci -vvv (33.67 KB, application/octet-stream)
2012-09-20 08:41 UTC, Flo G
Details
dmesg output before inserting efivars module (69.57 KB, application/octet-stream)
2012-09-20 09:30 UTC, Flo G
Details
Abort GetNextVariableName() if we start seeing duplicate entries (1.59 KB, patch)
2012-09-29 20:01 UTC, Matt Fleming
Details | Diff
dmesg output with patch applied (200.57 KB, application/octet-stream)
2012-10-04 08:00 UTC, Flo G
Details
dmesg output after removing the "Boot-0 !..."-entry (72.49 KB, application/octet-stream)
2012-10-18 11:17 UTC, Flo G
Details
dmesg (268.83 KB, text/plain)
2013-03-18 21:16 UTC, Flo G
Details

Description Flo G 2012-09-17 17:01:00 UTC
Created attachment 80451 [details]
dmesg output

When there are multiple Boot entries with the same name, inserting efivars module results in a infinite error loop (see attached dmesg output).
Comment 1 Flo G 2012-09-20 08:40:56 UTC
This is on a HP EliteBook 8530w. The problem first occurred after trying to add a boot entry with efibootmgr, which first displayed an error and hung after a second try. (Sorry - I can't give any details on how to reproduce this since it depends on efivars) Also Microsofts bcdedit tool can't cope with this and hangs - this results in windows not being bootable and not being (re-)installable (mentioning that only to give more details on the symptoms - this is of course a problem between me and M$).
Also the efishell shows only a cursor for a while and afterwards restarts. Writing a new BIOS/UEFI-firmware from HP doesn't fix this, as for changing the boot order in the BIOS/UEFI-setup. (HP refers to it as BIOS firmware/setup)


Some details on my installation:

Gentoo 64bit(multilib-profile)

############# /proc/version:
Linux version 3.6.0-rc6 (root@amadablam) (gcc version 4.6.3 (Gentoo 4.6.3 p1.6, pie-0.5.2) ) #1 SMP PREEMPT Tue Sep 18 20:51:04 CEST 2012

############# scripts/ver_linux:
If some fields are empty or look unusual you may have an old version.
Compare to the current minimal requirements in Documentation/Changes.
 
Linux amadablam 3.6.0-rc6 #1 SMP PREEMPT Tue Sep 18 20:51:04 CEST 2012 x86_64 Intel(R) Core(TM)2 Duo CPU T9550 @ 2.66GHz GenuineIntel GNU/Linux
 
Gnu C                  4.6.3
Gnu make               3.82
binutils               2.22.90.20120727
util-linux             2.22
mount                  debug
module-init-tools      10
e2fsprogs              1.42.5
PPP                    2.4.5
Linux C Library        2.15
Dynamic linker (ldd)   2.15
Procps                 UNKNOWN
Net-tools              1.60_p20120127084908
Kbd                    1.15.3wip
Sh-utils               8.19
wireless-tools         30
Modules Loaded         fuse snd_hda_codec_analog uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev iwldvm btusb bluetooth nvidia mac80211 sdhci_pci snd_hda_intel sdhci snd_hda_codec mmc_core e1000e coretemp iwlwifi cfg80211 snd_pcm snd_page_alloc snd_timer snd soundcore r592 memstick kvm_intel kvm


############# /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Core(TM)2 Duo CPU     T9550  @ 2.66GHz
stepping	: 10
microcode	: 0xa0b
cpu MHz		: 800.000
cache size	: 6144 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida dtherm tpr_shadow vnmi flexpriority
bogomips	: 5320.20
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:
[... cut second cpu ...]


#############  /proc/modules
fuse 65950 1 - Live 0xffffffffa0cbd000
snd_hda_codec_analog 76738 1 - Live 0xffffffffa0ca9000
uvcvideo 69002 0 - Live 0xffffffffa0c97000
videobuf2_vmalloc 2292 1 uvcvideo, Live 0xffffffffa0024000
videobuf2_memops 2006 1 videobuf2_vmalloc, Live 0xffffffffa0002000
videobuf2_core 22580 1 uvcvideo, Live 0xffffffffa0c90000
videodev 93479 2 uvcvideo,videobuf2_core, Live 0xffffffffa0c70000
iwldvm 124182 0 - Live 0xffffffffa0c49000
btusb 11865 0 - Live 0xffffffffa0014000
bluetooth 184455 2 btusb, Live 0xffffffffa0d2a000
nvidia 11194003 53 - Live 0xffffffffa019b000 (PO)
mac80211 212647 1 iwldvm, Live 0xffffffffa0166000
sdhci_pci 9691 0 - Live 0xffffffffa00b5000
snd_hda_intel 23108 2 - Live 0xffffffffa015f000
sdhci 22535 1 sdhci_pci, Live 0xffffffffa007a000
snd_hda_codec 73077 2 snd_hda_codec_analog,snd_hda_intel, Live 0xffffffffa0143000
mmc_core 77832 1 sdhci, Live 0xffffffffa012e000
e1000e 174780 0 - Live 0xffffffffa0102000
coretemp 5714 0 - Live 0xffffffffa0011000
iwlwifi 65512 1 iwldvm, Live 0xffffffffa00f1000
cfg80211 171337 3 iwldvm,mac80211,iwlwifi, Live 0xffffffffa0081000
snd_pcm 64551 2 snd_hda_intel,snd_hda_codec, Live 0xffffffffa0026000
snd_page_alloc 6593 2 snd_hda_intel,snd_pcm, Live 0xffffffffa0021000
snd_timer 18026 1 snd_pcm, Live 0xffffffffa0018000
snd 48314 9 snd_hda_codec_analog,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer, Live 0xffffffffa0004000
soundcore 864 1 snd, Live 0xffffffffa0000000
r592 11387 0 - Live 0xffffffffa00ea000
memstick 6302 1 r592, Live 0xffffffffa00e4000
kvm_intel 119281 0 - Live 0xffffffffa00b9000
kvm 245366 1 kvm_intel, Live 0xffffffffa003d000


#############  /proc/ioports
0000-0cf7 : PCI Bus 0000:00
  0000-001f : dma1
  0020-0021 : pic1
  0040-0043 : timer0
  0050-0053 : timer1
  0060-0060 : keyboard
  0062-0062 : EC data
  0064-0064 : keyboard
  0066-0066 : EC cmd
  0070-0077 : rtc0
  0080-008f : dma page reg
  00a0-00a1 : pic2
  00c0-00df : dma2
  00f0-00ff : fpu
  0200-027f : pnp 00:07
  03c0-03df : uvesafb
  0400-047f : pnp 00:07
    0400-0403 : ACPI PM1a_EVT_BLK
    0404-0405 : ACPI PM1a_CNT_BLK
    0408-040b : ACPI PM_TMR
    0410-0415 : ACPI CPU throttle
    0420-042f : ACPI GPE0_BLK
    0430-0433 : iTCO_wdt
    0450-0450 : ACPI PM2_CNT_BLK
    0460-047f : iTCO_wdt
  0500-057f : pnp 00:07
0cf8-0cff : PCI conf1
0d00-ffff : PCI Bus 0000:00
  1000-1003 : pnp 00:07
  1010-101f : pnp 00:07
  2000-2fff : PCI Bus 0000:86
    2000-20ff : PCI CardBus 0000:87
    2400-24ff : PCI CardBus 0000:87
  3000-4fff : PCI Bus 0000:45
  5000-6fff : PCI Bus 0000:04
  7000-7fff : PCI Bus 0000:01
    7000-707f : 0000:01:00.0
  8000-801f : 0000:00:1f.2
    8000-801f : ahci
  8020-803f : 0000:00:1d.2
    8020-803f : uhci_hcd
  8040-805f : 0000:00:1d.1
    8040-805f : uhci_hcd
  8060-807f : 0000:00:1d.0
    8060-807f : uhci_hcd
  8080-809f : 0000:00:1a.2
    8080-809f : uhci_hcd
  80a0-80bf : 0000:00:1a.1
    80a0-80bf : uhci_hcd
  80c0-80df : 0000:00:1a.0
    80c0-80df : uhci_hcd
  80e0-80ff : 0000:00:19.0
  8100-8107 : 0000:00:1f.2
    8100-8107 : ahci
  8108-810f : 0000:00:1f.2
    8108-810f : ahci
  8110-8113 : 0000:00:1f.2
    8110-8113 : ahci
  8114-8117 : 0000:00:1f.2
    8114-8117 : ahci
  9000-9fff : PCI Bus 0000:02
  a000-afff : PCI Bus 0000:03
  ef80-ef9f : pnp 00:07
  ffff-ffff : pnp 00:07

############# /proc/iomem
00000000-0000ffff : reserved
00010000-0009ffff : System RAM
000a0000-000bffff : PCI Bus 0000:00
000c0000-000ce1ff : Video ROM
000ce800-000cf7ff : Adapter ROM
000f0000-000fffff : System ROM
00100000-b8e1ffff : System RAM
  02000000-02575ba7 : Kernel code
  02575ba8-0277c6bf : Kernel data
  02818000-028adfff : Kernel bss
b8e20000-b8e21fff : reserved
b8e22000-b9d6ffff : System RAM
b9d70000-b9d7ffff : ACPI Non-volatile Storage
b9d80000-bc492fff : System RAM
bc493000-bc692fff : ACPI Non-volatile Storage
bc693000-bdd8efff : System RAM
bdd8f000-bdecefff : reserved
bdecf000-bdfcefff : ACPI Non-volatile Storage
bdfcf000-bdffefff : ACPI Tables
bdfff000-bdffffff : System RAM
be000000-bfffffff : RAM buffer
c0000000-dfffffff : PCI Bus 0000:00
  c0000000-cfffffff : PCI Bus 0000:01
    c0000000-cfffffff : 0000:01:00.0
  d0000000-d2ffffff : PCI Bus 0000:01
    d0000000-d1ffffff : 0000:01:00.0
      d1000000-d1dfffff : uvesafb
    d2000000-d2ffffff : 0000:01:00.0
      d2000000-d2ffffff : nvidia
  d3000000-d30fffff : PCI Bus 0000:86
    d3000000-d3000fff : 0000:86:09.4
      d3000000-d3000fff : yenta_socket
    d3001000-d30017ff : 0000:86:09.0
    d3001800-d30018ff : 0000:86:09.3
    d3001900-d30019ff : 0000:86:09.2
      d3001900-d30019ff : r592
    d3001b00-d3001bff : 0000:86:09.1
      d3001b00-d3001bff : mmc0
  d3100000-d70fffff : PCI Bus 0000:45
  d7100000-db0fffff : PCI Bus 0000:04
  db100000-db1fffff : PCI Bus 0000:03
    db100000-db101fff : 0000:03:00.0
      db100000-db101fff : iwlwifi
  db200000-db2fffff : PCI Bus 0000:02
  db300000-db31ffff : 0000:00:19.0
    db300000-db31ffff : e1000e
  db320000-db323fff : 0000:00:1b.0
    db320000-db323fff : ICH HD audio
  db324000-db324fff : 0000:00:19.0
    db324000-db324fff : e1000e
  db325000-db3257ff : 0000:00:1f.2
    db325000-db3257ff : ahci
  db325800-db325bff : 0000:00:1d.7
    db325800-db325bff : ehci_hcd
  db325c00-db325fff : 0000:00:1a.7
    db325c00-db325fff : ehci_hcd
  db400000-db5fffff : PCI Bus 0000:02
  db600000-db7fffff : PCI Bus 0000:03
  db800000-db9fffff : PCI Bus 0000:04
  dba00000-dbbfffff : PCI Bus 0000:45
  dc000000-dfffffff : PCI Bus 0000:86
    dc000000-dfffffff : PCI CardBus 0000:87
e0000000-efffffff : PCI MMCONFIG 0000 [bus 00-ff]
  e0000000-efffffff : pnp 00:01
f0000000-fedfffff : PCI Bus 0000:00
  f0000000-f3ffffff : PCI CardBus 0000:87
  fec00000-fec003ff : IOAPIC 0
  fed00000-fed003ff : HPET 0
    fed00000-fed003ff : pnp 00:05
  fed10000-fed13fff : pnp 00:01
  fed18000-fed18fff : pnp 00:01
  fed19000-fed19fff : pnp 00:01
  fed1c000-fed1ffff : reserved
    fed1c000-fed1ffff : pnp 00:01
      fed1f410-fed1f414 : iTCO_wdt
  fed20000-fed3ffff : pnp 00:01
  fed45000-fed8ffff : pnp 00:01
fee00000-fee00fff : Local APIC
fee01000-ffffffff : PCI Bus 0000:00
  fffa0000-fffa6fff : reserved
100000000-23fffffff : System RAM


#############  /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: ST95005620AS     Rev: SD28
  Type:   Direct-Access                    ANSI  SCSI revision: 05
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor: Optiarc  Model: DVD RW AD-7561S  Rev: AH03
  Type:   CD-ROM 


############# emerge --info
Portage 2.2.0_alpha129 (default/linux/amd64/10.0/desktop/gnome, gcc-4.6.3, glibc-2.15-r2, 3.6.0-rc6 x86_64)
=================================================================
System uname: Linux-3.6.0-rc6-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T9550_@_2.66GHz-with-gentoo-2.2
Timestamp of tree: Thu, 20 Sep 2012 06:45:01 +0000
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12
dev-lang/python:          2.7.3-r2, 3.2.3-r1
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.12.4
sys-devel/binutils:       2.22.90
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.5 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo science mozilla x11 jtriley kork THG2
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mirror.dkm.cz/pub/gentoo/ http://de-mirror.org/gentoo/ http://mirrors.linuxant.fr/distfiles.gentoo.org/ http://gentoo.tiscali.nl/ http://mirror.leaseweb.com/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en de"
MAKEOPTS=" -j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/science /var/lib/layman/mozilla /var/lib/layman/x11 /var/lib/layman/jtriley /var/lib/layman/kork /usr/local/portage2"
SYNC="rsync://rsync.de.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi aio alsa amd64 apng archive avahi berkdb blas blksha1 bluetooth btrfs bzip2 c++0x cairo caps-ng cdda cddb cdr cg chm cleartype cli colord colordiff consolekit corefonts cracklib crypt cuda cups curl cxx daap dbus demosaic devhelp dhcpcd djvu dlna dri dts dvd dvdr dvi eds eigen emboss encode evo exif experimental extras fat ffmpeg fftw firefox flac fontconfig fortran ftp fuse g3dvl gbm gd gdal gdbm gedit gif gimp git glchess gles1 gles2 glew glibc-omitfp glut gmail gmp gnome gnome-keyring gnome-online-accounts gnome-shell gnuplot gnutls gphoto2 gpm gptfdisk gpu graphics graphite graphviz grilo gs gsf gstreamer gtk gtk3 gtkstyle gzip hdri hfs hpn http hunspell ical icc iconv icq icu id3tag imagemagick inkjar inotify introspection ipc ipod ipp iptc ipv6 ithreads jit jpeg jpeg2k kpathsea ladspa lame lapack laptop lastfm lastfmradio latex latex3 lcdfilter lcms lensfun libburn libmms libnotify libsamplerate lm_sensors lpsol lqr lto lzma lzo mad map mathml matroska mdnsresponder-compat mime minizip mkl mmap mms mmx mmxext mng modules mp3 mp4 mpd mpeg mplayer mtp mudflap multilib musepack musicbrainz mythtv nautilus ncurses netpbm network networkmanager nfs nfsidmap nfsv3 nfsv4 nfsv41 nls nokia nptl ntfs ntp ocr octave offensive ogg opencl openexr opengl opengtl openmp openrc openvg optimized-qmake pam pango parted pch pcmcia pcre pdf playlist plotutils pm-utils png policykit postproc postscript ppds pppd prediction ps pstricks pulseaudio python3 qpa qt3support qt4 quicktime rar raw readline rtmp samba science sdl secure-delete session sftp shared-dricore sharedmem shm shmvideo smbclient smp socialweb socks5 sound soundex spell sqlite sqlite3 sse sse2 sse3 sse4 sse4_1 ssl ssse3 startup-notification subversion svg system-sqlite szip t1lib taglib tbb tcl tcpd tex theora threads threadsafe tiff tk tpm transcode truetype udev udisks udisks2 unicode unlock-notify unzip upnp upower usb v4l v4l2 v8 vaapi vala vapigen vdpau vorbis vpx webgl webkit webkit2 webm webp wext wifi wma wmf wps wxwidgets x264 xa xcb xcomposite xetex xine xinerama xml xmp xorg xps xrandr xv xvfb xvid xvmc zeroconf zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="braindump flow karbon sheets stage words" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en de" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Flo G 2012-09-20 08:41:43 UTC
Created attachment 80601 [details]
output of lspci -vvv
Comment 3 Flo G 2012-09-20 09:30:27 UTC
Created attachment 80611 [details]
dmesg output before inserting efivars module

I just saw that this info was missing in the other dmesg output.
Comment 4 Matt Fleming 2012-09-21 15:16:13 UTC
Unfortunately I suspect that the implementation of GetNextVariableName() in your firmware is broken (likely) or efibootmgr failed at a bad time and did something funky with your variable store (unlikely), which is why you're seeing the efivars code loop.

If possible, I'd try go into the BIOS menu on startup and see if you can delete the boot entry that you added. Otherwise, if you've got the 'setvar' command available to you at the UEFI shell you might want to try something like,

    'setvar <BOOT VARIABLE NAME> data='

which should delete the variable.

I've actually got a HP EliteBook here so I'll try and recreate this bug. If it is a bug in the firmware then we'll probably have to add some kind of a workaround to efivars.
Comment 5 Flo G 2012-09-23 13:51:22 UTC
UEFI shell fails to start - it just displays a white cursor on a black screen not responding to any input. (The EDK2 version does not support my hardware I think)

I also can't see any way to set the entry in the BIOS menu - only hardware boot order, but not the UEFI entries...

Maybe there is a way to just completely wipe all the entries and then recreate the ones I need?
Comment 6 Matt Fleming 2012-09-29 20:01:01 UTC
Created attachment 81531 [details]
Abort GetNextVariableName() if we start seeing duplicate entries

This patch should at least get your kernel booting again. I'd then attempt to delete the Boot00* variables from /sys/firmware/efi/vars/ if possible.
Comment 7 Flo G 2012-10-01 11:50:31 UTC
I suspect the first entry is the problem:

Boot-0 !8be4df61-93ca-11d2-aa0d-00e098032b8c/
Boot0005-8be4df61-93ca-11d2-aa0d-00e098032b8c/
Boot0006-8be4df61-93ca-11d2-aa0d-00e098032b8c/
Boot0007-8be4df61-93ca-11d2-aa0d-00e098032b8c/
Boot0008-8be4df61-93ca-11d2-aa0d-00e098032b8c/
Comment 8 Flo G 2012-10-01 11:55:51 UTC
cat /sys/firmware/efi/vars/Boot-0\ \!8be4df61-93ca-11d2-aa0d-00e098032b8c/*
EFI_VARIABLE_NON_VOLATILE
EFI_VARIABLE_BOOTSERVICE_ACCESS
EFI_VARIABLE_RUNTIME_ACCESS
8be4df61-93ca-11d2-aa0d-00e098032b8c
��+� !a���ʓ��
0xa

cat /sys/firmware/efi/vars/Boot0005-8be4df61-93ca-11d2-aa0d-00e098032b8c/*
EFI_VARIABLE_NON_VOLATILE
EFI_VARIABLE_BOOTSERVICE_ACCESS
EFI_VARIABLE_RUNTIME_ACCESS
Notebook Upgrade Bay	�8be4df61-93ca-11d2-aa0d-00e098032b8c
Notebook Upgrade Bay	�0x84
Comment 9 Flo G 2012-10-01 12:04:40 UTC
How can I delete the entry?
Comment 10 Matt Fleming 2012-10-03 10:47:05 UTC
You should be able to use efibootmgr to delete entries.

Something like, efibootmgr -B -b <bootnum>
Comment 11 Flo G 2012-10-04 08:00:58 UTC
Created attachment 82041 [details]
dmesg output with patch applied
Comment 12 Flo G 2012-10-04 09:03:37 UTC
But efibootmgr doesn't list the faulty first entry.

# efibootmgr 
Boot0005* Notebook Upgrade Bay
Boot0006* Windows Boot Manager
Boot0007* Gentoo Linux A
Boot0008* ubuntu

So how do I delete the "Boot-0 !8be4df61-93ca-11d2-aa0d-00e098032b8c/" entry, which causes the trouble?
Comment 13 Flo G 2012-10-12 16:20:18 UTC
I've deleted the other entries, but still no way to fix the problem...
Comment 14 Matt Fleming 2012-10-16 12:25:05 UTC
Which entries have you deleted? Do you still need a way to delete the Boot-0 entry? If so you could try out the new efivarfs file system that is available on the 'next' branch here, git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git

mount it with: mount -t efivarfs none /sys/firmware/efi/efivars
and use rm to delete /sys/firmware/efi/efivars/Boot-0*
Comment 15 Flo G 2012-10-17 11:41:43 UTC
(In reply to comment #14)

> Which entries have you deleted?

The ones I was able to: Boot0005 to Boot0008


> mount it with: mount -t efivarfs none /sys/firmware/efi/efivars
> and use rm to delete /sys/firmware/efi/efivars/Boot-0*

After I applied the "Abort GetNextVariableName() if we start seeing duplicate entries"-patch, I was able to delete the "Boot-0 ..." entry.

Now I'm up and running again. Thx!
Comment 16 Matt Fleming 2012-10-17 11:54:33 UTC
That's good news. Thanks for your persistence.

Am I correct in thinking that you have no Boot* variables now? Presumably you also no longer see any messages in dmesg about duplicate EFI variables?

Could you try using efibootmgr to install a boot variable again and see what happens? I'm trying to work out whether the patch in this thread needs to go to mainline or whether it was just a freak accident that caused the bogus entry to be created.
Comment 17 Flo G 2012-10-18 11:15:46 UTC
After deleting the last Boot* entry and rebooting the default entries were recreated, those are:

Boot0000* Notebook Hard Drive
Boot0001* Notebook Upgrade Bay
Boot0002* Notebook Ethernet
Boot0003* USB Hard Drive
Boot0004* USB Hard Drive
Boot0005* SD Card


And I was also able to install a new boot entry with efibootmgr (this was on an unpatched 3.6.2-kernel):

# efibootmgr 
BootCurrent: 0006
Timeout: 0 seconds
BootOrder: 0006,0001,0004,0000
Boot0000* Notebook Hard Drive
Boot0001* Notebook Upgrade Bay
Boot0002* Notebook Ethernet
Boot0003* USB Hard Drive
Boot0004* USB Hard Drive
Boot0005* SD Card
Boot0006* gentoo


But although the "Boot-0 !..." has respawned, it seems to cause no problems with an unpatched kernel:

# ls /sys/firmware/efi/vars/
ADMIN_POLICY-6fb5dfea-69cf-429e-b78f-8fa59bb41d5e
AcpiGlobalVariable-af9ffd67-ec10-488a-9dfc-6cbf5ee22c2e
AutoDriveLockSecData-05299c28-3941-4c22-386b-7516e5666f8b
BIOSAdminScanCode-29c59d66-f2b4-435e-9a75-e5e6e4973c22
BiosUser00-29c59d66-f2b4-435e-9a75-e5e6e4973c22
BiosUser01-29c59d66-f2b4-435e-9a75-e5e6e4973c22
BiosUser02-29c59d66-f2b4-435e-9a75-e5e6e4973c22
BiosUser03-29c59d66-f2b4-435e-9a75-e5e6e4973c22
BiosUser04-29c59d66-f2b4-435e-9a75-e5e6e4973c22
Boot-0 !8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0001-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0002-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0003-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0004-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0005-8be4df61-93ca-11d2-aa0d-00e098032b8c
Boot0006-8be4df61-93ca-11d2-aa0d-00e098032b8c
BootCurrent-8be4df61-93ca-11d2-aa0d-00e098032b8c
BootOrder-8be4df61-93ca-11d2-aa0d-00e098032b8c
ConIn-8be4df61-93ca-11d2-aa0d-00e098032b8c
ConInDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
ConOut-8be4df61-93ca-11d2-aa0d-00e098032b8c
ConOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
ConsoleLock-368cda0d-cf31-4b9b-8cf6-e7d1bfff157e
ErrOutDev-8be4df61-93ca-11d2-aa0d-00e098032b8c
KbcVersion-8be4df61-93ca-11d2-aa0d-00e098032b8c
Lang-8be4df61-93ca-11d2-aa0d-00e098032b8c
LangCodes-8be4df61-93ca-11d2-aa0d-00e098032b8c
MTC-eb704011-1402-11d3-8e77-00a0c969723b
MeBiosExtensionSetup-1bad711c-d451-4241-b1f3-8537812e0c70
PwRecData00-29c59d66-f2b4-435e-9a75-e5e6e4973c22
PwRecData01-29c59d66-f2b4-435e-9a75-e5e6e4973c22
PwRecData02-29c59d66-f2b4-435e-9a75-e5e6e4973c22
PwRecData03-29c59d66-f2b4-435e-9a75-e5e6e4973c22
PwRecData04-29c59d66-f2b4-435e-9a75-e5e6e4973c22
QuickLookBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c
SYSTEM_POLICY_NAME-6fb5dfea-69cf-429e-b78f-8fa59bb41d5e
SmmS3NvsData-8983fd2d-113c-4e2b-8f47-0abfeb20a41a
TempBIOSAdminScancode-29c59d66-f2b4-435e-9a75-e5e6e4973c22
Timeout-8be4df61-93ca-11d2-aa0d-00e098032b8c
USER_POLICY-6fb5dfea-69cf-429e-b78f-8fa59bb41d5e
VPROState-a82471a8-e491-42c1-9240-4fde3073c0fd
del_var
dump-type0-1-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-10-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-11-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-2-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-3-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-4-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-5-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-6-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-7-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-8-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
dump-type0-9-1336463270-cfc8fc79-be2e-4ddc-97f0-9f98bfe298a0
mAsfBootOptionsNVRAM-c2a2fb8a-cf40-4cfd-b9e6-146a3cf758b2
new_var


SO I would vote for freak... But I'll try to reproduce. Unfortunately I don't have the command in my history since it froze my system and did not write it down, as I did not realize the trouble it would cause at the time.
Comment 18 Flo G 2012-10-18 11:17:01 UTC
Created attachment 83831 [details]
dmesg output after removing the "Boot-0 !..."-entry
Comment 19 Flo G 2013-03-18 16:47:36 UTC
This came up again after trying to install Windows 8. Again efi-shell and OSs with build in efivars / auto loading efivars fail to start.

modprobe efivars results in the following dmesg output:

[  983.140422] ------------[ cut here ]------------
[  983.140424] WARNING: at lib/kobject.c:196 kobject_add_internal+0x1f4/0x210()
[  983.140425] Hardware name: HP EliteBook 8530w
[  983.140426] kobject_add_internal failed for TempBIOSAdminScancode-29c59d66-f2b4-435e-9a75-e5e6e4973c22 with -EEXIST, don't try to register things with the same name in the same directory.
[  983.140427] Modules linked in: efivars(+) snd_hda_codec_analog nvidia(PO) iwldvm led_class mac80211 snd_hda_intel snd_hda_codec snd_pcm iwlwifi snd_page_alloc snd_timer snd cfg80211 soundcore e1000e
[  983.140434] Pid: 7854, comm: modprobe Tainted: P        W  O 3.8.3-gentoo-r1 #1
[  983.140435] Call Trace:
[  983.140438]  [<ffffffff81085d99>] ? warn_slowpath_common+0x79/0xc0
[  983.140440]  [<ffffffff81085e95>] ? warn_slowpath_fmt+0x45/0x50
[  983.140442]  [<ffffffff811a7553>] ? sysfs_create_dir+0x83/0xe0
[  983.140444]  [<ffffffff813a3834>] ? kobject_add_internal+0x1f4/0x210
[  983.140446]  [<ffffffff813a3c69>] ? kobject_init_and_add+0x69/0xa0
[  983.140448]  [<ffffffff81137899>] ? kmem_cache_alloc+0xb9/0xc0
[  983.140451]  [<ffffffffa002db5c>] ? efivar_create_sysfs_entry+0x11c/0x1d0 [efivars]
[  983.140454]  [<ffffffffa002defd>] ? register_efivars+0x14d/0x470 [efivars]
[  983.140456]  [<ffffffffa0033000>] ? 0xffffffffa0032fff
[  983.140458]  [<ffffffffa00330b5>] ? efivars_init+0xb5/0x104 [efivars]
[  983.140460]  [<ffffffff810002e2>] ? do_one_initcall+0x122/0x170
[  983.140463]  [<ffffffff810d2303>] ? load_module+0x16c3/0x1d10
[  983.140465]  [<ffffffff810cea60>] ? sys_getegid16+0x40/0x40
[  983.140467]  [<ffffffff8166dee2>] ? page_fault+0x22/0x30
[  983.140469]  [<ffffffff810d29f4>] ? sys_init_module+0xa4/0xd0
[  983.140471]  [<ffffffff8166e416>] ? system_call_fastpath+0x1a/0x1f
[  983.140473] ---[ end trace 015611c27af3dd18 ]---
[  983.145528] ------------[ cut here ]------------
[  983.145532] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0xc3/0xf0()
[  983.145533] Hardware name: HP EliteBook 8530w
[  983.145534] sysfs: cannot create duplicate filename '/firmware/efi/vars/BIOSAdminScanCode-29c59d66-f2b4-435e-9a75-e5e6e4973c22'
[  983.145535] Modules linked in: efivars(+) snd_hda_codec_analog nvidia(PO) iwldvm led_class mac80211 snd_hda_intel snd_hda_codec snd_pcm iwlwifi snd_page_alloc snd_timer snd cfg80211 soundcore e1000e
[  983.145544] Pid: 7854, comm: modprobe Tainted: P        W  O 3.8.3-gentoo-r1 #1
[  983.145545] Call Trace:
[  983.145548]  [<ffffffff81085d99>] ? warn_slowpath_common+0x79/0xc0
[  983.145551]  [<ffffffff81085e95>] ? warn_slowpath_fmt+0x45/0x50
[  983.145553]  [<ffffffff811a6fe3>] ? sysfs_add_one+0xc3/0xf0
[  983.145554]  [<ffffffff811a71f2>] ? create_dir+0x72/0xd0
[  983.145556]  [<ffffffff811a7553>] ? sysfs_create_dir+0x83/0xe0
[  983.145558]  [<ffffffff813af0d7>] ? kvasprintf+0x77/0xa0
[  983.145560]  [<ffffffff813a36d5>] ? kobject_add_internal+0x95/0x210
[  983.145562]  [<ffffffff813a3c69>] ? kobject_init_and_add+0x69/0xa0
[  983.145565]  [<ffffffff81137899>] ? kmem_cache_alloc+0xb9/0xc0
[  983.145568]  [<ffffffffa002db5c>] ? efivar_create_sysfs_entry+0x11c/0x1d0 [efivars]
[  983.145571]  [<ffffffffa002defd>] ? register_efivars+0x14d/0x470 [efivars]
[  983.145573]  [<ffffffffa0033000>] ? 0xffffffffa0032fff
[  983.145576]  [<ffffffffa00330b5>] ? efivars_init+0xb5/0x104 [efivars]
[  983.145578]  [<ffffffff810002e2>] ? do_one_initcall+0x122/0x170
[  983.145581]  [<ffffffff810d2303>] ? load_module+0x16c3/0x1d10
[  983.145583]  [<ffffffff810cea60>] ? sys_getegid16+0x40/0x40
[  983.145585]  [<ffffffff8166dee2>] ? page_fault+0x22/0x30
[  983.145588]  [<ffffffff810d29f4>] ? sys_init_module+0xa4/0xd0
[  983.145590]  [<ffffffff8166e416>] ? system_call_fastpath+0x1a/0x1f
[  983.145591] ---[ end trace 015611c27af3dd19 ]---
Comment 20 Matt Fleming 2013-03-18 17:02:08 UTC
There's a fix for this here, which should make it to Linus for v3.9-rc4,

http://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit/?h=urgent&id=544a6c06479e4ea4e7acc7eea589a82f0ff9aa6d
Comment 21 Flo G 2013-03-18 21:16:47 UTC
Created attachment 95781 [details]
dmesg

This is what happens when I insert the efivars module unsing the latest git sources from git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git
Comment 22 Matt Fleming 2013-03-18 22:00:03 UTC
Which branch did you build? I've just pushed an update to the 'master' branch. Please verify that you see "efivars: duplicate variable" in dmesg.
Comment 23 Flo G 2013-03-19 12:29:53 UTC
I pulled the latest update and it's fine now. I really appreciate this to land in mainline... Thanks for the effort!
Comment 24 Matt Fleming 2013-05-02 12:28:23 UTC
v3.9 has been released and includes this fix and has been pulled into stable.

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