You are not logged in.

#1 2013-08-19 18:29:07

dasty
Member
Registered: 2013-08-19
Posts: 11

arch-chroot and empty efivars

Hi, i have one problem with the last 'archlinux-2013.08.01-dual.iso'.

The problem is:
after the command 'arch-chroot' in the chrooted system '/sys/firmware/efi/efivars' is empty.

- the pc is booted in uefi mode.
- in the system, '/sys/firmware/efi/efivars' is populated.

with previous iso images in 'sys/firmware/efi/' there were two subdirectories:
vars and efivars, both populated.
When chrooted efivars is empty and vars is populated.
In this way grub can install itself.

With the latest iso image (2013.08.01) 'sys/firmware/efi/vars' not exist anymore, and with an empty 'sys/firmware/efi/efivars' i can't install grub.

I tried 'modprobe efivars' in the chrooted system but nothing change.

Some ideas?

Sorry for my bad english.

Offline

#2 2013-08-19 19:00:08

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: arch-chroot and empty efivars

If you chroot in /mnt/arch (for example), then the directory /mnt/arch/sys/firmware/efi/efivars must exists in order to be read in the chroot (chroot do just that: change root, it does not creates files). I do not have efi in this system but type cat /proc/mounts before the chroot and see what directories are mounted. If, what I suspect, /sys/firmware/efi/efivars is a mounted directory, you can try to bind this directory in the chroot with the following command (outside of the chroot):

mount --bind /sys/firmware/efi/efivars /mnt/sys/sys/firmware/efi/efivars

Offline

#3 2013-08-20 12:45:44

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: arch-chroot and empty efivars

Welcome to ArchLinux, Olive is correct, you change root, from one to another.
So if you want to have 'vars' available in chroot, you need to make them available before you chroot.
Now I have never used the command he gives, and don't know if it will work, since the kernel needs the module 'efivars'
Do a 'modprobe efivars', then chroot.
Hope this helps

Offline

#4 2013-08-20 13:24:04

tychicus
Member
Registered: 2013-08-20
Posts: 3

Re: arch-chroot and empty efivars

I'm having the exact same issue (trying to install Arch on a Macbook Pro 9,1).

In the ISO environment, /sys/firmware/efi/efivars is populated (after a modprobe efivars):

$ cat /proc/mounts | grep efivars
efivars /sys/firmware/efi/efivars efivars rw,nosuid,nodev,noexec,relatime 0 0

And /sys/firmware/efi/efivars also contains a bunch of files for the efi variables. Once I chroot into my system the /sys/firmware/efi/efivars directory is empty. However, the mount point is still listed in /proc/mounts in the chroot environment!

olive wrote:

mount --bind /sys/firmware/efi/efivars /mnt/sys/sys/firmware/efi/efivars

If I do this (changing your /mnt/sys/sys/firmware/efi/efivars to /mnt/sys/firmware/efi/vars...was that a typo?) then:

(archiso) # mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
mount: mount point /mnt/sys/firmware/efi/efivars does not exist
(archiso) # mkdir -p /mnt/sys/firmware/efi/efivars
(archiso) # mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
(archiso) # arch-chroot /mnt /bin/bash
(myenv) # ls -l /sys/firmware/efi/efivars
total 0
(myenv) # cat /proc/mounts | grep efivars
efivars /sys/firmware/efi/efivars efivars rw,nosuid,nodev,noexec,relatime 0 0
efivars /sys/firmware/efi/efivars efivars rw,nosuid,nodev,noexec,relatime 0 0

Interestingly, if I bind the /sys/firmware/efi/efivars in the ISO environment to /mnt/efivars, I can then see the EFI variables in /efivars once I chroot. Is something funny happening with chroot that overwrites/overrides the mount binding under /sys/firmware/efi/efivars?

Offline

#5 2013-08-20 13:59:23

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: arch-chroot and empty efivars

tychicus wrote:

However, the mount point is still listed in /proc/mounts in the chroot environment!

Not relevant -- /proc/mounts doesn't respect namespaces and subroots. Use /proc/self/mountinfo (from the chrooted shell) if you want an accurate portrayal of what's mounted in the chroot.

Offline

#6 2013-08-20 14:33:02

tychicus
Member
Registered: 2013-08-20
Posts: 3

Re: arch-chroot and empty efivars

