Move tmp to avoid tmpfs-related issues with docker
This commit is contained in:
parent
89c3175de4
commit
15a8c6b1e4
20
pew.go
20
pew.go
@ -14,6 +14,7 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"os/user"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -73,12 +74,8 @@ func build(tmp string, ka config.Artifact, ki config.KernelInfo,
|
|||||||
kernel := "/lib/modules/" + ki.KernelRelease + "/build"
|
kernel := "/lib/modules/" + ki.KernelRelease + "/build"
|
||||||
|
|
||||||
output, err = dockerRun(dockerTimeout, ki.ContainerName,
|
output, err = dockerRun(dockerTimeout, ki.ContainerName,
|
||||||
tmpSourcePath, "make KERNEL="+kernel+" TARGET="+target)
|
tmpSourcePath, "make KERNEL="+kernel+" TARGET="+target+
|
||||||
if err != nil {
|
" && chmod -R 777 /work")
|
||||||
err = errors.New("make execution error")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +244,14 @@ func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact,
|
|||||||
}
|
}
|
||||||
defer q.Stop()
|
defer q.Stop()
|
||||||
|
|
||||||
tmp, err := ioutil.TempDir("/tmp/", "out-of-tree_")
|
usr, err := user.Current()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
tmpdir := usr.HomeDir + "/.out-of-tree/tmp"
|
||||||
|
os.MkdirAll(tmpdir, os.ModePerm)
|
||||||
|
|
||||||
|
tmp, err := ioutil.TempDir(tmpdir, "out-of-tree_")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("Temporary directory creation error:", err)
|
log.Println("Temporary directory creation error:", err)
|
||||||
return
|
return
|
||||||
@ -261,7 +265,7 @@ func whatever(swg *sizedwaitgroup.SizedWaitGroup, ka config.Artifact,
|
|||||||
result.BuildArtifact, result.Build.Output, err = build(tmp, ka,
|
result.BuildArtifact, result.Build.Output, err = build(tmp, ka,
|
||||||
ki, dockerTimeout)
|
ki, dockerTimeout)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(result.Build.Output)
|
log.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
result.Build.Ok = true
|
result.Build.Ok = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user