Public bug reported:

In the context of an automatic preseed / subiquity installation usage of
the efitools fail inside the target chroot provided by the curtin tool.
curtin does setup the sys and efivarfs filesystems correctly:

curtin in-target --target=/target -- efi-readvar
No efivarfs filesystem is mounted

efitools is using the mount util while searching for the efivarfs. It's
parsing the output of "mount -l". This error is not triggered by the
successfully mounted efivarfs but by parsing the mount list while
searching for the efivarfs. The subiquity system provides one relative
unusual mount entry which let the parser of efitools stop working even
if the efivarfs is mounted:

curtin in-target --target=/target -- mount -l
...
/ubuntu-21.10-live-server-amd64.iso (deleted) on /cdrom type iso9660 
(ro,relatime,nojoliet,check=s,map=n,blocksize=2048) [Ubuntu-Server 21.10 amd64]
...
efivarfs on /sys/firmware/efi/efivars type efivarfs 
(rw,nosuid,nodev,noexec,relatime)
...

On the Ubuntu ISO line the keyword "(deleted)" is unsupported by the
parser of efitools in efitools/lib/kernel_efivars.c

I'm not really sure if this is maybe a bug of the mount util, but anyway
it is probably better to skip lines which can not be parsed successfully
instead of stopping work completely.

Attached is a simple and maybe suboptimal patch to skip lines which
doesn't return the expected number of found arguments, which in turn
skips all unexpected lines, so that finally the efivarfs can be found
and the tools like efi-readvar and efi-updatevar are working.

** Affects: efitools (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "mountfix workaround"
   
https://bugs.launchpad.net/bugs/1961118/+attachment/5561484/+files/mountfix.patch

** Description changed:

- In the context of a automatic preseed / subiquity installation usage of
+ In the context of an automatic preseed / subiquity installation usage of
  the efitools fails inside the target chroot provided by the curtin tool.
  curtin does setup the sys and efivarfs filesystems correctly:
  
  curtin in-target --target=/target -- efi-readvar
  No efivarfs filesystem is mounted
  
  efitools is using the mount util while searching for the efivarfs. It's
  parsing the output of "mount -l". This error is not triggered by the
  successfully mounted efivarfs but by parsing the mount list while
  searching for the efivarfs. The subiquity system provides one relative
  unusual mount entry which let the parser of efitools stop working even
  if the efivarfs is mounted:
  
  curtin in-target --target=/target -- mount -l
  ...
  /ubuntu-21.10-live-server-amd64.iso (deleted) on /cdrom type iso9660 
(ro,relatime,nojoliet,check=s,map=n,blocksize=2048) [Ubuntu-Server 21.10 amd64]
  ...
  efivarfs on /sys/firmware/efi/efivars type efivarfs 
(rw,nosuid,nodev,noexec,relatime)
  ...
  
  On the Ubuntu ISO line the keyword "(deleted)" is unsupported by the
  parser of efitools in efitools/lib/kernel_efivars.c
  
  I'm not really sure if this is maybe a bug of the mount util, but anyway
  it is probably better to skip lines which can not be parsed successfully
  instead of stopping work completely.
  
  Attached is a simple and maybe suboptimal patch to skip lines which
  doesn't return the expected number of found arguments, which in turn
  skips all unexpected lines, so that finally the efivarfs can be found
- the the tools like efi-readvar and efi-updatevar are working.
+ and the tools like efi-readvar and efi-updatevar are working.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1961118

Title:
  Fails on unusual mounted filesystems

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/efitools/+bug/1961118/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to