falconindy wrote:
tychicus wrote:

However, the mount point is still listed in /proc/mounts in the chroot environment!

Not relevant -- /proc/mounts doesn't respect namespaces and subroots. Use /proc/self/mountinfo (from the chrooted shell) if you want an accurate portrayal of what's mounted in the chroot.

Okay that makes sense then. Looking at /proc/self/mountinfo from the chrooted shell (without having mounted /sys/firmware/efi/efivars to a chroot directory) I don't see efivars. But if I

mount --bind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars

and then chroot, it shows up in /proc/self/mountinfo even though the directory is still empty.  Here's a subset of /proc/self/mountinfo:

..
46 43 0:21 / /sys/firmware/efi/efivars rw,nosuid,nodev,noexec,relatime shared:11 - efivars efivars rw
..
48 43 0:13 / /sys rw,nosuid,nodev,noexec,relatime shared:34 - sysfs sysfs rw
..

Is the ordering important such that since the /sys mount comes after the /sys/firmware/efi/efivars it clobbers it, being a directory starting higher in the tree?

EDIT: I just noticed something that may or may not be of importance. In the ISO environment, /sys/firmware/efi/vars contains a directory for each EFI variable, and those directories each have 5 files: attributes, data, guid, raw_var, and size. The /sys/firmware/efi/efivars directory contains regular files (as far as I can tell) for each of those variables. In my chroot environment, even without having done a mount --bind on the efivars directory, /sys/firmware/efi/vars is populated with regular files for each of the EFI variables.

Last edited by tychicus (2013-08-20 15:17:40)

Offline

#7 2013-08-20 16:33:29

dasty
Member
Registered: 2013-08-19
Posts: 11

Re: arch-chroot and empty efivars

A very nice welcome, thanx at all.

I can only confirm everything that has been written in the last posts.

The only quick workaround to permit the installation for me now is:

mkdir /mnt/efivars-temp
mount --bind /sys/firmware/efi/efivars /mnt/efivars-temp
arch-chroot /mnt
mount --bind /efivars-temp /sys/firmware/efi/efivars

In this way i can have efivars populated and grub-install.... !WORK.

I believe, however, that would be preferable to find a real solution.

My knowledge is too limited to find a solution by myself,
but since I'm installing I can do some tests if anyone has any suggestions.

Offline

#8 2013-08-20 16:41:36

progandy
Member
Registered: 2012-05-17
Posts: 5,200

Re: arch-chroot and empty efivars

arch-chroot does most of the mounting already, but it is missing the efi mount. Currently it mounts e.g. sys to /mnt/sys. As a result, the efi vars are not remounted and everything you mounted below /mnt/sys will be hidden.
You should add a bugreport and ask to add the efimount to arch-chroot.

Last edited by progandy (2013-08-20 16:42:40)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2013-08-20 17:33:02

dasty
Member
Registered: 2013-08-19
Posts: 11

Re: arch-chroot and empty efivars

progandy wrote:

arch-chroot does most of the mounting already, but it is missing the efi mount. Currently it mounts e.g. sys to /mnt/sys. As a result, the efi vars are not remounted and everything you mounted below /mnt/sys will be hidden.
You should add a bugreport and ask to add the efimount to arch-chroot.

Mhh. Two little questions (i'm very new to this)
1) Should i mark solved or partially solved my questions ?
2) Where i can find information how to open a bugreport?

Offline

#10 2013-08-20 17:33:04

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: arch-chroot and empty efivars

There is now two different mechanisms in the kernel that can handle the UEFI firmware from userspace.  The old method is efivarfs, which is what populates /sys/firmware/efi/efivars.  But the new method is sysfs-efivars, which populates /sys/firmware/efi/vars.  Because the new way seems to be the standard by which things tend to be heading, the Arch kernel compiles the sysfs-efivars support into it.  The efivarfs support is now a module.   The problem is that efibootmgr still uses efivarfs.  So you will need to switch back to that in order to get things working properly.  The caveat is that you should, under no circumstances, have both methods enabled at the same time, as this can confuse the firmware... and confused firmware is bad.

See the wik page on UEFI, as it has been pretty much rewritten from top to bottom by the.ridikulus.rat just the other day, and provides more detail about this situation.

Offline

Board footer

Powered by FluxBB