From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epunh-000102-Q0 for guix-patches@gnu.org; Sun, 25 Feb 2018 06:49:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epunf-0000pQ-5J for guix-patches@gnu.org; Sun, 25 Feb 2018 06:49:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:51590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epunf-0000od-2S for guix-patches@gnu.org; Sun, 25 Feb 2018 06:49:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1epune-0003gs-Q6 for guix-patches@gnu.org; Sun, 25 Feb 2018 06:49:02 -0500 Subject: [bug#30604] [PATCH 2/4] gnu: Add kmod-minimal-static. Resent-Message-ID: From: Danny Milosavljevic Date: Sun, 25 Feb 2018 12:48:14 +0100 Message-Id: <20180225114816.869-2-dannym@scratchpost.org> In-Reply-To: <20180225114816.869-1-dannym@scratchpost.org> References: <20180225114557.816-1-dannym@scratchpost.org> <20180225114816.869-1-dannym@scratchpost.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30604@debbugs.gnu.org * gnu/packages/linux.scm (kmod-minimal/static): New variable. --- gnu/packages/linux.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 1f8bf3050..b2e47f79a 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -1994,6 +1994,50 @@ from the module-init-tools project.") #t)) %standard-phases))))) +(define-public kmod-minimal/static + (static-package + (package (inherit kmod-minimal) + (name "kmod-minimal-static") + (version "13") + (source (origin + (method url-fetch) + (uri + (string-append "mirror://kernel.org/linux/utils/kernel/kmod/" + "kmod-" version ".tar.xz")) + (sha256 + (base32 + "0mkrklih0f33c3zc4mkk9qqbzy36r18mj9xffd4wi61gpamx6dkc")) + (patches (search-patches "kmod-13-module-directory.patch")))) + (arguments + (substitute-keyword-arguments + (package-arguments (static-package kmod-minimal)) + ((#:configure-flags flags ''()) + `(cons* "--disable-manpages" "--disable-static" "--disable-shared" ,flags)) + ((#:make-flags flags ''()) + `(cons* "LDFLAGS=-all-static" ,flags)) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + (delete 'install-license-files) + (add-after 'unpack 'patch-kmod + (lambda _ + ;; Reduce size by 200 kiB. + (substitute* "tools/kmod.c" + (("[&]kmod_cmd_compat_lsmod,") "") + (("[&]kmod_cmd_compat_rmmod,") "") + (("[&]kmod_cmd_compat_insmod,") "") + (("[&]kmod_cmd_compat_modinfo,") "")) + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin"))) + (install-file "tools/kmod" bin) + (for-each + (lambda (tool) + (symlink "kmod" (string-append bin "/" tool))) + '("modprobe" "depmod")) + #t)))))))))) + (define-public eudev ;; The post-systemd fork, maintained by Gentoo. (package