1
0

Standard modules dependencies

This commit is contained in:
dump_stack() 2023-02-15 11:48:25 +00:00
parent 3d6961dfd7
commit 3f79c8e461
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
3 changed files with 30 additions and 0 deletions

View File

@ -140,6 +140,8 @@ type Artifact struct {
DisableKpti bool DisableKpti bool
} }
StandardModules bool
Preload []PreloadModule Preload []PreloadModule
} }

View File

@ -109,6 +109,7 @@ func interactive(q *qemu.System) (err error) {
} }
} }
// TODO Merge with pew.go:whatever
func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string, func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
dockerTimeout time.Duration, yekaslr, yesmep, yesmap, yekpti, dockerTimeout time.Duration, yekaslr, yesmep, yesmap, yekpti,
nokaslr, nosmep, nosmap, nokpti bool) (err error) { nokaslr, nosmep, nosmap, nokpti bool) (err error) {
@ -206,6 +207,15 @@ func debugHandler(kcfg config.KernelConfig, workPath, kernRegex, gdb string,
} }
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
if ka.StandardModules {
// Module depends on one of the standard modules
err = copyStandardModules(q, ki)
if err != nil {
log.Println(err)
return
}
}
err = preloadModules(q, ka, ki, dockerTimeout) err = preloadModules(q, ka, ki, dockerTimeout)
if err != nil { if err != nil {
log.Println(err) log.Println(err)

18
pew.go
View File

@ -403,6 +403,15 @@ func copyTest(q *qemu.System, testPath string, ka config.Artifact) (
return return
} }
func copyStandardModules(q *qemu.System, ki config.KernelInfo) (err error) {
_, err = q.Command("root", "mkdir -p /lib/modules")
if err != nil {
return
}
return q.CopyDirectory("root", ki.ModulesPath, "/lib/modules/")
}
func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact, func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact,
ki config.KernelInfo, binaryPath, testPath string, ki config.KernelInfo, binaryPath, testPath string,
qemuTimeout, dockerTimeout time.Duration, dist, tag string, qemuTimeout, dockerTimeout time.Duration, dist, tag string,
@ -498,6 +507,15 @@ func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact,
return return
} }
if ka.StandardModules {
// Module depends on one of the standard modules
err = copyStandardModules(q, ki)
if err != nil {
log.Println(err)
return
}
}
err = preloadModules(q, ka, ki, dockerTimeout) err = preloadModules(q, ka, ki, dockerTimeout)
if err != nil { if err != nil {
log.Println(err) log.Println(err)