aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/build/linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-24 14:30:05 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-24 14:30:05 +0200
commit375a3e31e12965ce58d8853c310a4e7e655853d4 (patch)
treeadaa33da1c0d91bdac0732d3da1addee574608fb /pkg/build/linux.go
parent9b6bfa3fe89656f7eccf0bf094770d29be0c8c6a (diff)
pkg/build: save kernel config early
Currently we don't capture kernel config for broken builds because the config is saved as the last step. Save it as early as possible.
Diffstat (limited to 'pkg/build/linux.go')
-rw-r--r--pkg/build/linux.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/build/linux.go b/pkg/build/linux.go
index ccceeec82..f2bc4e0fe 100644
--- a/pkg/build/linux.go
+++ b/pkg/build/linux.go
@@ -54,6 +54,11 @@ func (linux) buildKernel(kernelDir, outputDir, compiler string, config []byte) e
if _, err := osutil.Run(10*time.Minute, cmd); err != nil {
return err
}
+ // Write updated kernel config early, so that it's captured on build failures.
+ outputConfig := filepath.Join(outputDir, "kernel.config")
+ if err := osutil.CopyFile(configFile, outputConfig); err != nil {
+ return err
+ }
// We build only bzImage as we currently don't use modules.
cpu := strconv.Itoa(runtime.NumCPU())
cmd = osutil.Command("make", "bzImage", "-j", cpu, "CC="+compiler)
@@ -64,10 +69,6 @@ func (linux) buildKernel(kernelDir, outputDir, compiler string, config []byte) e
if _, err := osutil.Run(time.Hour, cmd); err != nil {
return extractRootCause(err)
}
- outputConfig := filepath.Join(outputDir, "kernel.config")
- if err := osutil.CopyFile(configFile, outputConfig); err != nil {
- return err
- }
vmlinux := filepath.Join(kernelDir, "vmlinux")
outputVmlinux := filepath.Join(outputDir, "obj", "vmlinux")
if err := os.Rename(vmlinux, outputVmlinux); err != nil {