"No efivarfs filesystem is mounted" error when running efi-readvar

Bug #1551074 reported by James Johnston
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
efitools (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When running efi-readvar with no parameters, I get this error:

No efivarfs filesystem is mounted

This tool is totally broken for me and I cannot use it.

Yet, mount -l shows that it is mounted:

<snip>
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
<snip>

It appears that this is a known bug with efitools: https://bugs.gentoo.org/show_bug.cgi?id=511728
And a patch made for it here: https://bugs.gentoo.org/attachment.cgi?id=377792&action=diff

I am running Ubuntu 15.10. Version of package installed is 1.4.2+git20140118-0ubuntu1.

Please consider, at minimum, getting this patch into Xenial and ideally into Wily?

--- a/lib/kernel_efivars.c
+++ a/lib/kernel_efivars.c
@@ -66,10 +66,10 @@ kernel_variable_init(void)
  while (ptr < buf + st.st_size) {
   int count;

- sscanf(ptr, "%*s on %s type %s %*s\n%n", path, type, &count);
+ sscanf(ptr, "%*s on %s type %s %*[^\n]\n%n", path, type, &count);
   ptr += count;
- if (strcmp(type, "efivarfs") != 0)
- continue;
+ if (strcmp(type, "efivarfs") == 0)
+ break;
  }
  if (strcmp(type, "efivarfs") != 0) {
   fprintf(stderr, "No efivarfs filesystem is mounted\n");

Revision history for this message
James Johnston (mail-codenest) wrote :

FYI, full output of mount -l on my system:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=3039364k,nr_inodes=759841,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=611104k,mode=755)
/dev/mapper/sda3_crypt on / type btrfs (rw,relatime,ssd,space_cache,subvolid=257,subvol=/@) [Root0Label]
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,clone_children)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=23,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda2 on /boot type btrfs (rw,relatime,ssd,space_cache,subvolid=5,subvol=/) [Boot0Label]
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mapper/sda3_crypt on /home type btrfs (rw,relatime,ssd,space_cache,subvolid=258,subvol=/@home) [Root0Label]
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=611104k,mode=700)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=611104k,mode=700,uid=1000,gid=1000)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in efitools (Ubuntu):
status: New → Confirmed
Revision history for this message
QkiZ (qkiz) wrote :

Ubuntu 16.10 here. Same error. Now trying to compile efitools with patch that you submitted.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.