diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-01-02 14:08:03 -0800 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2018-01-02 15:05:44 -0800 |
commit | cc71e0a589fd6ca3f40137ff5b21675684172c9b (patch) | |
tree | 0741d54ed965323e8e4938bed750b8d3efa18a07 | |
parent | bb83f6ac68fe66c6e17afcab2cd6c2712e5c570e (diff) | |
download | kmod-cc71e0a589fd6ca3f40137ff5b21675684172c9b.tar.gz kmod-cc71e0a589fd6ca3f40137ff5b21675684172c9b.tar.bz2 kmod-cc71e0a589fd6ca3f40137ff5b21675684172c9b.zip |
build: add mkosi hooks
Right now there's support for building on Archlinux only.
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | testsuite/mkosi/.gitignore | 4 | ||||
-rw-r--r-- | testsuite/mkosi/mkosi.arch | 22 | ||||
-rwxr-xr-x | testsuite/mkosi/mkosi.build | 23 | ||||
l--------- | testsuite/mkosi/mkosi.default | 1 |
5 files changed, 58 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 2a1eb50..b7ee6b1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -498,3 +498,11 @@ tar: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign tar-sync: kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign kup put kmod-$(VERSION).tar.xz kmod-$(VERSION).tar.sign /pub/linux/utils/kernel/kmod/ + +# ------------------------------------------------------------------------------ +# mkosi +# ------------------------------------------------------------------------------ + +mkosi: + -mkdir $(top_srcdir)/testsuite/mkosi/mkosi.cache + mkosi -C $(top_srcdir)/testsuite/mkosi --build-sources ../../ -fi diff --git a/testsuite/mkosi/.gitignore b/testsuite/mkosi/.gitignore new file mode 100644 index 0000000..024d05b --- /dev/null +++ b/testsuite/mkosi/.gitignore @@ -0,0 +1,4 @@ +/image.raw* +/.mkosi-* +/mkosi.cache +/rootfs diff --git a/testsuite/mkosi/mkosi.arch b/testsuite/mkosi/mkosi.arch new file mode 100644 index 0000000..308dcdb --- /dev/null +++ b/testsuite/mkosi/mkosi.arch @@ -0,0 +1,22 @@ +[Distribution] +Distribution=arch +Release=(rolling) + +[Packages] +Packages = valgrind +BuildPackages = + automake + gcc + git + make + pkg-config + python2 + python2-future + autoconf + gtk-doc + docbook-xml + docbook-xsl + linux-headers + +[Partitions] +RootSize = 4G diff --git a/testsuite/mkosi/mkosi.build b/testsuite/mkosi/mkosi.build new file mode 100755 index 0000000..a6b325f --- /dev/null +++ b/testsuite/mkosi/mkosi.build @@ -0,0 +1,23 @@ +#!/bin/bash -ex + +if [ -f configure ]; then + make distclean +fi + +rm -rf build +mkdir build +cd build + +kdirs=(/usr/lib/modules/*/build/Makefile) +if [[ ! -f ${kdirs[0]} ]]; then + printf '==> Unable to find kernel headers to build modules for tests\n' >&2 + return 1 +fi + +kdir=${kdirs[0]%/Makefile} +IFS=/ read _ _ _ kver _ <<<"$kdir" + +../autogen.sh c +make -j +make check KDIR="$kdir" KVER="$kver" +make install diff --git a/testsuite/mkosi/mkosi.default b/testsuite/mkosi/mkosi.default new file mode 120000 index 0000000..695b71a --- /dev/null +++ b/testsuite/mkosi/mkosi.default @@ -0,0 +1 @@ +mkosi.arch
\ No newline at end of file |