Skip to content

Commit

Permalink
added more kernel config paths for checking system requirements
Browse files Browse the repository at this point in the history
On Fedora Silverblue the kernel config of the current kernel is under
/usr/lib/modules/<kernel>/config

(cherry picked from commit 81dd625)
  • Loading branch information
gustavo-iniguez-goya committed Jun 13, 2024
1 parent f4084d7 commit 93a3fb7
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions daemon/core/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 93a3fb7

Please sign in to comment.