Fails on unusual mounted filesystems

Bug #1961118 reported by Robert Reitz
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
efitools (Ubuntu)
New
Undecided
Unassigned

Bug Description

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.

Tags: patch
Revision history for this message
Robert Reitz (robret77) wrote :
description: updated
Robert Reitz (robret77)
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "mountfix workaround" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
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.