efivarfs isn't managed correctly
hscript/meta.cc:859:
if(mount("efivarfs", efipath.c_str(), "efivarfs", MS_NOEXEC |
MS_NODEV | MS_NOSUID | MS_RELATIME, nullptr) != 0) {
We need to use MS_REMOUNT
if efivarfs is already mounted. However, sometimes it isn't mounted, especially if Horizon is running in a chroot or from non-Adélie media. In fact, we dropped MS_REMOUNT
in bad8487c because it wasn't mounted at all on the ThinkPad being used for EFI testing.
What we really need to do is:
- Check if
efipath
is a mount point or not. (Probably should check if it's even extant.) - If not, make the above mount call (no change).
- If it is, use
mount_setattr(2)
to clearMS_RDONLY
. Unfortunately, that is only available as a raw syscall.