diff options
Diffstat (limited to 'meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb')
-rw-r--r-- | meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 46 |
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 @@ | |||
1 | SUMMARY = "Wrapper script for the Linux kernel module dependency indexer" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
4 | |||
5 | INHIBIT_DEFAULT_DEPS = "1" | ||
6 | # The kernel and the staging dir for it is machine specific | ||
7 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
8 | |||
9 | # We need the following for the sstate code to process the wrapper | ||
10 | SSTATE_SCAN_FILES += "depmodwrapper" | ||
11 | |||
12 | do_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 | ||
18 | if [ "\$1" != "-a" -o "\$2" != "-b" ]; then | ||
19 | echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2 | ||
20 | exit 1 | ||
21 | fi | ||
22 | if [ ! -r ${STAGING_KERNEL_DIR}/kernel-abiversion ]; then | ||
23 | echo "Unable to read: ${STAGING_KERNEL_DIR}/kernel-abiversion" >&2 | ||
24 | else | ||
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 | ||
30 | fi | ||
31 | |||
32 | if [ ! -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" | ||
35 | else | ||
36 | exec env depmod "\$1" "\$2" "\$3" -F "${STAGING_KERNEL_DIR}/System.map-\$4" "\$4" | ||
37 | fi | ||
38 | EOF | ||
39 | chmod +x ${D}${bindir_crossscripts}/depmodwrapper | ||
40 | } | ||
41 | |||
42 | SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess" | ||
43 | |||
44 | depmodwrapper_sysroot_preprocess () { | ||
45 | sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts} | ||
46 | } | ||