Setup and teardown Shared Folders mount point

This commit is contained in:
Ravindra Kumar 2015-09-15 03:14:07 -07:00
parent a1cb94a1c0
commit fcd2fa293b

View File

@ -28,7 +28,7 @@
Name: open-vm-tools
Version: %{toolsversion}
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Open Virtual Machine Tools for virtual machines hosted on VMware
Group: Applications/System
License: GPLv2
@ -171,11 +171,19 @@ install -p -m 644 -D %{SOURCE2} %{buildroot}%{_unitdir}/%{vgauthdaemon}.service
# upstream
%post
if [ -e %{_bindir}/vmware-guestproxycerttool ]; then
if [ -f %{_bindir}/vmware-guestproxycerttool ]; then
mkdir -p %{_sysconfdir}/vmware-tools/GuestProxyData/server
mkdir -p -m 0700 %{_sysconfdir}/vmware-tools/GuestProxyData/trusted
%{_bindir}/vmware-guestproxycerttool -g &> /dev/null || /bin/true
fi
# Setup mount point for Shared Folders
if [ -f %{_bindir}/vmware-checkvm ] && \
%{_bindir}/vmware-checkvm &> /dev/null && \
%{_bindir}/vmware-checkvm -p | grep -q Workstation; then
mkdir -p /mnt/hgfs
fi
/sbin/ldconfig
%systemd_post %{vgauthdaemon}.service
%systemd_post %{toolsdaemon}.service
@ -184,12 +192,21 @@ fi
%systemd_preun %{toolsdaemon}.service
%systemd_preun %{vgauthdaemon}.service
# Tell VMware that open-vm-tools is being uninstalled
if [ "$1" = "0" -a \
-e %{_bindir}/vmware-checkvm -a \
-e %{_bindir}/vmware-rpctool ] && \
-f %{_bindir}/vmware-checkvm ] && \
%{_bindir}/vmware-checkvm &> /dev/null; then
# Tell VMware that open-vm-tools is being uninstalled
if [ -f %{_bindir}/vmware-rpctool ]; then
%{_bindir}/vmware-rpctool 'tools.set.version 0' &> /dev/null || /bin/true
fi
# Teardown mount point for Shared Folders
if [ -d /mnt/hgfs ] && \
%{_bindir}/vmware-checkvm -p | grep -q Workstation; then
umount /mnt/hgfs &> /dev/null || /bin/true
rmdir /mnt/hgfs &> /dev/null || /bin/true
fi
fi
%postun
@ -197,7 +214,7 @@ fi
%systemd_postun_with_restart %{toolsdaemon}.service
%systemd_postun_with_restart %{vgauthdaemon}.service
# Cleanup GuestProxy certs if open-vm-tools is being uninstalled
if [ "$1" = "0" ]; then \
if [ "$1" = "0" ]; then
rm -rf %{_sysconfdir}/vmware-tools/GuestProxyData &> /dev/null || /bin/true
fi
@ -262,6 +279,10 @@ fi
%{_libdir}/libvmtools.so
%changelog
* Thu Oct 01 2015 Ravindra Kumar <ravindrakumar@vmware.com> - 10.0.0-5
- Setup and teardown Shared Folders mount point on VMs running
on VMware Workstation or VMware Fusion.
* Wed Sep 30 2015 Ravindra Kumar <ravindrakumar@vmware.com> - 10.0.0-4
- vmhgfs-fuse needs 'fusermount' from 'fuse'