Skip to content

Commit

Permalink
Parse generated/utsversion.h to parse the Kernel Version on newer COS…
Browse files Browse the repository at this point in the history
… kernels (#80)
  • Loading branch information
mhbardsley authored May 15, 2024
1 parent f370195 commit 938295d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/operatingsystem/cos/kernel-package.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ func extractKernelDetails(buildID string, kernelHeaders io.Reader, kp *operating
}
kp.KernelRelease = components[0]
case tar.TypeReg:
// Read kernel version and machine from generated/compile.h
// Read kernel version and machine from generated/compile.h and generated/utsversion.h
if kp.KernelVersion != "" && kp.KernelMachine != "" {
continue
}
if !strings.Contains(header.Name, "generated/compile.h") {
if !(strings.Contains(header.Name, "generated/compile.h") || strings.Contains(header.Name, "generated/utsversion.h")) {
continue
}
scanner := bufio.NewScanner(extractedKernelHeaders)
Expand Down

0 comments on commit 938295d

Please sign in to comment.