diff options
| author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
| commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
| tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-kernel/kmod | |
| download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz | |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-kernel/kmod')
| -rw-r--r-- | meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 47 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod-native_git.bb | 16 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod.inc | 36 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod/0001-Fix-build-with-older-gcc-4.6.patch | 44 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod/depmod-search.conf | 6 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch | 17 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod/ptest.patch | 25 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod/remove_parallel_tests.patch | 18 | ||||
| -rwxr-xr-x | meta/recipes-kernel/kmod/kmod/run-ptest | 3 | ||||
| -rw-r--r-- | meta/recipes-kernel/kmod/kmod_git.bb | 70 |
10 files changed, 282 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb new file mode 100644 index 0000000000..305107865d --- /dev/null +++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | DESCRIPTION = "Depmod wrapper script" | ||
| 2 | LICENSE = "MIT" | ||
| 3 | PR = "r0" | ||
| 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
| 5 | |||
| 6 | INHIBIT_DEFAULT_DEPS = "1" | ||
| 7 | # The kernel and the staging dir for it is machine specific | ||
| 8 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 9 | |||
| 10 | # We need the following for the sstate code to process the wrapper | ||
| 11 | SSTATE_SCAN_FILES += "depmodwrapper" | ||
| 12 | |||
| 13 | do_install() { | ||
| 14 | install -d ${D}${bindir_crossscripts}/ | ||
| 15 | |||
| 16 | cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF | ||
| 17 | #!/bin/sh | ||
| 18 | # Expected to be called as: depmodwrapper -a KERNEL_VERSION | ||
| 19 | if [ "\$1" != "-a" -o "\$2" != "-b" ]; then | ||
| 20 | echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2 | ||
| 21 | exit 1 | ||
| 22 | fi | ||
| 23 | if [ ! -r ${STAGING_KERNEL_DIR}/kernel-abiversion ]; then | ||
| 24 | echo "Unable to read: ${STAGING_KERNEL_DIR}/kernel-abiversion" >&2 | ||
| 25 | else | ||
| 26 | kernelabi=\$(cat ${STAGING_KERNEL_DIR}/kernel-abiversion) | ||
| 27 | if [ "\$kernelabi" != "\$4" ]; then | ||
| 28 | echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2 | ||
| 29 | exit 1 | ||
| 30 | fi | ||
| 31 | fi | ||
| 32 | |||
| 33 | if [ ! -r ${STAGING_KERNEL_DIR}/System.map-\$4 ]; then | ||
| 34 | echo "Unable to read: ${STAGING_KERNEL_DIR}/System.map-\$4" >&2 | ||
| 35 | exec env depmod "\$1" "\$2" "\$3" "\$4" | ||
| 36 | else | ||
| 37 | exec env depmod "\$1" "\$2" "\$3" -F "${STAGING_KERNEL_DIR}/System.map-\$4" "\$4" | ||
| 38 | fi | ||
| 39 | EOF | ||
| 40 | chmod +x ${D}${bindir_crossscripts}/depmodwrapper | ||
| 41 | } | ||
| 42 | |||
| 43 | SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess" | ||
| 44 | |||
| 45 | depmodwrapper_sysroot_preprocess () { | ||
| 46 | sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
| 47 | } | ||
diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb new file mode 100644 index 0000000000..f22efc0615 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod-native_git.bb | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | # Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> | ||
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
| 3 | |||
| 4 | require kmod.inc | ||
| 5 | inherit native | ||
| 6 | |||
| 7 | SRC_URI += "file://fix-undefined-O_CLOEXEC.patch \ | ||
| 8 | file://0001-Fix-build-with-older-gcc-4.6.patch \ | ||
| 9 | " | ||
| 10 | |||
| 11 | do_install_append (){ | ||
| 12 | for tool in depmod insmod lsmod modinfo modprobe rmmod | ||
| 13 | do | ||
| 14 | ln -s kmod ${D}${bindir}/$tool | ||
| 15 | done | ||
| 16 | } | ||
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc new file mode 100644 index 0000000000..633258b05e --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod.inc | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | # Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> | ||
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
| 3 | |||
| 4 | DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \ | ||
| 5 | insert, remove, list, check properties, resolve dependencies and aliases." | ||
| 6 | HOMEPAGE = "http://packages.profusion.mobi/kmod/" | ||
| 7 | LICENSE = "GPL-2.0+ & LGPL-2.1+" | ||
| 8 | LICENSE_libkmod = "LGPL-2.1+" | ||
| 9 | SECTION = "base" | ||
| 10 | |||
| 11 | DEPENDS += "pkgconfig-native" | ||
| 12 | |||
| 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \ | ||
| 14 | file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ | ||
| 15 | " | ||
| 16 | inherit autotools gtk-doc ptest | ||
| 17 | |||
| 18 | SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \ | ||
| 19 | file://depmod-search.conf \ | ||
| 20 | file://run-ptest \ | ||
| 21 | file://ptest.patch \ | ||
| 22 | file://remove_parallel_tests.patch \ | ||
| 23 | " | ||
| 24 | |||
| 25 | SRCREV = "3b38c7fcb58be4ddc34f90454c5f5dc3693d2d85" | ||
| 26 | # Lookout for PV bump too when SRCREV is changed | ||
| 27 | PV = "14" | ||
| 28 | |||
| 29 | S = "${WORKDIR}/git" | ||
| 30 | |||
| 31 | EXTRA_AUTORECONF += "--install --symlink" | ||
| 32 | EXTRA_OECONF +="--enable-debug --enable-logging --enable-tools --disable-manpages" | ||
| 33 | |||
| 34 | do_configure_prepend () { | ||
| 35 | gtkdocize --docdir ${S}/libkmod/docs || touch ${S}/libkmod/docs/gtk-doc.make | ||
| 36 | } | ||
diff --git a/meta/recipes-kernel/kmod/kmod/0001-Fix-build-with-older-gcc-4.6.patch b/meta/recipes-kernel/kmod/kmod/0001-Fix-build-with-older-gcc-4.6.patch new file mode 100644 index 0000000000..f8ff103087 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/0001-Fix-build-with-older-gcc-4.6.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | Upstream-Status: Inappropriate [kmod is new] | ||
| 2 | |||
| 3 | From 30e1839a46b0b9449f272765193a0da61bf85997 Mon Sep 17 00:00:00 2001 | ||
| 4 | From: Khem Raj <raj.khem@gmail.com> | ||
| 5 | Date: Mon, 26 Aug 2013 15:32:36 -0700 | ||
| 6 | Subject: [PATCH] Fix build with older gcc < 4.6 | ||
| 7 | |||
| 8 | Static_assert is new feature in C11 standards and older than gcc 4.6 | ||
| 9 | does not support it. So define it to make the old gcc happy | ||
| 10 | |||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 12 | --- | ||
| 13 | libkmod/macro.h | 14 ++++++++++++-- | ||
| 14 | 1 file changed, 12 insertions(+), 2 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/libkmod/macro.h b/libkmod/macro.h | ||
| 17 | index c6ba855..5032f54 100644 | ||
| 18 | --- a/libkmod/macro.h | ||
| 19 | +++ b/libkmod/macro.h | ||
| 20 | @@ -20,9 +20,19 @@ | ||
| 21 | #pragma once | ||
| 22 | |||
| 23 | #include <stddef.h> | ||
| 24 | - | ||
| 25 | -#define assert_cc(expr) \ | ||
| 26 | +#if defined(__GNUC__) | ||
| 27 | +/* Determine which version of GNU C we're using */ | ||
| 28 | +#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) | ||
| 29 | +#endif | ||
| 30 | +#if (GCC_VERSION >= 40600) | ||
| 31 | +# define assert_cc(expr) \ | ||
| 32 | _Static_assert((expr), #expr) | ||
| 33 | +#else | ||
| 34 | +# define STATIC_ASSERT_GLUE1(x, y) x##y | ||
| 35 | +# define STATIC_ASSERT_GLUE(x, y) STATIC_ASSERT_GLUE1(x, y) | ||
| 36 | +# define assert_cc(expr) \ | ||
| 37 | +extern void STATIC_ASSERT_GLUE(static_assert, __LINE__)(int arg[(expr) ? 1 : -1]) __attribute__((unused)) | ||
| 38 | +#endif | ||
| 39 | |||
| 40 | #if HAVE_TYPEOF | ||
| 41 | #define check_types_match(expr1, expr2) \ | ||
| 42 | -- | ||
| 43 | 1.8.3.4 | ||
| 44 | |||
diff --git a/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/meta/recipes-kernel/kmod/kmod/depmod-search.conf new file mode 100644 index 0000000000..527c0bb6ee --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/depmod-search.conf | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | # | ||
| 2 | # /etc/depmod.d/depmod.conf | ||
| 3 | # | ||
| 4 | |||
| 5 | search updates extramodules built-in | ||
| 6 | |||
diff --git a/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch new file mode 100644 index 0000000000..0268216230 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/fix-undefined-O_CLOEXEC.patch | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | Upstream-Status: Not applicable | ||
| 2 | |||
| 3 | Index: git/libkmod/libkmod-private.h | ||
| 4 | =================================================================== | ||
| 5 | --- git.orig/libkmod/libkmod-private.h 2013-08-21 10:07:51.000000000 -0700 | ||
| 6 | +++ git/libkmod/libkmod-private.h 2013-08-21 14:34:04.558278849 -0700 | ||
| 7 | @@ -9,6 +9,10 @@ | ||
| 8 | #include "macro.h" | ||
| 9 | #include "libkmod.h" | ||
| 10 | |||
| 11 | +#ifndef O_CLOEXEC | ||
| 12 | +# define O_CLOEXEC 0 | ||
| 13 | +#endif | ||
| 14 | + | ||
| 15 | static _always_inline_ _printf_format_(2, 3) void | ||
| 16 | kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {} | ||
| 17 | |||
diff --git a/meta/recipes-kernel/kmod/kmod/ptest.patch b/meta/recipes-kernel/kmod/kmod/ptest.patch new file mode 100644 index 0000000000..831dbcb909 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/ptest.patch | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | Add 'install-ptest' rule. | ||
| 2 | |||
| 3 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 4 | Upstream-Status: Pending | ||
| 5 | |||
| 6 | diff -ruN a/Makefile.am b/Makefile.am | ||
| 7 | --- a/Makefile.am 2013-07-12 17:11:05.278331557 +0200 | ||
| 8 | +++ b/Makefile.am 2013-07-12 17:14:27.033788016 +0200 | ||
| 9 | @@ -204,6 +204,16 @@ | ||
| 10 | |||
| 11 | distclean-local: $(DISTCLEAN_LOCAL_HOOKS) | ||
| 12 | |||
| 13 | +install-ptest: | ||
| 14 | + @$(MKDIR_P) $(DESTDIR)/testsuite | ||
| 15 | + @for file in $(TESTSUITE); do \ | ||
| 16 | + install $$file $(DESTDIR)/testsuite; \ | ||
| 17 | + done; | ||
| 18 | + @sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile | ||
| 19 | + @$(MKDIR_P) $(DESTDIR)/tools | ||
| 20 | + @cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools | ||
| 21 | + @cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite | ||
| 22 | + | ||
| 23 | # ------------------------------------------------------------------------------ | ||
| 24 | # custom release helpers | ||
| 25 | # ------------------------------------------------------------------------------ | ||
diff --git a/meta/recipes-kernel/kmod/kmod/remove_parallel_tests.patch b/meta/recipes-kernel/kmod/kmod/remove_parallel_tests.patch new file mode 100644 index 0000000000..ee1942806b --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/remove_parallel_tests.patch | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | Avoid parallel-tests as it remove | ||
| 2 | buildtest-TESTS and runtest-TESTS targets | ||
| 3 | |||
| 4 | Signed-off-by: Tudor Florea <tudor.florea@enea.com> | ||
| 5 | Upstream-Status: Inappropriate (disable feature incompatible with ptest) | ||
| 6 | |||
| 7 | diff -ruN a/configure.ac b/configure.ac | ||
| 8 | --- a/configure.ac 2013-09-02 15:05:18.662366800 +0200 | ||
| 9 | +++ b/configure.ac 2013-09-02 15:05:49.557066764 +0200 | ||
| 10 | @@ -8,7 +8,7 @@ | ||
| 11 | AC_CONFIG_SRCDIR([libkmod/libkmod.c]) | ||
| 12 | AC_CONFIG_AUX_DIR([build-aux]) | ||
| 13 | AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules | ||
| 14 | - tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests]) | ||
| 15 | + tar-pax no-dist-gzip dist-xz subdir-objects color-tests]) | ||
| 16 | AC_PROG_CC_STDC | ||
| 17 | AC_USE_SYSTEM_EXTENSIONS | ||
| 18 | AC_SYS_LARGEFILE | ||
diff --git a/meta/recipes-kernel/kmod/kmod/run-ptest b/meta/recipes-kernel/kmod/kmod/run-ptest new file mode 100755 index 0000000000..37adec3d2f --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/run-ptest | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | touch testsuite/stamp-rootfs | ||
| 3 | make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL | ||
diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb new file mode 100644 index 0000000000..ebecbcc82e --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod_git.bb | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | # Copyright (C) 2012 Khem Raj <raj.khem@gmail.com> | ||
| 2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
| 3 | |||
| 4 | require kmod.inc | ||
| 5 | |||
| 6 | PV_append = "+git${SRCPV}" | ||
| 7 | |||
| 8 | PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
| 9 | RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
| 10 | RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
| 11 | RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
| 12 | |||
| 13 | # to force user to remove old module-init-tools and replace them with kmod variants | ||
| 14 | RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools" | ||
| 15 | |||
| 16 | # autotools set prefix to /usr, however we want them in /bin and /sbin | ||
| 17 | bindir = "${base_bindir}" | ||
| 18 | sbindir = "${base_sbindir}" | ||
| 19 | # libdir = "${base_libdir}" | ||
| 20 | |||
| 21 | do_install_append () { | ||
| 22 | install -dm755 ${D}${base_bindir} | ||
| 23 | install -dm755 ${D}${base_sbindir} | ||
| 24 | # add symlinks to kmod | ||
| 25 | ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod | ||
| 26 | for tool in insmod rmmod depmod modinfo modprobe; do | ||
| 27 | ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool} | ||
| 28 | done | ||
| 29 | # configuration directories | ||
| 30 | install -dm755 ${D}${base_libdir}/depmod.d | ||
| 31 | install -dm755 ${D}${base_libdir}/modprobe.d | ||
| 32 | install -dm755 ${D}${sysconfdir}/depmod.d | ||
| 33 | install -dm755 ${D}${sysconfdir}/modprobe.d | ||
| 34 | |||
| 35 | # install depmod.d file for search/ dir | ||
| 36 | install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf" | ||
| 37 | } | ||
| 38 | |||
| 39 | do_compile_prepend() { | ||
| 40 | sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status | ||
| 41 | } | ||
| 42 | |||
| 43 | do_compile_ptest () { | ||
| 44 | oe_runmake buildtest-TESTS rootfs | ||
| 45 | } | ||
| 46 | |||
| 47 | INHIBIT_PACKAGE_STRIP = "${@base_contains("DISTRO_FEATURES", "ptest", "1", "0", d)}" | ||
| 48 | INSANE_SKIP_${PN}-ptest = "arch" | ||
| 49 | |||
| 50 | inherit update-alternatives | ||
| 51 | |||
| 52 | ALTERNATIVE_PRIORITY = "60" | ||
| 53 | |||
| 54 | ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod" | ||
| 55 | |||
| 56 | ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod" | ||
| 57 | ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe" | ||
| 58 | ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod" | ||
| 59 | ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo" | ||
| 60 | ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod" | ||
| 61 | |||
| 62 | ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod" | ||
| 63 | ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}" | ||
| 64 | |||
| 65 | ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" | ||
| 66 | |||
| 67 | PACKAGES =+ "libkmod" | ||
| 68 | |||
| 69 | FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" | ||
| 70 | FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d" | ||
