GNU bug report logs - #43332
[PATCH] build-system: linux-module: Delete some huge items that we probably don't need.

Previous Next

Package: guix-patches;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Fri, 11 Sep 2020 11:08:01 UTC

Severity: normal

Tags: patch

Done: Danny Milosavljevic <dannym <at> scratchpost.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 43332 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 43332 <at> debbugs.gnu.org
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>
Subject: [PATCH v2] build-system: linux-module: Delete some huge items that we
 probably don't need.
Date: Fri, 11 Sep 2020 13:46:43 +0200
* guix/build-system/linux-module.scm (make-linux-module-builder): Delete
some huge items that we probably don't need.
---
 guix/build-system/linux-module.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/guix/build-system/linux-module.scm b/guix/build-system/linux-module.scm
index 1077215671..14ff774fca 100644
--- a/guix/build-system/linux-module.scm
+++ b/guix/build-system/linux-module.scm
@@ -68,9 +68,37 @@
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((out (assoc-ref outputs "out"))
                      (out-lib-build (string-append out "/lib/modules/build")))
+                ;; Delete some huge items that we probably don't need.
                 ;; TODO: Only preserve the minimum, i.e. [Kbuild], Kconfig,
                 ;; scripts, include, ".config".
                 (copy-recursively "." out-lib-build)
+                (for-each
+                 (lambda (name)
+                   (if (file-exists? name)
+                       (delete-file-recursively name)))
+                 (map
+                  (lambda (name)
+                    (string-append out-lib-build "/" name))
+                  '("arch" ; 137 MB
+                    ;"tools" ; 44 MB ; Note: is built by our 'build phase.
+                    "tools/testing" ; 14 MB
+                    "tools/perf" ; 17 MB
+                    "drivers" ; 600 MB
+                    "Documentation" ; 52 MB
+                    "fs" ; 43 MB
+                    "net" ; 33 MB
+                    "samples" ; 2 MB
+                    "sound"))) ; 40 MB
+                ;; Reinstate arch/**/dts since "scripts/dtc" depends on it.
+                ;; Reinstate arch/**/include directories.
+                ;; Reinstate arch/**/Makefile.
+                (for-each
+                 (lambda (name)
+                   (mkdir-p (dirname (string-append out-lib-build "/" name)))
+                   (copy-recursively name
+                                     (string-append out-lib-build "/" name)))
+                 (append (find-files "arch" "^(dts|include)$" #:directories? #t)
+                         (find-files "arch" "Makefile")))
                 (let* ((linux (assoc-ref inputs "linux")))
                   (install-file (string-append linux "/System.map")
                                 out-lib-build)




This bug report was last modified 4 years and 310 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.