diff options
-rw-r--r-- | images/enea-image-accelerated-sdk.bb | 4 | ||||
-rw-r--r-- | recipes-kernel/linux/kernel-devsrc.bb | 86 | ||||
-rw-r--r-- | recipes-kernel/linux/kernel.devsrc.acclx | 86 |
3 files changed, 176 insertions, 0 deletions
diff --git a/images/enea-image-accelerated-sdk.bb b/images/enea-image-accelerated-sdk.bb index 9d0d148..2766dc5 100644 --- a/images/enea-image-accelerated-sdk.bb +++ b/images/enea-image-accelerated-sdk.bb | |||
@@ -9,3 +9,7 @@ IMAGE_ROOTFS_EXTRA_SPACE = "1048576" | |||
9 | IMAGE_OVERHEAD_FACTOR = "1.5" | 9 | IMAGE_OVERHEAD_FACTOR = "1.5" |
10 | 10 | ||
11 | IMAGE_INSTALL += "kernel-devsrc" | 11 | IMAGE_INSTALL += "kernel-devsrc" |
12 | |||
13 | # Don't use the current implementation which provides a minimal subset of | ||
14 | # kernel sources used only to build OOT modules. | ||
15 | BBMASK += "meta/recipes-kernel/linux/kernel-devsrc.bb" | ||
diff --git a/recipes-kernel/linux/kernel-devsrc.bb b/recipes-kernel/linux/kernel-devsrc.bb new file mode 100644 index 0000000..8bbfa23 --- /dev/null +++ b/recipes-kernel/linux/kernel-devsrc.bb | |||
@@ -0,0 +1,86 @@ | |||
1 | SUMMARY = "Linux kernel Development Source" | ||
2 | DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \ | ||
3 | source of the preferred virtual/kernel provider and makes it available for full kernel \ | ||
4 | development or external module builds" | ||
5 | |||
6 | SECTION = "kernel" | ||
7 | |||
8 | LICENSE = "GPLv2" | ||
9 | |||
10 | inherit linux-kernel-base | ||
11 | |||
12 | # Whilst not a module, this ensures we don't get multilib extended (which would make no sense) | ||
13 | inherit module-base | ||
14 | |||
15 | # We need the kernel to be staged (unpacked, patched and configured) before | ||
16 | # we can grab the source and make the source package. We also need the bits from | ||
17 | # ${B} not to change while we install, so virtual/kernel must finish do_compile. | ||
18 | do_install[depends] += "virtual/kernel:do_shared_workdir" | ||
19 | # Need the source, not just the output of populate_sysroot | ||
20 | do_install[depends] += "virtual/kernel:do_install" | ||
21 | |||
22 | # There's nothing to do here, except install the source where we can package it | ||
23 | do_fetch[noexec] = "1" | ||
24 | do_unpack[noexec] = "1" | ||
25 | do_patch[noexec] = "1" | ||
26 | do_configure[noexec] = "1" | ||
27 | do_compile[noexec] = "1" | ||
28 | do_populate_sysroot[noexec] = "1" | ||
29 | |||
30 | S = "${STAGING_KERNEL_DIR}" | ||
31 | B = "${STAGING_KERNEL_BUILDDIR}" | ||
32 | |||
33 | KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}" | ||
34 | |||
35 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
36 | |||
37 | do_install() { | ||
38 | kerneldir=${D}${KERNEL_SRC_PATH} | ||
39 | install -d $kerneldir | ||
40 | |||
41 | # | ||
42 | # Copy the staging dir source (and module build support) into the devsrc structure. | ||
43 | # We can keep this copy simple and take everything, since a we'll clean up any build | ||
44 | # artifacts afterwards, and the extra i/o is not significant | ||
45 | # | ||
46 | cd ${B} | ||
47 | find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir | ||
48 | cd ${S} | ||
49 | find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir | ||
50 | |||
51 | # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not | ||
52 | # The main build artifacts. We clean the directory to avoid QA errors on mismatched | ||
53 | # architecture (since scripts and helpers are native format). | ||
54 | KBUILD_OUTPUT="$kerneldir" | ||
55 | oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts | ||
56 | # make clean generates an absolute path symlink called "source" | ||
57 | # in $kerneldir points to $kerneldir, which doesn't make any | ||
58 | # sense, so remove it. | ||
59 | if [ -L $kerneldir/source ]; then | ||
60 | bbnote "Removing $kerneldir/source symlink" | ||
61 | rm -f $kerneldir/source | ||
62 | fi | ||
63 | |||
64 | # As of Linux kernel version 3.0.1, the clean target removes | ||
65 | # arch/powerpc/lib/crtsavres.o which is present in | ||
66 | # KBUILD_LDFLAGS_MODULE, making it required to build external modules. | ||
67 | if [ ${ARCH} = "powerpc" ]; then | ||
68 | mkdir -p $kerneldir/arch/powerpc/lib/ | ||
69 | cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o | ||
70 | fi | ||
71 | |||
72 | # Remove fixdep/objtool as they won't be target binaries | ||
73 | for i in fixdep objtool; do | ||
74 | if [ -e $kerneldir/tools/objtool/$i ]; then | ||
75 | rm -rf $kerneldir/tools/objtool/$i | ||
76 | fi | ||
77 | done | ||
78 | |||
79 | chown -R root:root ${D} | ||
80 | } | ||
81 | # Ensure we don't race against "make scripts" during cpio | ||
82 | do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" | ||
83 | |||
84 | PACKAGES = "kernel-devsrc" | ||
85 | FILES_${PN} = "${KERNEL_SRC_PATH}" | ||
86 | RDEPENDS_${PN} = "bc" | ||
diff --git a/recipes-kernel/linux/kernel.devsrc.acclx b/recipes-kernel/linux/kernel.devsrc.acclx new file mode 100644 index 0000000..8bbfa23 --- /dev/null +++ b/recipes-kernel/linux/kernel.devsrc.acclx | |||
@@ -0,0 +1,86 @@ | |||
1 | SUMMARY = "Linux kernel Development Source" | ||
2 | DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \ | ||
3 | source of the preferred virtual/kernel provider and makes it available for full kernel \ | ||
4 | development or external module builds" | ||
5 | |||
6 | SECTION = "kernel" | ||
7 | |||
8 | LICENSE = "GPLv2" | ||
9 | |||
10 | inherit linux-kernel-base | ||
11 | |||
12 | # Whilst not a module, this ensures we don't get multilib extended (which would make no sense) | ||
13 | inherit module-base | ||
14 | |||
15 | # We need the kernel to be staged (unpacked, patched and configured) before | ||
16 | # we can grab the source and make the source package. We also need the bits from | ||
17 | # ${B} not to change while we install, so virtual/kernel must finish do_compile. | ||
18 | do_install[depends] += "virtual/kernel:do_shared_workdir" | ||
19 | # Need the source, not just the output of populate_sysroot | ||
20 | do_install[depends] += "virtual/kernel:do_install" | ||
21 | |||
22 | # There's nothing to do here, except install the source where we can package it | ||
23 | do_fetch[noexec] = "1" | ||
24 | do_unpack[noexec] = "1" | ||
25 | do_patch[noexec] = "1" | ||
26 | do_configure[noexec] = "1" | ||
27 | do_compile[noexec] = "1" | ||
28 | do_populate_sysroot[noexec] = "1" | ||
29 | |||
30 | S = "${STAGING_KERNEL_DIR}" | ||
31 | B = "${STAGING_KERNEL_BUILDDIR}" | ||
32 | |||
33 | KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}" | ||
34 | |||
35 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
36 | |||
37 | do_install() { | ||
38 | kerneldir=${D}${KERNEL_SRC_PATH} | ||
39 | install -d $kerneldir | ||
40 | |||
41 | # | ||
42 | # Copy the staging dir source (and module build support) into the devsrc structure. | ||
43 | # We can keep this copy simple and take everything, since a we'll clean up any build | ||
44 | # artifacts afterwards, and the extra i/o is not significant | ||
45 | # | ||
46 | cd ${B} | ||
47 | find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir | ||
48 | cd ${S} | ||
49 | find . -type d -name '.git*' -prune -o -type d -name '.kernel-meta' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir | ||
50 | |||
51 | # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not | ||
52 | # The main build artifacts. We clean the directory to avoid QA errors on mismatched | ||
53 | # architecture (since scripts and helpers are native format). | ||
54 | KBUILD_OUTPUT="$kerneldir" | ||
55 | oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts | ||
56 | # make clean generates an absolute path symlink called "source" | ||
57 | # in $kerneldir points to $kerneldir, which doesn't make any | ||
58 | # sense, so remove it. | ||
59 | if [ -L $kerneldir/source ]; then | ||
60 | bbnote "Removing $kerneldir/source symlink" | ||
61 | rm -f $kerneldir/source | ||
62 | fi | ||
63 | |||
64 | # As of Linux kernel version 3.0.1, the clean target removes | ||
65 | # arch/powerpc/lib/crtsavres.o which is present in | ||
66 | # KBUILD_LDFLAGS_MODULE, making it required to build external modules. | ||
67 | if [ ${ARCH} = "powerpc" ]; then | ||
68 | mkdir -p $kerneldir/arch/powerpc/lib/ | ||
69 | cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o | ||
70 | fi | ||
71 | |||
72 | # Remove fixdep/objtool as they won't be target binaries | ||
73 | for i in fixdep objtool; do | ||
74 | if [ -e $kerneldir/tools/objtool/$i ]; then | ||
75 | rm -rf $kerneldir/tools/objtool/$i | ||
76 | fi | ||
77 | done | ||
78 | |||
79 | chown -R root:root ${D} | ||
80 | } | ||
81 | # Ensure we don't race against "make scripts" during cpio | ||
82 | do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock" | ||
83 | |||
84 | PACKAGES = "kernel-devsrc" | ||
85 | FILES_${PN} = "${KERNEL_SRC_PATH}" | ||
86 | RDEPENDS_${PN} = "bc" | ||