Skip to content

Commit

Permalink
Load 'efivarfs' before mounting the filesystem
Browse files Browse the repository at this point in the history
Issue #149
  • Loading branch information
anatol committed May 7, 2022
1 parent 2805cea commit 78ea9aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ var defaultModulesList = []string{
"hid_generic", "sd_mod", "ahci",
"sdhci", "sdhci_acpi", "sdhci_pci", "mmc_block", // mmc
"nvme", "usb_storage", "uas",
"efivarfs",
"virtio_pci", "virtio_blk", "virtio_scsi", "virtio_crypto",
}

Expand Down
5 changes: 5 additions & 0 deletions init/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,11 @@ func boost() error {

// Mount efivarfs if running in EFI mode
if _, err := os.Stat("/sys/firmware/efi"); !errors.Is(err, os.ErrNotExist) {
wg, err := loadModules("efivarfs")
if err != nil {
return err
}
wg.Wait()
if err := mount("efivarfs", "/sys/firmware/efi/efivars", "efivarfs", unix.MS_NOSUID|unix.MS_NOEXEC|unix.MS_NODEV, ""); err != nil {
return err
}
Expand Down

0 comments on commit 78ea9aa

Please sign in to comment.