diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2012-08-09 18:58:30 -0300 |
---|---|---|
committer | Otavio Salvador <otavio@ossystems.com.br> | 2012-08-15 14:05:58 -0300 |
commit | f7a9eb15a97a47a69bb93ed95d2caf4f715c8c6d (patch) | |
tree | 39f9cfd0db7bfeb7ecb04fb589e06b830ae21d93 /recipes-kernel/linux/linux-imx.inc | |
parent | 4c37cc8af65709b9f29a2bc9115bc5c4ef9b7464 (diff) | |
download | meta-fsl-arm-f7a9eb15a97a47a69bb93ed95d2caf4f715c8c6d.tar.gz |
linux-imx.inc: add to avoid duplicating code among linux-imx' recipes
The linux-imx.inc hosts the common code of linux-imx recipes making it
easy to maintain and work.
To easily identify that the kernel running is built from Yocto and
give an indication of versioning, until we have a proper GIT revision
to point to, we use a local version with '+yocto-<date>' for it.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'recipes-kernel/linux/linux-imx.inc')
-rw-r--r-- | recipes-kernel/linux/linux-imx.inc | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-imx.inc b/recipes-kernel/linux/linux-imx.inc new file mode 100644 index 0000000..6909582 --- /dev/null +++ b/recipes-kernel/linux/linux-imx.inc | |||
@@ -0,0 +1,64 @@ | |||
1 | # Copyright (C) 2012 O.S. Systems Software LTDA. | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | DESCRIPTION = "Linux kernel for imx platforms" | ||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" | ||
7 | |||
8 | INC_PR = "r30" | ||
9 | |||
10 | inherit kernel | ||
11 | |||
12 | # Put a local version until we have a true SRCREV to point to | ||
13 | LOCALVERSION ?= "+yocto-${DATE}" | ||
14 | |||
15 | SRC_URI = "git://git.freescale.com/imx/linux-2.6-imx.git \ | ||
16 | file://defconfig \ | ||
17 | " | ||
18 | |||
19 | S = "${WORKDIR}/git" | ||
20 | |||
21 | kernel_conf_variable() { | ||
22 | CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" | ||
23 | if test "$2" = "n" | ||
24 | then | ||
25 | echo "# CONFIG_$1 is not set" >> ${S}/.config | ||
26 | else | ||
27 | echo "CONFIG_$1=$2" >> ${S}/.config | ||
28 | fi | ||
29 | } | ||
30 | |||
31 | do_configure_prepend() { | ||
32 | echo "" > ${S}/.config | ||
33 | CONF_SED_SCRIPT="" | ||
34 | |||
35 | kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\"" | ||
36 | kernel_conf_variable LOCALVERSION_AUTO n | ||
37 | |||
38 | sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${S}/.config' | ||
39 | } | ||
40 | |||
41 | # install nedded headers for imx-test compilation | ||
42 | do_install_append() { | ||
43 | # bounds.h may be used by a module and is currently missing | ||
44 | if [ -d include/generated ]; then | ||
45 | cp include/generated/* $kerneldir/include/generated/ | ||
46 | fi | ||
47 | |||
48 | # Host architecture object file | ||
49 | rm -f $kerneldir/scripts/kconfig/kxgettext.o | ||
50 | } | ||
51 | |||
52 | sysroot_stage_all_append() { | ||
53 | # denzil does not have KERNEL_SRC_PATH so we default to /kernel | ||
54 | destdir=${KERNEL_SRC_PATH} | ||
55 | if [ -z "$destdir" ]; then | ||
56 | destdir=/kernel | ||
57 | fi | ||
58 | |||
59 | # Copy native binaries need for imx-test build onto sysroot | ||
60 | mkdir -p ${SYSROOT_DESTDIR}/usr/src/kernel/scripts/basic \ | ||
61 | ${SYSROOT_DESTDIR}/usr/src/kernel/scripts/mod | ||
62 | cp ${S}/scripts/basic/fixdep ${SYSROOT_DESTDIR}$destdir/scripts/basic | ||
63 | cp ${S}/scripts/mod/modpost ${SYSROOT_DESTDIR}$destdir/scripts/mod | ||
64 | } | ||