summaryrefslogtreecommitdiff
path: root/hscript
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-09-20 17:07:11 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-09-20 17:07:11 -0500
commitf64d8446ea172427d9c5a48718086c4505aaba17 (patch)
tree01f65f7a97a692c7b5bae536bb1cf14f010f9403 /hscript
parent7ffae2acb546ef6362243b69419db9b1ba1e8e25 (diff)
downloadhorizon-f64d8446ea172427d9c5a48718086c4505aaba17.tar.gz
horizon-f64d8446ea172427d9c5a48718086c4505aaba17.tar.bz2
horizon-f64d8446ea172427d9c5a48718086c4505aaba17.tar.xz
horizon-f64d8446ea172427d9c5a48718086c4505aaba17.zip
hscript: Remount EFI vars correctly
The manpage suggests that MS_BIND must be set to change R/O flag on bindmounts.
Diffstat (limited to 'hscript')
-rw-r--r--hscript/meta.cc8
1 files changed, 4 insertions, 4 deletions
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 */
}