Support make targets
This commit is contained in:
parent
c9618be454
commit
b246ecf956
@ -140,6 +140,10 @@ type Artifact struct {
|
|||||||
DisableKpti bool
|
DisableKpti bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Make struct {
|
||||||
|
Target string
|
||||||
|
}
|
||||||
|
|
||||||
StandardModules bool
|
StandardModules bool
|
||||||
|
|
||||||
Preload []PreloadModule
|
Preload []PreloadModule
|
||||||
|
14
pew.go
14
pew.go
@ -179,13 +179,17 @@ func build(tmp string, ka config.Artifact, ki config.KernelInfo,
|
|||||||
kernel = ki.KernelSource
|
kernel = ki.KernelSource
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildCommand := "make KERNEL=" + kernel + " TARGET=" + target
|
||||||
|
if ka.Make.Target != "" {
|
||||||
|
buildCommand += " " + ka.Make.Target
|
||||||
|
}
|
||||||
|
|
||||||
if ki.ContainerName != "" {
|
if ki.ContainerName != "" {
|
||||||
output, err = dockerRun(dockerTimeout, ki.ContainerName,
|
output, err = dockerRun(dockerTimeout, ki.ContainerName,
|
||||||
tmpSourcePath, "make KERNEL="+kernel+" TARGET="+target+
|
tmpSourcePath, buildCommand+" && chmod -R 777 /work")
|
||||||
" && chmod -R 777 /work")
|
|
||||||
} else {
|
} else {
|
||||||
command := "make KERNEL=" + kernel + " TARGET=" + target
|
cmd := exec.Command("bash", "-c", "cd "+tmpSourcePath+" && "+
|
||||||
cmd := exec.Command("bash", "-c", "cd "+tmpSourcePath+" && "+command)
|
buildCommand)
|
||||||
timer := time.AfterFunc(dockerTimeout, func() {
|
timer := time.AfterFunc(dockerTimeout, func() {
|
||||||
cmd.Process.Kill()
|
cmd.Process.Kill()
|
||||||
})
|
})
|
||||||
@ -195,7 +199,7 @@ func build(tmp string, ka config.Artifact, ki config.KernelInfo,
|
|||||||
raw, err = cmd.CombinedOutput()
|
raw, err = cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
e := fmt.Sprintf("error `%v` for cmd `%v` with output `%v`",
|
e := fmt.Sprintf("error `%v` for cmd `%v` with output `%v`",
|
||||||
err, command, string(raw))
|
err, buildCommand, string(raw))
|
||||||
err = errors.New(e)
|
err = errors.New(e)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user