diff options
Diffstat (limited to 'meta-renesas-extras/classes/renesas-module.bbclass')
-rw-r--r-- | meta-renesas-extras/classes/renesas-module.bbclass | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/meta-renesas-extras/classes/renesas-module.bbclass b/meta-renesas-extras/classes/renesas-module.bbclass new file mode 100644 index 0000000..a0b5014 --- /dev/null +++ b/meta-renesas-extras/classes/renesas-module.bbclass | |||
@@ -0,0 +1,79 @@ | |||
1 | ############################################################################ | ||
2 | ## | ||
3 | ## Copyright (C) 2016 The Qt Company Ltd. | ||
4 | ## Contact: https://www.qt.io/licensing/ | ||
5 | ## | ||
6 | ## This file is part of the Boot to Qt meta layer. | ||
7 | ## | ||
8 | ## $QT_BEGIN_LICENSE:GPL$ | ||
9 | ## Commercial License Usage | ||
10 | ## Licensees holding valid commercial Qt licenses may use this file in | ||
11 | ## accordance with the commercial license agreement provided with the | ||
12 | ## Software or, alternatively, in accordance with the terms contained in | ||
13 | ## a written agreement between you and The Qt Company. For licensing terms | ||
14 | ## and conditions see https://www.qt.io/terms-conditions. For further | ||
15 | ## information use the contact form at https://www.qt.io/contact-us. | ||
16 | ## | ||
17 | ## GNU General Public License Usage | ||
18 | ## Alternatively, this file may be used under the terms of the GNU | ||
19 | ## General Public License version 3 or (at your option) any later version | ||
20 | ## approved by the KDE Free Qt Foundation. The licenses are as published by | ||
21 | ## the Free Software Foundation and appearing in the file LICENSE.GPL3 | ||
22 | ## included in the packaging of this file. Please review the following | ||
23 | ## information to ensure the GNU General Public License requirements will | ||
24 | ## be met: https://www.gnu.org/licenses/gpl-3.0.html. | ||
25 | ## | ||
26 | ## $QT_END_LICENSE$ | ||
27 | ## | ||
28 | ############################################################################ | ||
29 | |||
30 | ### Unfortunately the kernel module recipes in meta-renesas/meta-rcar-gen2 | ||
31 | ### are fairly broken, as they tend to install their include files into the | ||
32 | ### staging area. That breaks when recompiling the kernel and is just flaky | ||
33 | ### in general. Try to make things work reliably. | ||
34 | |||
35 | inherit module | ||
36 | addtask shared_workdir after do_compile | ||
37 | |||
38 | EXTRA_OEMAKE += "ARCH=${ARCH}" | ||
39 | |||
40 | export BUILDDIR = "${STAGING_DIR_HOST}" | ||
41 | export LIBSHARED = "${STAGING_LIBDIR}" | ||
42 | export KERNELSRC = "${STAGING_KERNEL_DIR}" | ||
43 | export CROSS_COMPILE = "${TARGET_PREFIX}" | ||
44 | export KERNELDIR = "${STAGING_KERNEL_BUILDDIR}" | ||
45 | export LDFLAGS = "" | ||
46 | export CP = "cp" | ||
47 | |||
48 | MODULE_SOURCE_DIR ?= "${S}/drv/" | ||
49 | |||
50 | do_compile() { | ||
51 | cd ${MODULE_SOURCE_DIR} | ||
52 | module_do_compile | ||
53 | cd - | ||
54 | } | ||
55 | |||
56 | deploy_build_deps() { | ||
57 | targetdir="$1" | ||
58 | |||
59 | install -d ${targetdir}/include | ||
60 | install ${MODULE_SOURCE_DIR}/Module.symvers $targetdir/include/${MODULE_NAME}.symvers | ||
61 | |||
62 | for header in ${MODULE_HEADERS} ; do | ||
63 | install -t ${targetdir}/include ${S}/${header} | ||
64 | done | ||
65 | } | ||
66 | |||
67 | do_shared_workdir () { | ||
68 | deploy_build_deps ${STAGING_KERNEL_BUILDDIR} | ||
69 | } | ||
70 | |||
71 | do_install() { | ||
72 | install -D ${MODULE_SOURCE_DIR}/${MODULE_NAME}${KERNEL_OBJECT_SUFFIX} ${D}/lib/modules/${KERNEL_VERSION}/extra/${MODULE_NAME}${KERNEL_OBJECT_SUFFIX} | ||
73 | deploy_build_deps ${D}/usr/src/kernel | ||
74 | } | ||
75 | |||
76 | FILES_${PN}-dev = " \ | ||
77 | /usr/src/kernel/include/${MODULE_NAME}.symvers \ | ||
78 | /usr/src/kernel/include/*.h \ | ||
79 | " | ||