summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.rst2
-rw-r--r--hscript/meta.cc9
2 files changed, 9 insertions, 2 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index d6ebfc8..75649f8 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -81,6 +81,8 @@ Metadata
of copies of the key on local disk. This allows you to use System
Installation from non-Adélie Linux systems.
+* EFI installation has been made more reliable.
+
Qt UI
-----
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. */