diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-08-21 14:28:06 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-08-22 09:49:03 +0000 |
| commit | ea1cd5ff3029315c1f89b98b820ceeebfba0e4df (patch) | |
| tree | ead4b8475abce2fecb5a30f3cc1d6d62a2bac982 /pkg/build/openbsd.go | |
| parent | aa99fc3349e97ea596c31624efde306de4136241 (diff) | |
pkg/build: introduce the build jobs parameter
This parameter defines the number of cores dedicated to the kernel build
process. By default, it's equal to the number of available CPUs.
Diffstat (limited to 'pkg/build/openbsd.go')
| -rw-r--r-- | pkg/build/openbsd.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/build/openbsd.go b/pkg/build/openbsd.go index 97f7c6a8f..bb069f90b 100644 --- a/pkg/build/openbsd.go +++ b/pkg/build/openbsd.go @@ -6,7 +6,6 @@ package build import ( "fmt" "path/filepath" - "runtime" "strconv" "time" @@ -32,7 +31,7 @@ func (ctx openbsd) build(params Params) (ImageDetails, error) { return ImageDetails{}, err } for _, tgt := range []string{"clean", "obj", "config", "all"} { - if err := ctx.make(compileDir, tgt); err != nil { + if err := ctx.make(compileDir, params.BuildJobs, tgt); err != nil { return ImageDetails{}, err } } @@ -63,8 +62,8 @@ func (ctx openbsd) clean(kernelDir, targetArch string) error { return nil } -func (ctx openbsd) make(kernelDir string, args ...string) error { - args = append([]string{"-j", strconv.Itoa(runtime.NumCPU())}, args...) +func (ctx openbsd) make(kernelDir string, jobs int, args ...string) error { + args = append([]string{"-j", strconv.Itoa(jobs)}, args...) _, err := osutil.RunCmd(10*time.Minute, kernelDir, "make", args...) return err } |
