Created attachment 377792 [details, diff] Patch to fix "mount -l" parsing in kernel_variable_init() function Hello efitools v1.4.2 has two serious bugs, which have fixes commited in git upstream but not yet available in a release tarball. Both affect the kernel_variable_init() function, which attempts to parse the output of "mount -l" to determine the path of the efivarfs filesystem. If this call fails, none of the efitools functions will work. The two problems are: 1) Unless the efivarfs filesystem is the last line reported by mount -l, it will not be detected (fixed by commit 9af07a90a3e2246be5a7d01e3a037cfa731eb5dc upstream); and 2) If LVM is in use, mount -l can display an extra field in the output (such as '[root]', '[home]' etc) which messes up the parsing (fixed by commit c33fc28e6be00ac0bfae7fcff48170830a4730d8 upstream) I have created a patch file (attached) which applies these commits from the 1.4.2 baseline, and a modified ebuild (as r2, also attached), which applies the patch (has eutils inherited, so that src_prepare() can call epatch()/epatch_user()). It passes repoman full. The patch should go at the top level in the files/ directory, as usual. If this bug report or the ebuild is in an incorrect format, apologies, this is my first submission! Best sakaki
Created attachment 377794 [details] Ebuild modified to apply patch (inherit eutils etc.)
Maybe this could belong to here: When I run "efi-readvar" (efitools (1.4.2-r1) latest in portage). I get the error: "No efivarfs filesystem is mounted" but: I can read the vars by "cat /sys/firmware/efi/efivars/db-.....". and: #lsmod Module Size Used by efivarfs 5294 0 #cat /etc/fstab efivarfs /sys/firmware/efi/efivars efivarfs rw,relatime 0 0 #mount ... efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,relatime) ... Kernel: 3.16.5-aufs I git compiled latest efitools (seems version is 1.5.1) which does work for me now. I dont know whats causeing this nor how to fix it.
Very similar situation as paul g., my kernel is an hardened monolithic (latest longterm) and I can see the efivars in /sys/firmware/efi/efivars without needing to setup /etc/fstab, as the efivarfs is automatically managed by /etc/init.d/sysfs . # zgrep EFI /proc/config.gz | grep VAR | grep -v ^# CONFIG_EFI_VARS=y CONFIG_EFI_VARS_PSTORE=y CONFIG_EFIVAR_FS=y # uname -r 3.14.29-hardened # mount | grep ^efi efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime) # ls -l /sys/firmware/efi/efivars total 0 -rw-r--r-- 1 root root 8 Jan 29 07:26 AcpiGlobalVariable-af9ffd67-ec10-488a-9dfc-6cbf5ee22c2e -rw-r--r-- 1 root root 85 Jan 29 07:26 AMITSESetup-c811fa38-42c8-4579-a9bb-60e94eddfb34 -rw-r--r-- 1 root root 122 Jan 29 07:26 Boot0002-8be4df61-93ca-11d2-aa0d-00e098032b8c ... # efi-readvar No efivarfs filesystem is mounted # eix efitools [I] app-crypt/efitools Available versions: (~)1.4.1 (~)1.4.1-r1 (~)1.4.1-r2 (~)1.4.2 (~)1.4.2-r1 Installed versions: 1.4.2-r1(07:55:05 AM 01/29/2015) ... A version bump would be nice. Thanks
For a version bump, try the ebuild in bug 533572. I believe the patch mentioned in this ebuild is incorporated in the upstream project now.
(In reply to Gabriel Marcano from comment #4) > For a version bump, try the ebuild in bug 533572. I believe the patch > mentioned in this ebuild is incorporated in the upstream project now. I meant to say the patch mentioned in this bug report.
resolved a while ago.