summaryrefslogtreecommitdiff
path: root/hscript/meta.cc
diff options
context:
space:
mode:
Diffstat (limited to 'hscript/meta.cc')
-rw-r--r--hscript/meta.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/hscript/meta.cc b/hscript/meta.cc
index 9ba1b40..c4a4070 100644
--- a/hscript/meta.cc
+++ b/hscript/meta.cc
@@ -868,6 +868,10 @@ bool Bootloader::execute() const {
if(errno == EBUSY) {
struct mount_attr attr = {};
attr.attr_clr = MS_RDONLY;
+ /* set rdwr on parent mount first
+ * if this fails we can still try the target mount */
+ syscall(SYS_mount_setattr, -1, "/sys/firmware/efi/efivars",
+ 0, &attr, sizeof(attr));
if(syscall(SYS_mount_setattr, -1, efipath.c_str(), 0,
&attr, sizeof(attr)) != 0) {
output_error(pos, "bootloader: failed to make NVRAM read/write",
@@ -875,9 +879,10 @@ bool Bootloader::execute() const {
} else {
efivarfs = true;
}
+ } else {
+ output_error(pos, "bootloader: failed to mount efivarfs",
+ ::strerror(errno));
}
- output_error(pos, "bootloader: failed to mount efivarfs",
- ::strerror(errno));
} else {
efivarfs = true;
umount = true; /* We mounted it ourselves. */