Hello,
I’m trying to use uefi-fw-tools snap which originally worked on UC16 to verify fwupd behavior on UC18, but unfortunately I got a unknown failure when fwupdmgr did bios update. After some investigations, I find out the differences compared to UC16:
- for UC16, /boot/efi and /boot/grub are mounted on host and also per snap namespace:
$ sudo snap run --shell uefi-fw-tools.fwupdmgr
root@localhost:/var/lib/snapd# mount | grep boot
/dev/sda2 on /var/lib/snapd/hostfs/boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda2 on /var/lib/snapd/hostfs/boot/grub type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda2 on /boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda2 on /boot/grub type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
- for UC18, /boot/efi and /boot/grub are mounted on host but not per snap namespace:
$ sudo snap run --shell uefi-fw-tools.fwupdmgr
root@localhost:/var/lib/snapd/hostfs# mount | grep boot
/dev/sda2 on /var/lib/snapd/hostfs/boot/efi type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda2 on /var/lib/snapd/hostfs/boot/grub type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
We can see /boot/efi and /boot/grub (bind mount on host) both on host, but we can’t see them in the snap namespace, although they indeed exist under the path /var/lib/snapd/hostfs
.
Due to above case, fwupd can’t put firmware file into /boot/efi/EFI/ubuntu/fw because there is no such path in the snap execution environment, so I get stuck here.
Then, I checkout snapd git tree and there are several testing about mount-ns to verify what’s expectation for distro/basis. I suspect there exists the change to explain above phenomenon but I don’t dig into yet, so I’d like to understand my observation has any defect. Furthermore, is it possible to workaround this by adding /boot/efi into mount-support.c like
{"/boot/efi",.is_optional = true},
Any feedback would be appreciated, thanks.