diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2015-09-15 22:41:29 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2015-09-15 22:41:29 +0300 |
commit | 21f9b84b4b729fbd7acbd465e7a3f726e4d20f91 (patch) | |
tree | eb2d091d427ca0813b445509d59cc8e27e8ad25f /yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | |
parent | 101cef31e2bf54c678501155cd2106251acbd076 (diff) | |
parent | c124f4f2e04dca16a428a76c89677328bc7bf908 (diff) | |
download | openbmc-21f9b84b4b729fbd7acbd465e7a3f726e4d20f91.tar.xz |
Merge commit 'c124f4f2e04dca16a428a76c89677328bc7bf908' as 'yocto-poky'
Diffstat (limited to 'yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb')
-rw-r--r-- | yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb new file mode 100644 index 000000000..8acb3a858 --- /dev/null +++ b/yocto-poky/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb @@ -0,0 +1,48 @@ +SUMMARY = "Wrapper script for the Linux kernel module dependency indexer" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +S = "${WORKDIR}" + +INHIBIT_DEFAULT_DEPS = "1" +# The kernel and the staging dir for it is machine specific +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# We need the following for the sstate code to process the wrapper +SSTATE_SCAN_FILES += "depmodwrapper" + +do_install() { + install -d ${D}${bindir_crossscripts}/ + + cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF +#!/bin/sh +# Expected to be called as: depmodwrapper -a KERNEL_VERSION +if [ "\$1" != "-a" -o "\$2" != "-b" ]; then + echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2 + exit 1 +fi +if [ ! -r ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion ]; then + echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" >&2 +else + kernelabi=\$(cat ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion) + if [ "\$kernelabi" != "\$4" ]; then + echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2 + exit 1 + fi +fi + +if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ]; then + echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2 + exec env depmod "\$1" "\$2" "\$3" "\$4" +else + exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4" +fi +EOF + chmod +x ${D}${bindir_crossscripts}/depmodwrapper +} + +SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess" + +depmodwrapper_sysroot_preprocess () { + sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts} +} |