github.com/anchore/syft@v1.38.2/syft/pkg/linux_kernel.go (about) 1 package pkg 2 3 // LinuxKernel represents all captured data for a Linux kernel 4 type LinuxKernel struct { 5 // Name is kernel name (typically "Linux") 6 Name string `mapstructure:"name" json:"name" cyclonedx:"name"` 7 8 // Architecture is the target CPU architecture 9 Architecture string `mapstructure:"architecture" json:"architecture" cyclonedx:"architecture"` 10 11 // Version is kernel version string 12 Version string `mapstructure:"version" json:"version" cyclonedx:"version"` 13 14 // ExtendedVersion is additional version information 15 ExtendedVersion string `mapstructure:"extendedVersion" json:"extendedVersion,omitempty" cyclonedx:"extendedVersion"` 16 17 // BuildTime is when the kernel was built 18 BuildTime string `mapstructure:"buildTime" json:"buildTime,omitempty" cyclonedx:"buildTime"` 19 20 // Author is who built the kernel 21 Author string `mapstructure:"author" json:"author,omitempty" cyclonedx:"author"` 22 23 // Format is kernel image format (e.g. bzImage, zImage) 24 Format string `mapstructure:"format" json:"format,omitempty" cyclonedx:"format"` 25 26 // RWRootFS is whether root filesystem is mounted read-write 27 RWRootFS bool `mapstructure:"rwRootFS" json:"rwRootFS,omitempty" cyclonedx:"rwRootFS"` 28 29 // SwapDevice is swap device number 30 SwapDevice int `mapstructure:"swapDevice" json:"swapDevice,omitempty" cyclonedx:"swapDevice"` 31 32 // RootDevice is root device number 33 RootDevice int `mapstructure:"rootDevice" json:"rootDevice,omitempty" cyclonedx:"rootDevice"` 34 35 // VideoMode is default video mode setting 36 VideoMode string `mapstructure:"videoMode" json:"videoMode,omitempty" cyclonedx:"videoMode"` 37 } 38 39 // LinuxKernelModule represents a loadable kernel module (.ko file) with its metadata, parameters, and dependencies. 40 type LinuxKernelModule struct { 41 // Name is module name 42 Name string `mapstructure:"name" json:"name,omitempty" cyclonedx:"name"` 43 44 // Version is module version string 45 Version string `mapstructure:"version" json:"version,omitempty" cyclonedx:"version"` 46 47 // SourceVersion is the source code version identifier 48 SourceVersion string `mapstructure:"sourceVersion" json:"sourceVersion,omitempty" cyclonedx:"sourceVersion"` 49 50 // Path is the filesystem path to the .ko kernel object file (absolute path) 51 Path string `mapstructure:"path" json:"path,omitempty" cyclonedx:"path"` 52 53 // Description is a human-readable module description 54 Description string `mapstructure:"description" json:"description,omitempty" cyclonedx:"description"` 55 56 // Author is module author name and email 57 Author string `mapstructure:"author" json:"author,omitempty" cyclonedx:"author"` 58 59 // License is module license (e.g. GPL, BSD) which must be compatible with kernel 60 License string `mapstructure:"license" json:"license,omitempty" cyclonedx:"license"` 61 62 // KernelVersion is kernel version this module was built for 63 KernelVersion string `mapstructure:"kernelVersion" json:"kernelVersion,omitempty" cyclonedx:"kernelVersion"` 64 65 // VersionMagic is version magic string for compatibility checking (includes kernel version, SMP status, module loading capabilities like "3.17.4-302.fc21.x86_64 SMP mod_unload modversions"). Module will NOT load if vermagic doesn't match running kernel. 66 VersionMagic string `mapstructure:"versionMagic" json:"versionMagic,omitempty" cyclonedx:"versionMagic"` 67 68 // Parameters are the module parameters that can be configured at load time (user-settable values like module options) 69 Parameters map[string]LinuxKernelModuleParameter `mapstructure:"parameters" json:"parameters,omitempty" cyclonedx:"parameters"` 70 } 71 72 // LinuxKernelModuleParameter represents a configurable parameter for a kernel module with its type and description. 73 type LinuxKernelModuleParameter struct { 74 // Type is parameter data type (e.g. int, string, bool, array types) 75 Type string `mapstructure:"type" json:"type,omitempty" cyclonedx:"type"` 76 77 // Description is a human-readable parameter description explaining what the parameter controls 78 Description string `mapstructure:"description" json:"description,omitempty" cyclonedx:"description"` 79 }