| package dkms | |
| import "path" | |
| // A Module represents a single kernel module built as part of a Package. | |
| type Module struct { | |
| // The Package that this module is a part of. | |
| Package *Package | |
| // The name that the module is expected to have after the MAKE command | |
| // is run for a Package. This should not include a .ko extension. | |
| BuiltName string | |
| // The directory where the module is expected to be after the MAKE command | |
| // is run for a Package. This should be relative to the Package's build | |
| // directory in the DKMS tree. | |
| BuiltLocation string | |
| // The name that will be used for the installed module. This should not | |
| // include a .ko extension. | |
| DestName string | |
| // The directory that the module will be copied to after it is installed. | |
| DestLocation string | |
| // Whether or not debug symbols will be stripped from the built module. | |
| Strip bool | |
| } | |
| // BuiltPath returns the path where this module is expected to be built within the DKMS tree. | |
| func (module *Module) BuiltPath() string { | |
| return path.Join(module.Package.BuildDir(), module.BuiltLocation, module.BuiltName+".ko") | |
| } | |
| // CacheBuiltPath returns the path where this module is expected to be built within the cache DKMS tree. | |
| func (module *Module) CacheBuiltPath() string { | |
| return path.Join(module.Package.CacheBuildDir(), module.BuiltLocation, module.BuiltName+".ko") | |
| } | |
| // DestPath returns the path where this module is expected to be installed in the install tree. | |
| func (module *Module) DestPath() string { | |
| return path.Join(module.Package.Trees.Install, module.DestLocation, module.DestName+".ko") | |
| } |