You are not logged in.

#1 2013-08-15 21:59:46

davidjosepha
Member
Registered: 2013-02-21
Posts: 54

[Solved]UEFI motherboard with legacy mode disabled, but not in EFI mod

I think I'm in EFI mode. My BIOS is configured to only boot in UEFI mode. Compatibility mode is turned off. When I boot to the Arch install disc, the option for installation is "Arch Linux archiso x86_64 UEFI CD". When I type "ls -1 /sys/firmware/efi" it returns "efivars/" and "systab". However, when I go to install EFISTUB and run this command...

# pacman -S efibootmgr
# efibootmgr -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/sdaX rw initrd=/initramfs-linux.img"

...I get the error:

Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root

Running 'modprobe efivars' doesn't appear to do anything either.

I've googled the error and most of the things I've seen say that it means I'm not in EFI mode, but everything else I've checked makes me think I am. I tried GRUB and it returned the same error. Gummiboot had a different error that I do not remember.

Any ideas?

Edit: Okay, for some reason, the third time I did modprobe efivars, it did something. No idea why it didn't display anything the first two times...

Now, Arch Linux shows up on my boot menu! Awesome! But when I select it, my screen goes black for a second, then goes back to the boot menu. Any ideas on why that might be?

Edit: Tried installing grub since that wasn't working, and grub created a menu item, and it loads. But then when I select to load Arch from that, I get an error:

error: no such device: {{my UUID}}
Loading Linux core repo kernel ...
error: no such partition
Loading initial ramdisk ...
unaligned pointer 0x22
Aborted. Press any key to exit

Edit: Solved! Had to run #grub-mkconfig -o /boot/grub/grub.cfg and then it worked fine.

Last edited by davidjosepha (2013-08-15 22:38:00)

Offline

#2 2013-08-16 14:26:17

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: [Solved]UEFI motherboard with legacy mode disabled, but not in EFI mod

For any userspace tool that requires access to EFI Variables data in kernel, the following conditions should be satisfied:

1. EFI Runtime Services support should be present in the kernel (CONFIG_EFI=y).
2. Kernel processor bitness/arch and EFI processor bitness/arch should match.
3. Kernel should be booted in EFI mode (via EFISTUB or any EFI bootloader, not via bootcamp or BIOS/CSM)
4. EFI Runtime Services in the kernel SHOULD NOT be disabled via kernel cmdline, i.e. "noefi" kernel parameter SHOULD NOT be used.

Now the kernel exposes EFI data to userspace in 2 ways, via sysfs-efivars (efivars kernel module, /sys/firmware/efi/vars) which is not recommended by kernel devs, and another via efivarfs (efivarfs kernel module, /sys/firmware/efi/efivars) that was designed to overcome the limitations of sysfs-efivars interface. efivarfs was introduced in kernel 3.8 and most of its bugs were ironed out in kernel 3.10 . Subsequently till kernel 3.9.X, sysfs-efivars was built-in in the Arch's core/linux kernel. However since core/linux 3.10 efivarfs is built-in and efivars is again a separate module.

Gummiboot (/usr/bin/gummiboot), systemd, all tools that modify UEFI Secure Boot stuff use only efivarfs. AFAIK only efibootmgr (currently) uses sysfs-efivars. Running both sysfs-efivars and efivarfs can create inconsistencies in EFI variables data in the kernel and is discouraged. Going forward efivarfs is the recommended way for tools to intercat with kernel reg EFI variables.

@davidjosepha: The problem seems to be documentation that ignores the "modprobe efivars" step (assuming sysfs-efivars to be built-in the kernel).

EDIT: Info added to https://wiki.archlinux.org/index.php/Un … k_properly .

Last edited by the.ridikulus.rat (2013-08-16 17:39:45)

Offline

#3 2013-08-16 16:17:43

davidjosepha
Member
Registered: 2013-02-21
Posts: 54

Re: [Solved]UEFI motherboard with legacy mode disabled, but not in EFI mod

Thanks for the detailed reply! Two more (related) things, if anyone knows. How can I remove the "Arch Linux" from my boot menu that I added that doesn't work? I added it with this command:

# efibootmgr -c -L "Arch Linux" -l /vmlinuz-linux -u "root=/dev/sdaX rw initrd=/initramfs-linux.img"

And second, how can I rename "arch_grub" to "Arch Linux" on my boot menu?

Thanks a bunch! This is my second install of Arch (and went tons smoother than my first, probably cause the first was on a Mac) and I love how great, knowledgeable, and helpful the community is. Having such an in depth wiki is great for inexperienced linux users like me who want to get in over their head, but not too far.

Offline

Board footer

Powered by FluxBB