]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
build: cache modules from playground
authorLucas De Marchi <lucas.demarchi@intel.com>
Sun, 31 May 2015 18:38:47 +0000 (15:38 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Sun, 31 May 2015 18:38:47 +0000 (15:38 -0300)
Now that we are able to build our own test modules, also allow to use
cached modules so a) kernel headers are not required and b) distro
maintainers are happy.  It's still need a "--disable-test-modules" in
the configure since the default is enabled.

There's no license problems anymore since all modules come from our own
repository, we ship the sources and the modules can be easily rebuilt.

17 files changed:
Makefile.am
configure.ac
testsuite/module-playground/.gitignore
testsuite/module-playground/Makefile
testsuite/module-playground/cache/mod-fake-cciss.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-fake-hpsa.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-fake-scsi-mod.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-foo-a.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-foo-b.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-foo-c.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-foo.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-loop-a.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-loop-b.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-loop-c.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-loop-d.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-loop-e.ko [new file with mode: 0644]
testsuite/module-playground/cache/mod-simple.ko [new file with mode: 0644]

index 94576553b012cc7de1b1b8a12bc4f0c92041dd9c..b9919363ba461bd7372353ad1d9dc3069a5ec720 100644 (file)
@@ -230,7 +230,12 @@ build-module-playground:
                cp -r $(top_srcdir)/$(MODULE_PLAYGROUND) $(top_builddir)/$(MODULE_PLAYGROUND) && \
                find $(top_builddir)/$(MODULE_PLAYGROUND) -type d -exec chmod +w {} \; ; \
                fi
+if BUILD_MODULES
        $(MAKE) -C $(MODULE_PLAYGROUND)
+else
+       $(MAKE) -C $(MODULE_PLAYGROUND) FAKE_BUILD=1
+endif
+
 
 rootfs: build-module-playground
        $(CREATE_ROOTFS)
index be597b476b33cf89ce4706192588e16360713643..6e675846f781b3197b4af4dda4cb5c28435c7918 100644 (file)
@@ -127,6 +127,11 @@ AC_ARG_ENABLE([manpages],
        [], enable_manpages=yes)
 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
 
+AC_ARG_ENABLE([test-modules],
+        AS_HELP_STRING([--disable-test-modules], [disable building test modules during make check: cached modules will be used @<:@default=enabled@:>@]),
+       [], enable_test_modules=yes)
+AM_CONDITIONAL([BUILD_MODULES], [test "x$enable_test_modules" = "xyes"])
+
 AC_ARG_ENABLE([logging],
        AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
        [], enable_logging=yes)
@@ -282,4 +287,5 @@ AC_MSG_RESULT([
        coverage:               ${enable_coverage}
        doc:                    ${enable_gtk_doc}
        man:                    ${enable_manpages}
+       test-modules:           ${enable_test_modules}
 ])
index 5cd3034ff343efd6cf433b00b6b7bdbba74301bd..6767e0e6db4bb302c13f45f8fe51d14c9e798bb0 100644 (file)
@@ -1,6 +1,7 @@
 *o.cmd
 *.ko
 !mod-simple-*.ko
