So finally, kmod compiles without linux/module.h. However, it fails its tests.
I am attaching the testsuite.log as well as the patch, if someone feels like
working on it; I will not have time in the foreseeable future. By the way,
the tests also fail when I compile by hand on my debian system, not only
in the guix build environment; so maybe it would be enough to simply file
a bug report.

Andreas

>From 7c953b3f387f04c056067aeffb8ce01f115d2704 Mon Sep 17 00:00:00 2001
From: Andreas Enge <andr...@enge.fr>
Date: Wed, 4 Jun 2014 23:04:22 +0200
Subject: [PATCH] gnu: Add kmod.

* gnu/packages/linux.scm (kmod): New variable.
---
 gnu/packages/linux.scm | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 46f2178..6bca392 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <l...@gnu.org>
+;;; Copyright © 2014 Andreas Enge <andr...@enge.fr>
 ;;; Copyright © 2012 Nikita Karetnikov <nik...@karetnikov.org>
 ;;; Copyright © 2014 Mark H Weaver <m...@netris.org>
 ;;;
@@ -1181,3 +1182,35 @@ for systems using the Linux kernel.  This includes 
commands such as
      "The inotify-tools packages provides a C library and command-line tools
 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
     (license gpl2+)))
+
+(define-public kmod
+  (package
+    (name "kmod")
+    (version "17")
+    (source
+      (origin
+        (method url-fetch)
+        (uri
+          (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
+                         "kmod-" version ".tar.xz"))
+        (sha256
+          (base32
+           "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("xz" ,guix:xz)
+       ("zlib" ,guix:zlib)))
+    (arguments
+     `(#:configure-flags '("--with-xz" "--with-zlib")))
+    (home-page "https://www.kernel.org/";)
+    (synopsis "Kernel module tools")
+    (description "kmod is a set of tools to handle common tasks with Linux
+kernel modules like insert, remove, list, check properties, resolve
+dependencies and aliases.
+
+These tools are designed on top of libkmod, a library that is shipped with
+kmod.  The aim is to be compatible with tools, configurations and indices
+from the module-init-tools project.")
+    (license gpl2+))) ; library under lgpl2.1+
-- 
1.8.4

===============================
   kmod 17: ./test-suite.log
===============================

# TOTAL: 10
# PASS:  7
# SKIP:  0
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: testsuite/test-modprobe
=============================

TESTSUITE: running modprobe_show_depends, in forked context
TESTSUITE: 'modprobe_show_depends' [5255] exited with return code 0
TESTSUITE: PASSED: modprobe_show_depends
TESTSUITE: running modprobe_show_depends2, in forked context
TESTSUITE: 'modprobe_show_depends2' [5261] exited with return code 0
TESTSUITE: PASSED: modprobe_show_depends2
TESTSUITE: running modprobe_show_alias_to_none, in forked context
TESTSUITE: 'modprobe_show_alias_to_none' [5263] exited with return code 0
TESTSUITE: PASSED: modprobe_show_alias_to_none
TESTSUITE: running modprobe_builtin, in forked context
TESTSUITE: 'modprobe_builtin' [5268] exited with return code 0
TESTSUITE: PASSED: modprobe_builtin
TESTSUITE: running modprobe_softdep_loop, in forked context
TESTSUITE: 'modprobe_softdep_loop' [5272] exited with return code 0
TESTSUITE: ERR: module btusb not loaded
TESTSUITE: ERR: FAILED: exit ok but loaded modules do not match: 
modprobe_softdep_loop

FAIL: testsuite/test-blacklist
==============================

TESTSUITE: running blacklist_1, in forked context
TESTSUITE: ERR: 'blacklist_1' [5266] exited with return code 1
TESTSUITE: ERR: FAILED: blacklist_1

FAIL: testsuite/test-depmod
===========================

depmod: WARNING: could not open /lib/modules/4.4.4/modules.order: No such file 
or directory
depmod: WARNING: could not open /lib/modules/4.4.4/modules.builtin: No such 
file or directory
depmod: WARNING: could not open /lib/modules/4.4.4/modules.order: No such file 
or directory
depmod: WARNING: could not open /lib/modules/4.4.4/modules.builtin: No such 
file or directory
TESTSUITE: running depmod_modules_order_for_compressed, in forked context
TESTSUITE: 'depmod_modules_order_for_compressed' [5287] exited with return code 0
TESTSUITE: PASSED: depmod_modules_order_for_compressed
TESTSUITE: running depmod_search_order_simple, in forked context
TESTSUITE: 'depmod_search_order_simple' [5288] exited with return code 0
TESTSUITE: PASSED: depmod_search_order_simple
TESTSUITE: running depmod_search_order_same_prefix, in forked context
TESTSUITE: 'depmod_search_order_same_prefix' [5289] exited with return code 0
TESTSUITE: ERR: sizes do not match 
/tmp/nix-build-kmod-17.drv-2/kmod-17/testsuite/rootfs/test-depmod/search-order-same-prefix/lib/modules/4.4.4/correct-modules.dep
 
/tmp/nix-build-kmod-17.drv-2/kmod-17/testsuite/rootfs/test-depmod/search-order-same-prefix/lib/modules/4.4.4/modules.dep
TESTSUITE: ERR: FAILED: exit ok but outputs do not match: 
depmod_search_order_same_prefix

Reply via email to