aboutsummaryrefslogtreecommitdiff
path: root/guix/build/linux-module-build-system.scm
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2021-10-01 14:53:56 +0200
committerTobias Geerinckx-Rice <me@tobias.gr>2021-10-01 21:27:35 +0200
commit834415c33a2fd909e410a5cf352c597f05bb6999 (patch)
tree841bd7eafeb3f950378c203f8dbbae2d65719a1c /guix/build/linux-module-build-system.scm
parent7dbd06a13b2e1109fc916e34f07ec1c474bfba96 (diff)
downloadguix-834415c33a2fd909e410a5cf352c597f05bb6999.tar
guix-834415c33a2fd909e410a5cf352c597f05bb6999.tar.gz
build-system: linux-module: Build and install in parallel.
* guix/build-system/linux-module.scm (linux-module-build) (guix/build-system/linux-module.scm): Accept the PARALLEL-BUILD? keyword and pass it on to the builder. * guix/build/linux-module-build-system.scm (build, install): Capture and honour it.
Diffstat (limited to 'guix/build/linux-module-build-system.scm')
-rw-r--r--guix/build/linux-module-build-system.scm21
1 files changed, 15 insertions, 6 deletions
diff --git a/guix/build/linux-module-build-system.scm b/guix/build/linux-module-build-system.scm
index 1541b6393e..7c0dba8445 100644
--- a/guix/build/linux-module-build-system.scm
+++ b/guix/build/linux-module-build-system.scm
@@ -50,16 +50,22 @@
; TODO: kernel ".config".
#t)
-(define* (build #:key inputs make-flags (source-directory ".") #:allow-other-keys)
+(define* (build #:key (make-flags '()) (parallel-build? #t)
+ (source-directory ".")
+ inputs
+ #:allow-other-keys)
(apply invoke "make" "-C"
(string-append (assoc-ref inputs "linux-module-builder")
"/lib/modules/build")
(string-append "M=" (canonicalize-path source-directory))
- (or make-flags '())))
+ `(,@(if parallel-build?
+ `("-j" ,(number->string (parallel-job-count)))
+ '())
+ ,@make-flags)))
-;; This block was copied from make-linux-libre--only took the "modules_install"
-;; part.
-(define* (install #:key make-flags (source-directory ".")
+;; Similar to the "modules_install" part of make-linux-libre.
+(define* (install #:key (make-flags '()) (parallel-build? #t)
+ (source-directory ".")
inputs native-inputs outputs
#:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
@@ -80,7 +86,10 @@
(string-append "INSTALL_MOD_PATH=" out)
"INSTALL_MOD_STRIP=1"
"modules_install"
- (or make-flags '()))))
+ `(,@(if parallel-build?
+ `("-j" ,(number->string (parallel-job-count)))
+ '())
+ ,@make-flags))))
(define %standard-phases
(modify-phases gnu:%standard-phases