+!cache/*.ko
 *.mod.c
 .tmp_versions
 modules.order
index 5ba9ed22483e592925b936797814508086cdbde8..a5f142f96abf654f4a428354e3732d32dc4dc640 100644 (file)
@@ -38,6 +38,9 @@ else
 # normal makefile
 KDIR ?= /lib/modules/`uname -r`/build
 KVER ?= `uname -r`
+ifeq ($(FAKE_BUILD),)
+    FAKE_BUILD=0
+endif
 
 ARCH_SPECIFIC_MODULES := mod-simple-x86_64.ko mod-simple-i386.ko mod-simple-sparc64.ko
 MY_MODULES := $(filter-out $(ARCH_SPECIFIC_MODULES),$(wildcard *.ko))
@@ -48,8 +51,14 @@ mod-simple-%.ko: mod-simple-%.c Makefile.arch
        $(eval arch=$(patsubst mod-simple-%.ko,%,$@))
        $(MAKE) KDIR=$(KDIR_$(arch)) ARCH=$(arch) CROSS_COMPILE=$(CROSS_COMPILE_$(arch)) -f Makefile.arch
 
+ifeq ($(FAKE_BUILD),0)
 modules:
        $(MAKE) -C $(KDIR) M=$$PWD
+else
+modules:
+       @echo "  CP       cache/*.ko"
+       @cp cache/*.ko .
+endif
 
 arch-modules: $(ARCH_SPECIFIC_MODULES)
 
diff --git a/testsuite/module-playground/cache/mod-fake-cciss.ko b/testsuite/module-playground/cache/mod-fake-cciss.ko
new file mode 100644 (file)
index 0000000..f61409a
Binary files /dev/null and b/testsuite/module-playground/cache/mod-fake-cciss.ko differ
diff --git a/testsuite/module-playground/cache/mod-fake-hpsa.ko b/testsuite/module-playground/cache/mod-fake-hpsa.ko
new file mode 100644 (file)
index 0000000..3d33ba7
Binary files /dev/null and b/testsuite/module-playground/cache/mod-fake-hpsa.ko differ
diff --git a/testsuite/module-playground/cache/mod-fake-scsi-mod.ko b/testsuite/module-playground/cache/mod-fake-scsi-mod.ko
new file mode 100644 (file)
index 0000000..c0eb974
Binary files /dev/null and b/testsuite/module-playground/cache/mod-fake-scsi-mod.ko differ
diff --git a/testsuite/module-playground/cache/mod-foo-a.ko b/testsuite/module-playground/cache/mod-foo-a.ko
new file mode 100644 (file)
index 0000000..f2d406e
Binary files /dev/null and b/testsuite/module-playground/cache/mod-foo-a.ko differ
diff --git a/testsuite/module-playground/cache/mod-foo-b.ko b/testsuite/module-playground/cache/mod-foo-b.ko
new file mode 100644 (file)
index 0000000..53bf3a9
Binary files /dev/null and b/testsuite/module-playground/cache/mod-foo-b.ko differ
diff --git a/testsuite/module-playground/cache/mod-foo-c.ko b/testsuite/module-playground/cache/mod-foo-c.ko
new file mode 100644 (file)
index 0000000..083e801
Binary files /dev/null and b/testsuite/module-playground/cache/mod-foo-c.ko differ
diff --git a/testsuite/module-playground/cache/mod-foo.ko b/testsuite/module-playground/cache/mod-foo.ko
new file mode 100644 (file)
index 0000000..0961478
Binary files /dev/null and b/testsuite/module-playground/cache/mod-foo.ko differ
diff --git a/testsuite/module-playground/cache/mod-loop-a.ko b/testsuite/module-playground/cache/mod-loop-a.ko
new file mode 100644 (file)
index 0000000..51533d8
Binary files /dev/null and b/testsuite/module-playground/cache/mod-loop-a.ko differ
diff --git a/testsuite/module-playground/cache/mod-loop-b.ko b/testsuite/module-playground/cache/mod-loop-b.ko
new file mode 100644 (file)
index 0000000..5e20348
Binary files /dev/null and b/testsuite/module-playground/cache/mod-loop-b.ko differ
diff --git a/testsuite/module-playground/cache/mod-loop-c.ko b/testsuite/module-playground/cache/mod-loop-c.ko
new file mode 100644 (file)
index 0000000..6a02b04
Binary files /dev/null and b/testsuite/module-playground/cache/mod-loop-c.ko differ
diff --git a/testsuite/module-playground/cache/mod-loop-d.ko b/testsuite/module-playground/cache/mod-loop-d.ko
new file mode 100644 (file)
index 0000000..3ab3348
Binary files /dev/null and b/testsuite/module-playground/cache/mod-loop-d.ko differ
diff --git a/testsuite/module-playground/cache/mod-loop-e.ko b/testsuite/module-playground/cache/mod-loop-e.ko
new file mode 100644 (file)
index 0000000..efe93ff
Binary files /dev/null and b/testsuite/module-playground/cache/mod-loop-e.ko differ
diff --git a/testsuite/module-playground/cache/mod-simple.ko b/testsuite/module-playground/cache/mod-simple.ko
new file mode 100644 (file)
index 0000000..2c5ffcf
Binary files /dev/null and b/testsuite/module-playground/cache/mod-simple.ko differ