From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kLLMCdhjW1+CBwAA0tVLHw (envelope-from ) for ; Fri, 11 Sep 2020 11:47:36 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id mCAWBNhjW1/GMAAA1q6Kng (envelope-from ) for ; Fri, 11 Sep 2020 11:47:36 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6241D94051F for ; Fri, 11 Sep 2020 11:47:35 +0000 (UTC) Received: from localhost ([::1]:57248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGhWg-0008JB-DI for larch@yhetil.org; Fri, 11 Sep 2020 07:47:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGhWA-00081B-9W for guix-patches@gnu.org; Fri, 11 Sep 2020 07:47:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGhW9-00036O-Vg for guix-patches@gnu.org; Fri, 11 Sep 2020 07:47:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kGhW9-00033U-UT for guix-patches@gnu.org; Fri, 11 Sep 2020 07:47:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43332] [PATCH v2] build-system: linux-module: Delete some huge items that we probably don't need. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Sep 2020 11:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43332 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43332@debbugs.gnu.org Cc: Danny Milosavljevic Received: via spool by 43332-submit@debbugs.gnu.org id=B43332.159982481111728 (code B ref 43332); Fri, 11 Sep 2020 11:47:01 +0000 Received: (at 43332) by debbugs.gnu.org; 11 Sep 2020 11:46:51 +0000 Received: from localhost ([127.0.0.1]:42725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGhVz-000336-1m for submit@debbugs.gnu.org; Fri, 11 Sep 2020 07:46:51 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:46750) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGhVw-00032w-32 for 43332@debbugs.gnu.org; Fri, 11 Sep 2020 07:46:49 -0400 Received: from dayas.lan (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 5B65E3365399; Fri, 11 Sep 2020 13:46:46 +0200 (CEST) From: Danny Milosavljevic Date: Fri, 11 Sep 2020 13:46:43 +0200 Message-Id: <20200911114643.19958-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200911110735.8208-1-dannym@scratchpost.org> References: <20200911110735.8208-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: abwz7q1+hC23 * 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)