From 091f25de6945e70d86b7ef48a6bc036c32dc7a7b Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 21 Oct 2023 23:37:12 -0500 Subject: hscript: bootloader: Stop mucking with efivarfs The problem was OpenRC which was fixed in packages.git. We should not have any further issues with efivarfs being read-only outside of host systems that are running OpenRC >= 0.28 and < 0.39. --- hscript/meta.cc | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/hscript/meta.cc b/hscript/meta.cc index e8bddd8..ee34372 100644 --- a/hscript/meta.cc +++ b/hscript/meta.cc @@ -858,20 +858,7 @@ bool Bootloader::execute() const { /* handle EFI vars partition */ const auto efipath{script->targetDirectory() + "/sys/firmware/efi/efivars"}; - bool efivarfs = false; - if(fs::exists(efipath)) { - /* if it isn't already mounted, that's fine */ - umount(efipath.c_str()); - /* we have to umount all efivarfs ro mounts to make any rw */ - umount("/sys/firmware/efi/efivars"); - if(mount("efivarfs", efipath.c_str(), "efivarfs", MS_NOEXEC | - MS_NODEV | MS_NOSUID | MS_RELATIME, nullptr) != 0) { - output_error(pos, "bootloader: failed to mount efivarfs", - ::strerror(errno)); - } else { - efivarfs = true; - } - } + bool efivarfs = fs::exists(efipath); if(!efivarfs) { output_warning(pos, "bootloader: efivarfs is not available", -- cgit v1.2.3-70-g09d2