From 93a3fb7eb6eaa12ee4b36df02a56f2551289c6b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20I=C3=B1iguez=20Goia?= Date: Thu, 13 Jun 2024 22:13:56 +0200 Subject: [PATCH] added more kernel config paths for checking system requirements On Fedora Silverblue the kernel config of the current kernel is under /usr/lib/modules//config (cherry picked from commit 81dd625a1ccc2cbf816f5e8c23bde570c23e3127) --- daemon/core/system.go | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/daemon/core/system.go b/daemon/core/system.go index 9b17a86f92..5e09451f66 100644 --- a/daemon/core/system.go +++ b/daemon/core/system.go @@ -43,17 +43,34 @@ func CheckSysRequirements() { log.Raw("\n\t%sChecking system requirements for kernel version %s%s\n", log.FG_WHITE+log.BG_LBLUE, kVer, log.RESET) log.Raw("%s------------------------------------------------------------------------------%s\n\n", log.FG_WHITE+log.BG_LBLUE, log.RESET) - confFile := fmt.Sprint("/boot/config-", kVer) + confPaths := []string{ + fmt.Sprint("/boot/config-", kVer), + "/proc/config.gz", + // Fedora SilverBlue + fmt.Sprint("/usr/lib/modules/", kVer, "/config"), + } + var fileContent []byte var err error - if Exists(confFile) { - fileContent, err = ioutil.ReadFile(confFile) - } else { - confFile = "/proc/config.gz" - fileContent, err = ReadGzipFile(confFile) + for _, confFile := range confPaths { + if !Exists(confFile) { + err = fmt.Errorf("%s not found", confFile) + log.Debug(err.Error()) + continue + } + + if confFile[len(confFile)-2:] == "gz" { + fileContent, err = ReadGzipFile(confFile) + } else { + fileContent, err = ioutil.ReadFile(confFile) + } + if err == nil { + break + } } if err != nil { - log.Error("%s not found", confFile) + fmt.Printf("\n\t%s kernel config not found (%s) in any of the expected paths.\n", log.Bold(log.Red("✘")), kVer) + fmt.Printf("\tPlease, open a new issue on github specifying your kernel and distro version (/etc/os-release).\n\n") return }