aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/build/linux.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-11-18 17:39:09 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-11-18 17:39:09 +0100
commitb436ffb77df158d69b51c39bb3bc480415118368 (patch)
tree3c63b83f6084812ec797dab0e22745d8d6a42c25 /pkg/build/linux.go
parent1daed50ac33511e1a107228a9c3b80e5c4aebb5c (diff)
pkg/build: produce more deterministic linux binaries
There are few more dynamic variables related to kernel release tagging. Set these to known deterministic values.
Diffstat (limited to 'pkg/build/linux.go')
-rw-r--r--pkg/build/linux.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/build/linux.go b/pkg/build/linux.go
index a74f056c0..6f49466b6 100644
--- a/pkg/build/linux.go
+++ b/pkg/build/linux.go
@@ -133,12 +133,15 @@ func runMake(kernelDir string, args ...string) error {
cmd.Env = append([]string{}, os.Environ()...)
// This makes the build [more] deterministic:
// 2 builds from the same sources should result in the same vmlinux binary.
- // We plan to use it for detecting no-op changes during bisection.
+ // Build on a release commit and on the previous one should result in the same vmlinux too.
+ // We use it for detecting no-op changes during bisection.
cmd.Env = append(cmd.Env,
"KBUILD_BUILD_VERSION=0",
"KBUILD_BUILD_TIMESTAMP=now",
"KBUILD_BUILD_USER=syzkaller",
"KBUILD_BUILD_HOST=syzkaller",
+ "KERNELVERSION=syzkaller",
+ "LOCALVERSION=-syzkaller",
)
_, err := osutil.Run(time.Hour, cmd)
return err