Skip to contentSkip to conversation

open-vm-tools: add init script

PATCH New Fang Jia 1 participant 1 message Nov 14, 2016

lore
Share & tools
lore

Fang Jia

author
#0 lore raw

PATCH 1/1 open-vm-tools: add init script

- Add init script to support not systemd system.
- Use ${libdir} in case the board is a 64-bit machine.

---
 .../recipes-extended/open-vm-tools/files/default   |   3 +
 .../recipes-extended/open-vm-tools/files/init      | 105 +++++++++++++++++++++
 .../open-vm-tools/open-vm-tools_10.0.5.bb          |  23 +++--
 3 files changed, 125 insertions(+), 6 deletions(-)
 create mode 100644 yocto/openswitch/meta-foss-openswitch/recipes-extended/open-vm-tools/files/default
 create mode 100644 yocto/openswitch/meta-foss-openswitch/recipes-extended/open-vm-tools/files/init
yocto/openswitch/meta-foss-openswitch/recipes-extended/open-vm-tools/files/default new file +3 -0
new file mode 100644
index 0000000..782e015
@@ -0,0 +1,3 @@
+#Defaults for vmware-tools
+RUN_DAEMON="no"
+OPTIONS=""
yocto/openswitch/meta-foss-openswitch/recipes-extended/open-vm-tools/files/init new file +105 -0

105 lines not on this page · raw message

yocto/openswitch/meta-foss-openswitch/recipes-extended/open-vm-tools/open-vm-tools_10.0.5.bb +17 -6
index 6938950..a6949d7 100644
@@ -9,6 +9,8 @@ SRC_URI = "git://github.com/vmware/open-vm-tools.git;protocol=https \
            file://tools.conf \
            file://vmtoolsd.service \
            file://0001-Fix-kernel-detection.patch \
+           file://init \
+           file://default \
            "
 
 SRCREV = "538ea037a1549b6fd4e57529f7448a3fd2aa47af"
@@ -41,24 +43,33 @@ EXTRA_OEMAKE = "KERNEL_RELEASE=${KERNEL_VERSION}"
 
 CFLAGS += '-Wno-error=deprecated-declarations'
 
-FILES_${PN} += "/usr/lib/open-vm-tools/plugins/vmsvc/lib*.so \
-		/usr/lib/open-vm-tools/plugins/common/lib*.so \
-    ${sysconfdir}/vmware-tools/tools.conf"
+FILES_${PN} += "${libdir}/open-vm-tools/plugins/vmsvc/lib*.so \
+		${libdir}/open-vm-tools/plugins/common/lib*.so \
+		${sysconfdir}/vmware-tools/tools.conf \
+		${sysconfdir}/init.d ${sysconfdir}/default"
 FILES_${PN}-locale += "/usr/share/open-vm-tools/messages"
-FILES_${PN}-dev += "/usr/lib/open-vm-tools/plugins/common/lib*.la"
-FILES_${PN}-dbg += "/usr/lib/open-vm-tools/plugins/common/.debug \
-		    /usr/lib/open-vm-tools/plugins/vmsvc/.debug"
+FILES_${PN}-dev += "${libdir}/open-vm-tools/plugins/common/lib*.la"
+FILES_${PN}-dbg += "${libdir}/open-vm-tools/plugins/common/.debug \
+		    ${libdir}/open-vm-tools/plugins/vmsvc/.debug"
 
 CONFFILES_${PN} += "${sysconfdir}/vmware-tools/tools.conf"
 
 do_install_append() {
+    install -d ${D}${sysconfdir}/init.d
+    install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vmtools
+
     ln -sf /usr/sbin/mount.vmhgfs ${D}/sbin/mount.vmhgfs
     install -d ${D}${systemd_unitdir}/system ${D}${sysconfdir}/vmware-tools
     install -m 644 ${WORKDIR}/*.service ${D}${systemd_unitdir}/system
     install -m 0644 ${WORKDIR}/tools.conf ${D}${sysconfdir}/vmware-tools/tools.conf
+
+    install -d ${D}${sysconfdir}/default
+    install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/vmware-tools
 }
 
 do_configure_prepend() {
     export CUSTOM_PROCPS_NAME=procps
     export CUSTOM_PROCPS_LIBS=-L${STAGING_LIBDIR}/libprocps.so
+    export CUSTOM_DNET_CPPFLAGS=-I${STAGING_INCDIR}
+    export CUSTOM_DNET_LIBS=-L${STAGING_LIBDIR}
 }
Signature · 1 line
1.9.1