Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568956 - =sys-boot/grub-2.02_beta2-r8 GRUB_PLATFORMS="efi-64": grub-install fails with "efibootmgr: option requires an argument -- 'd'"
Summary: =sys-boot/grub-2.02_beta2-r8 GRUB_PLATFORMS="efi-64": grub-install fails with...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Gilbert
URL: https://savannah.gnu.org/bugs/index.p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-21 08:32 UTC by Tomáš Mózes
Modified: 2021-01-20 06:31 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
grub.log.xz (grub.log.xz,15.83 KB, application/x-xz)
2015-12-22 16:08 UTC, Tomáš Mózes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomáš Mózes 2015-12-21 08:32:21 UTC
# grub2-install --target=x86_64-efi --efi-directory=/boot/efi /dev/sda
Installing for x86_64-efi platform.
efibootmgr: EFI variables are not supported on this system.
efibootmgr: option requires an argument -- 'd'
efibootmgr version 0.12
usage: efibootmgr [options]
        -a | --active         sets bootnum active
        -A | --inactive       sets bootnum inactive
        -b | --bootnum XXXX   modify BootXXXX (hex)
        -B | --delete-bootnum delete bootnum (hex)
        -c | --create         create new variable bootnum and add to bootorder
        -C | --create-only      create new variable bootnum and do not add to bootorder
        -D | --remove-dups      remove duplicate values from BootOrder
        -d | --disk disk       (defaults to /dev/sda) containing loader
        -e | --edd [1|3|-1]   force EDD 1.0 or 3.0 creation variables, or guess
        -E | --device num      EDD 1.0 device number (defaults to 0x80)
        -g | --gpt            force disk with invalid PMBR to be treated as GPT
        -i | --iface name     create a netboot entry for the named interface
        -l | --loader name     (defaults to \EFI\redhat\grub.efi)
        -L | --label label     Boot manager display label (defaults to "Linux")
        -n | --bootnext XXXX   set BootNext to XXXX (hex)
        -N | --delete-bootnext delete BootNext
        -o | --bootorder XXXX,YYYY,ZZZZ,...     explicitly set BootOrder (hex)
        -O | --delete-bootorder delete BootOrder
        -p | --part part        (defaults to 1) containing loader
        -q | --quiet            be quiet
        -t | --timeout seconds  set boot manager timeout waiting for user input.
        -T | --delete-timeout   delete Timeout.
        -u | --unicode | --UCS-2  pass extra args as UCS-2 (default is ASCII)
        -v | --verbose          print additional information
        -V | --version          return version and exit
        -w | --write-signature  write unique sig to MBR if needed
        -@ | --append-binary-args file  append extra args from file (use "-" for stdin)
        -h | --help             show help/usage
Installation finished. No error reported.

# zcat /proc/config.gz  | grep -i efi
CONFIG_EFI_PARTITION=y
CONFIG_EFI=y
# CONFIG_EFI_STUB is not set
CONFIG_FB_EFI=y
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
# EFI (Extensible Firmware Interface) Support
CONFIG_EFI_VARS=y
CONFIG_EFI_RUNTIME_MAP=y
CONFIG_EFIVAR_FS=y
CONFIG_EARLY_PRINTK_EFI=y

# fdisk -l /dev/sda
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: ECF92001-A210-4575-B83C-6D8CFBE46E47

Device        Start        End    Sectors   Size Type
/dev/sda1      2048     976895     974848   476M EFI System
/dev/sda2    976896   20508671   19531776   9.3G Linux filesystem
/dev/sda3  20508672 1953523711 1933015040 921.8G Linux LVM


Portage 2.2.20.1 (python 3.4.3-final-0, default/linux/amd64/13.0, gcc-4.8.5, glibc-2.20-r2, 3.14.53-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.14.53-gentoo-x86_64-Intel-R-_Core-TM-_i7-4770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:     3590552 total,   1291104 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 21 Dec 2015 02:45:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10::gentoo, 3.4.3::gentoo
dev-util/cmake:           2.8.12.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.12.6::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.8.5::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-mtune=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://tux.rainside.sk/gentoo/ http://gentoo.wheel.sk/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv mmx mmxext modules multilib ncurses nptl openmp pam pcre readline seccomp session sse sse2 ssl tcpd unicode xattr zlib" ABI_X86="64" 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" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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 ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

sys-boot/grub-2.02_beta2-r8::gentoo was built with the following:
USE="fonts multislot themes -debug -device-mapper -doc -efiemu (-libzfs) -mount -nls -sdl -static -test -truetype" ABI_X86="64" GRUB_PLATFORMS="efi-64 -coreboot -efi-32 -emu -ieee1275 -loongson -multiboot -pc -qemu -qemu-mips -uboot -xen"
CFLAGS=""
LDFLAGS=""

sys-boot/efibootmgr-0.12::gentoo was built with the following:
USE="" ABI_X86="64"
Comment 1 Tomáš Mózes 2015-12-21 08:44:37 UTC
I have two disks - /dev/sda and /dev/sdb in software raid (mdadm).
Comment 2 Mike Gilbert gentoo-dev 2015-12-21 16:10:20 UTC
> efibootmgr: EFI variables are not supported on this system.

Do you have efivarfs mounted? openrc and systemd should do this automatically if your kernel has it enabled.

# grep /var/sys/firmware/efi/efivars /proc/self/mounts
Comment 3 Mike Gilbert gentoo-dev 2015-12-21 16:11:02 UTC
(In reply to Mike Gilbert from comment #2)
> # grep /var/sys/firmware/efi/efivars /proc/self/mounts

Sorry that should be:

# grep /sys/firmware/efi/efivars /proc/self/mounts
Comment 4 Mike Gilbert gentoo-dev 2015-12-21 16:17:01 UTC
Also, where is your EFI system partition mounted?
Comment 5 Tomáš Mózes 2015-12-22 09:22:54 UTC
Hello Mike,
1) I don't see efivars mounted.
2) Since this was my first efi install, it's not installed the best way. The whole /boot is under raid (/dev/sda1 and /dev/sdb1) as a vfat filesystem.

This machine was installed like a year ago, it worked back then, seems like a combination of grub/efibootmgr somewhat got broken because grub does not pull in the "-d" parameter to efibootmgr (--disk).

Seems like:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1466150
Comment 6 Mike Gilbert gentoo-dev 2015-12-22 15:46:33 UTC
Can you attach a debug log? You can generate it like this:

grub2-install --target=x86_64-efi --debug > grub-install.log 2>&1

I suspect you will need to ask grub upstream for help on this, but I can take a look at the log anyway.
Comment 7 Tomáš Mózes 2015-12-22 16:08:49 UTC
Created attachment 420296 [details]
grub.log.xz

Output of:

grub2-install --target=x86_64-efi --efi-directory=/boot/efi --debug /dev/sda
Comment 8 Mike Gilbert gentoo-dev 2015-12-22 17:32:21 UTC
(In reply to Tomáš Mózes from comment #7)
> grub2-install --target=x86_64-efi --efi-directory=/boot/efi --debug /dev/sda

Just FYI, the "/dev/sda" on the end of your command line does not mean anything when calling grub2-install --target=x86_64-efi. You can drop that and you will get the same result.
Comment 9 Mike Gilbert gentoo-dev 2015-12-22 17:34:24 UTC
Anyway, yes, it seems like mdraid is confusing grub2-install here. You will need to seek help upstream.
Comment 10 Tomáš Mózes 2016-01-04 05:59:12 UTC
Thanks Mike for the help, will try upstream.