From f64d8446ea172427d9c5a48718086c4505aaba17 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 20 Sep 2020 17:07:11 -0500 Subject: hscript: Remount EFI vars correctly The manpage suggests that MS_BIND must be set to change R/O flag on bindmounts. --- hscript/meta.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hscript') diff --git a/hscript/meta.cc b/hscript/meta.cc index a0f958c..4efdc80 100644 --- a/hscript/meta.cc +++ b/hscript/meta.cc @@ -837,8 +837,8 @@ bool Bootloader::execute() const { const auto efipath{script->targetDirectory() + "/sys/firmware/efi/efivars"}; mount(nullptr, efipath.c_str(), nullptr, - MS_REMOUNT | MS_NOEXEC | MS_NODEV | MS_NOSUID | MS_RELATIME, - nullptr); + MS_REMOUNT | MS_BIND | MS_NOEXEC | MS_NODEV | MS_NOSUID | + MS_RELATIME, nullptr); if(run_command("chroot", {script->targetDirectory(), "grub-install", _device}) @@ -849,8 +849,8 @@ bool Bootloader::execute() const { /* done, back to r/o */ mount(nullptr, efipath.c_str(), nullptr, - MS_REMOUNT | MS_RDONLY | MS_NOEXEC | MS_NODEV | MS_NOSUID | - MS_RELATIME, nullptr); + MS_REMOUNT | MS_BIND | MS_RDONLY | MS_NOEXEC | MS_NODEV | + MS_NOSUID | MS_RELATIME, nullptr); #endif /* HAS_INSTALL_ENV */ return true; /* LCOV_EXCL_LINE */ } -- cgit v1.2.3-70-g09d2