Skip to content

Instantly share code, notes, and snippets.

@kergoth
Created February 20, 2014 19:12
Show Gist options
  • Save kergoth/9121044 to your computer and use it in GitHub Desktop.
Save kergoth/9121044 to your computer and use it in GitHub Desktop.
Work-in-progress open-vm-tools recipe(s) for vmware images
SUMMARY = "Open Virtual Machine Tools - kernel modules"
DESCRIPTION = "Open-Source kernel modules from VMware"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "\
file://modules/linux/vmblock/COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://modules/linux/vmci/COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://modules/linux/vmhgfs/COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://modules/linux/vmsync/COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://modules/linux/vmxnet/COPYING;md5=751419260aa954499f7abaabaa882bbe \
file://modules/linux/vsock/COPYING;md5=751419260aa954499f7abaabaa882bbe \
"
SRC_URI = "${SOURCEFORGE_MIRROR}/open-vm-tools/open-vm-tools-${PV}.tar.gz"
SRC_URI[md5sum] = "91f74bf6e42a3f460a42b3be31db31dc"
SRC_URI[sha256sum] = "5d30652eb0f6dc5e930781029c184837e700be5543b6a7116db4c62a6f3ca399"
#inherit autotools gettext pkgconfig module
inherit module
S = "${WORKDIR}/open-vm-tools-${PV}"
SEPB ?= "${S}"
B = "${SEPB}"
EXTRA_OECONF += "\
--without-root-privileges \
--with-kernel-modules \
--with-kernel-revision=${KERNEL_VERSION} \
--with-linuxdir=${STAGING_KERNEL_DIR} \
--without-icu \
--without-pam \
--without-procps \
--without-dnet \
--without-x \
--without-gtk2 \
--without-gtkmm \
--disable-docs \
--disable-tests \
--disable-multimon \
"
EXTRA_OEMAKE += "'SUBDIRS=modules'"
EXTRA_OEMAKE = "\
'CC=${KERNEL_CC} -I${S}/modules/linux/shared' \
'LD=${KERNEL_LD}' \
'AR=${KERNEL_AR}' \
'LINUXINCLUDE=${STAGING_KERNEL_DIR}/include' \
'OVT_SOURCE_DIR=${S}' \
'DEPMOD=echo' \
"
do_prepare_sources () {
sed -i 's|-Werror||g; s|/build/include|/include|' ${S}/configure{,.ac}
}
do_patch[postfuncs] += "do_prepare_sources"
do_compile () {
for dir in ${S}/modules/linux/v*/; do
oe_runmake "MODULEBUILDDIR=$dir" -C "$dir"
done
}
do_install () {
for dir in ${S}/modules/linux/v*/; do
oe_runmake -C "$dir" 'INSTALL_MOD_PATH=${D}' modules_install
done
}
SUMMARY = "Open Virtual Machine Tools - userland components"
DESCRIPTION = "Open-Source userland tools from VMware"
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "\
file://checkvm/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://hgfsclient/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://hgfsmounter/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://lib/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://libguestlib/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://libvmtools/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://rpctool/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://scripts/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/plugins/guestInfo/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/plugins/hgfsServer/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/plugins/powerOps/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/plugins/resolutionSet/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/plugins/timeSync/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/plugins/vix/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/plugins/vmbackup/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://services/vmtoolsd/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://tests/testDebug/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://tests/testPlugin/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://tests/testVmblock/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://tests/vmrpcdbg/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://toolbox/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://vmblock-fuse/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://vmware-user-suid-wrapper/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
file://xferlogs/COPYING;md5=5804fe91d3294da4ac47c02b454bbc8a \
"
SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
SRC_URI[md5sum] = "91f74bf6e42a3f460a42b3be31db31dc"
SRC_URI[sha256sum] = "5d30652eb0f6dc5e930781029c184837e700be5543b6a7116db4c62a6f3ca399"
# The fuse dependency is optional, but if missing, disables vmblock-fuse, and
# there's no current configure option to control it explicitly. Same for xsm
# and icu, though we don't really expect those to ever be missing.
# glib-2.0-native is required to be able to run genmarshal
DEPENDS = "glib-2.0 glib-2.0-native fuse"
# Possible: libxss, iproute2, uriparser, libnotify, networkmanager
inherit autotools gettext pkgconfig
SEPB ?= "${S}"
B = "${SEPB}"
PACKAGECONFIG ?= "\
icu \
procps \
${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
"
PACKAGECONFIG[icu] = "--with-icu,--without-icu,icu,"
PACKAGECONFIG[pam] = "--with-pam --with-pam-prefix=${sysconfdir},--without-pam,libpam,"
PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,,"
PACKAGECONFIG[multimon] = "--enable-multimon,--disable-multimon,libxinerama,"
PACKAGECONFIG[docs] = "--enable-docs,--disable-docs,graphviz-native doxygen-native mscgen-native,"
# Controls support for 'meminfo'
PACKAGECONFIG[procps] = "--with-procps,--without-procps,procps,"
# Controls support for 'nicinfo'
PACKAGECONFIG[dnet] = "--with-dnet,--without-dnet,libdnet,"
# gtkmm is used for the drag & drop and copy & paste functionality
# libsm technically isn't required, but is unlikely to ever be missing, and
# there's no configure argument to disable it anyway
X11_LIBS = "virtual/libx11 libxcomposite libxrandr libxrender libxi libxtst \
libxext libsm gdk-pixbuf gtk+ gtkmm libsigc++-2.0"
PACKAGECONFIG[x11] = "--with-x --with-gtk2 --with-gtkmm,--without-x --without-gtk2 --without-gtkmm,${X11_LIBS}"
EXTRA_OECONF += "\
--without-root-privileges \
--without-kernel-modules \
"
CFLAGS += "-DGLIB_DISABLE_DEPRECATION_WARNINGS"
do_prepare_sources () {
sed -i 's|-Werror||g' ${S}/configure{,.ac}
}
do_patch[postfuncs] += "do_prepare_sources"
do_configure_prepend () {
#export CUSTOM_PROCPS_NAME="procps"
# This is needed to prevent a -L/lib leaking in
export CUSTOM_PROCPS_LIBS=""
}
do_install_append () {
return
false
install -Dm0644 vmware-user-suid-wrapper/vmware-user.desktop ${D}/usr/share/applications/vmware-user.desktop
# vmware-user XDG autostart
mkdir -p ${D}${sysconfdir}/xdg/autostart
ln -s /usr/share/applications/vmware-user.desktop ${D}${sysconfdir}/xdg/autostart/vmware-user.desktop
install -D -m 755 scripts/common/vmware-xdg-detect-de "${D}"/usr/bin/vmware-xdg-detect-de
chmod 07755 "${D}"/usr/bin/vmware-user-suid-wrapper
install -Dm0755 "$srcdir"/network-script ${D}${sysconfdir}/vmware-tools/scripts/vmware/network
install -Dm0644 "$srcdir"/tools.conf "${D}"/etc/vmware-tools/tools.conf
install -Dm0644 "$srcdir"/xautostart.conf "${D}"/etc/vmware-tools/xautostart.conf
install -Dm0644 "$srcdir"/vmware-guestd "${D}"/etc/pam.d/vmware-guestd
rm -rf "${D}"/usr/etc
# We don't want a symlink in /sbin
rm "${D}"/sbin/mount.vmhgfs
rmdir "${D}"/sbin
cd "${D}" && find -type f -exec sh -c "file {} | grep ELF >/dev/null && echo {} && chrpath -d {}" \;
install -Dm644 ${srcdir}/vmtoolsd.service ${D}/usr/lib/systemd/system/vmtoolsd.service
rm -f ${D}${sysconfdir}/vmware-tools/scripts/vmware/*.orig
}
FILES_${PN}-dbg += "${libdir}/${BPN}/plugins/*/.debug"
inherit module
EXTRA_OECONF += "\
'--with-kernel-modules' \
'--with-linuxdir=${STAGING_KERNEL_DIR}' \
'--with-kernel-release=${KERNEL_VERSION}' \
"
SEPB = "${S}"
B = "${S}"
do_prepare_sources () {
sed -i 's|-Werror||g; s|/build/include|/include|' ${S}/configure{,.ac}
}
do_install () {
autotools_do_install
}
@bufferunderflow
Copy link

I'm going to be stoked if this works for me. Good deal! If it doesn't, I'll see if I can make it work for me and push you changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment