summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb')
-rw-r--r--meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb46
1 files changed, 46 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..ec20bf8d30
--- /dev/null
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -0,0 +1,46 @@
1SUMMARY = "Wrapper script for the Linux kernel module dependency indexer"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5INHIBIT_DEFAULT_DEPS = "1"
6# The kernel and the staging dir for it is machine specific
7PACKAGE_ARCH = "${MACHINE_ARCH}"
8
9# We need the following for the sstate code to process the wrapper
10SSTATE_SCAN_FILES += "depmodwrapper"
11
12do_install() {
13 install -d ${D}${bindir_crossscripts}/
14
15 cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF
16#!/bin/sh
17# Expected to be called as: depmodwrapper -a KERNEL_VERSION
18if [ "\$1" != "-a" -o "\$2" != "-b" ]; then
19 echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2
20 exit 1
21fi
22if [ ! -r ${STAGING_KERNEL_DIR}/kernel-abiversion ]; then
23 echo "Unable to read: ${STAGING_KERNEL_DIR}/kernel-abiversion" >&2
24else
25 kernelabi=\$(cat ${STAGING_KERNEL_DIR}/kernel-abiversion)
26 if [ "\$kernelabi" != "\$4" ]; then
27 echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2
28 exit 1
29 fi
30fi
31
32if [ ! -r ${STAGING_KERNEL_DIR}/System.map-\$4 ]; then
33 echo "Unable to read: ${STAGING_KERNEL_DIR}/System.map-\$4" >&2
34 exec env depmod "\$1" "\$2" "\$3" "\$4"
35else
36 exec env depmod "\$1" "\$2" "\$3" -F "${STAGING_KERNEL_DIR}/System.map-\$4" "\$4"
37fi
38EOF
39 chmod +x ${D}${bindir_crossscripts}/depmodwrapper
40}
41
42SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess"
43
44depmodwrapper_sysroot_preprocess () {
45 sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
46}