Skip to content
Snippets Groups Projects

testing/booster: upgrade to 0.9

Merged Sören Tempel requested to merge nmeum/aports:booster-0.9 into master
Files
4
From 11048294f07bee1d462d8ab58a52de4eb64d33e8 Mon Sep 17 00:00:00 2001
From: Anatol Pomozov <anatol.pomozov@gmail.com>
Date: Fri, 6 May 2022 19:14:38 -0700
Subject: [PATCH] Load 'efivarfs' before mounting the filesystem
Move readConfig() earlier as loadModule needs the list of builtin
modules from the config.
Issue #149
---
generator/generator.go | 1 +
init/main.go | 13 +++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/generator/generator.go b/generator/generator.go
index f21da7e..b2e2c79 100644
--- a/generator/generator.go
+++ b/generator/generator.go
@@ -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",
}
diff --git a/init/main.go b/init/main.go
index ebd5cd9..2c6dbd0 100644
--- a/init/main.go
+++ b/init/main.go
@@ -663,6 +663,10 @@ func walkSysModaliases(path string, fi os.FileInfo, err error) error {
func boost() error {
info("Starting booster initramfs")
+ if err := readConfig(); err != nil {
+ return err
+ }
+
var err error
if err := mount("dev", "/dev", "devtmpfs", unix.MS_NOSUID, "mode=0755"); err != nil {
return err
@@ -684,6 +688,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
}
@@ -693,10 +702,6 @@ func boost() error {
return err
}
- if err := readConfig(); err != nil {
- return err
- }
-
kernelVersion, err := getKernelVersion()
if err != nil {
return err
Loading