diff options
Diffstat (limited to 'meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_7.0.0.bb')
| -rw-r--r-- | meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_7.0.0.bb | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_7.0.0.bb b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_7.0.0.bb new file mode 100644 index 0000000000..46484475ed --- /dev/null +++ b/meta-oe/recipes-support/vboxguestdrivers/vboxguestdrivers_7.0.0.bb | |||
| @@ -0,0 +1,91 @@ | |||
| 1 | SUMMARY = "VirtualBox Linux Guest Drivers" | ||
| 2 | SECTION = "core" | ||
| 3 | LICENSE = "GPL-3.0-only" | ||
| 4 | LIC_FILES_CHKSUM = "file://${WORKDIR}/${VBOX_NAME}/COPYING;md5=fff5fe1c81dd6dc3d522e7862e44881e" | ||
| 5 | |||
| 6 | DEPENDS = "virtual/kernel" | ||
| 7 | |||
| 8 | inherit module kernel-module-split | ||
| 9 | |||
| 10 | COMPATIBLE_MACHINE = "(qemux86|qemux86-64)" | ||
| 11 | |||
| 12 | VBOX_NAME = "VirtualBox-${PV}" | ||
| 13 | |||
| 14 | SRC_URI = "http://download.virtualbox.org/virtualbox/${PV}/${VBOX_NAME}.tar.bz2 \ | ||
| 15 | file://Makefile.utils \ | ||
| 16 | " | ||
| 17 | |||
| 18 | SRC_URI[sha256sum] = "1e5b321bf20eec03154e2b3e16331f827a472d6e8e5b1e04c27041978975a97a" | ||
| 19 | |||
| 20 | S ?= "${WORKDIR}/vbox_module" | ||
| 21 | S:task-patch = "${WORKDIR}/${VBOX_NAME}" | ||
| 22 | |||
| 23 | export VBOX_KBUILD_TARGET_ARCH="${ARCH}" | ||
| 24 | export VBOX_KBUILD_TARGET_ARCH:x86-64="amd64" | ||
| 25 | |||
| 26 | EXTRA_OEMAKE += "KERN_DIR='${WORKDIR}/${KERNEL_VERSION}/build' KBUILD_VERBOSE=1" | ||
| 27 | |||
| 28 | # otherwise 5.2.22 builds just vboxguest | ||
| 29 | MAKE_TARGETS = "all" | ||
| 30 | |||
| 31 | addtask export_sources after do_patch before do_configure | ||
| 32 | do_export_sources[depends] += "virtual/kernel:do_shared_workdir" | ||
| 33 | |||
| 34 | do_export_sources() { | ||
| 35 | mkdir -p "${S}" | ||
| 36 | ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/export_modules.sh ${T}/vbox_modules.tar.gz | ||
| 37 | tar -C "${S}" -xzf ${T}/vbox_modules.tar.gz | ||
| 38 | |||
| 39 | # add a mount utility to use shared folder from VBox Addition Source Code | ||
| 40 | mkdir -p "${S}/utils" | ||
| 41 | install ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c ${S}/utils | ||
| 42 | install ${WORKDIR}/${VBOX_NAME}/src/VBox/Additions/linux/sharedfolders/vbsfmount.c ${S}/utils | ||
| 43 | install ${S}/../Makefile.utils ${S}/utils/Makefile | ||
| 44 | |||
| 45 | # some kernel versions have issues with stdarg.h and compatibility with | ||
| 46 | # the sysroot and libc-headers/uapi. If we include the file directly from | ||
| 47 | # the kernel source (STAGING_KERNEL_DIR) we get conflicting types on many | ||
| 48 | # structures, due to kernel .h files being found before libc .h files. | ||
| 49 | # if we grab just this one file from the source, and put it into our | ||
| 50 | # file structure, everything holds together | ||
| 51 | mkdir -p ${S}/vboxsf/include/linux | ||
| 52 | install ${STAGING_KERNEL_DIR}/include/linux/stdarg.h ${S}/vboxsf/include/linux | ||
| 53 | } | ||
| 54 | |||
| 55 | do_configure:prepend() { | ||
| 56 | # vboxguestdrivers/5.2.6-r0/vbox_module/vboxguest/Makefile.include.header:99: *** The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set. Stop. | ||
| 57 | # vboxguestdrivers/5.2.6-r0/vbox_module/vboxguest/Makefile.include.header:108: *** The kernel build folder path must end in <version>/build, or the variable KERN_VER must be set. Stop. | ||
| 58 | mkdir -p ${WORKDIR}/${KERNEL_VERSION} | ||
| 59 | ln -snf ${STAGING_KERNEL_DIR} ${WORKDIR}/${KERNEL_VERSION}/build | ||
| 60 | } | ||
| 61 | |||
| 62 | # compile and install mount utility | ||
| 63 | do_compile() { | ||
| 64 | oe_runmake all | ||
| 65 | oe_runmake 'LD=${CC}' 'EXTRA_CFLAGS=-I${STAGING_KERNEL_BUILDDIR}/include/' 'LDFLAGS=${LDFLAGS}' -C ${S}/utils | ||
| 66 | if ! [ -e vboxguest.ko -a -e vboxsf.ko -a -e vboxvideo.ko ] ; then | ||
| 67 | echo "ERROR: One of vbox*.ko modules wasn't built" | ||
| 68 | exit 1 | ||
| 69 | fi | ||
| 70 | } | ||
| 71 | |||
| 72 | module_do_install() { | ||
| 73 | MODULE_DIR=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel/misc | ||
| 74 | install -d $MODULE_DIR | ||
| 75 | install -m 644 vboxguest.ko $MODULE_DIR | ||
| 76 | install -m 644 vboxsf.ko $MODULE_DIR | ||
| 77 | install -m 644 vboxvideo.ko $MODULE_DIR | ||
| 78 | } | ||
| 79 | |||
| 80 | do_install:append() { | ||
| 81 | install -d ${D}${base_sbindir} | ||
| 82 | install -m 755 ${S}/utils/mount.vboxsf ${D}${base_sbindir} | ||
| 83 | } | ||
| 84 | |||
| 85 | PACKAGES += "kernel-module-vboxguest kernel-module-vboxsf kernel-module-vboxvideo" | ||
| 86 | RRECOMMENDS:${PN} += "kernel-module-vboxguest kernel-module-vboxsf kernel-module-vboxvideo" | ||
| 87 | |||
| 88 | FILES:${PN} = "${base_sbindir}" | ||
| 89 | |||
| 90 | # autoload if installed | ||
| 91 | KERNEL_MODULE_AUTOLOAD += "vboxguest vboxsf vboxvideo" | ||
