diff --git a/open-vm-tools-12.0.5-19716617.tar.gz b/open-vm-tools-12.0.5-19716617.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..72eb1f677b65f6e4c34e1310d419da7b2da1d6ae Binary files /dev/null and b/open-vm-tools-12.0.5-19716617.tar.gz differ diff --git a/open-vm-tools.conf b/open-vm-tools.conf new file mode 100644 index 0000000000000000000000000000000000000000..a517c488f34950bf2f440bd49e2519e4a8149ec1 --- /dev/null +++ b/open-vm-tools.conf @@ -0,0 +1 @@ +fuse diff --git a/open-vm-tools.spec b/open-vm-tools.spec new file mode 100644 index 0000000000000000000000000000000000000000..eda0c012c3f17184811a3cee1f4804c88cd26b6a --- /dev/null +++ b/open-vm-tools.spec @@ -0,0 +1,391 @@ +################################################################################ +### Copyright 2013-2022 VMware, Inc. All rights reserved. +### Copyright (c) 2022 Yunche Information Technology (Shenzhen) Co., Ltd. +### +### RPM SPEC file for building open-vm-tools packages. +### +### +### This program is free software; you can redistribute it and/or modify +### it under the terms of version 2 of the GNU General Public License as +### published by the Free Software Foundation. +### +### This program is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with this program; if not, write to the Free Software +### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +################################################################################ + +%global _hardened_build 1 +%global majorversion 12.0 +%global minorversion 5 +%global toolsbuild 19716617 +%global toolsversion %{majorversion}.%{minorversion} +%global toolsdaemon vmtoolsd +%global vgauthdaemon vgauthd + +Name: open-vm-tools +Version: %{toolsversion} +Release: 1%{?dist} +Summary: Open Virtual Machine Tools for virtual machines hosted on VMware +License: GPLv2 +URL: https://github.com/vmware/%{name} + +Source0: https://github.com/vmware/%{name}/releases/download/stable-%{version}/%{name}-%{version}-%{toolsbuild}.tar.gz +Source1: %{toolsdaemon}.service +Source2: %{vgauthdaemon}.service +Source3: run-vmblock\x2dfuse.mount +Source4: open-vm-tools.conf +Source5: vmtoolsd.pam + + +ExclusiveArch: x86_64 aarch64 + +# Patches +#Patch1: .patch + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: make +BuildRequires: gcc-c++ +BuildRequires: doxygen +BuildRequires: fuse3-devel +BuildRequires: glib2-devel >= 2.14.0 +BuildRequires: libicu-devel +BuildRequires: libmspack-devel +BuildRequires: libtool-ltdl-devel +BuildRequires: libX11-devel +BuildRequires: libXext-devel +BuildRequires: libXi-devel +BuildRequires: libXinerama-devel +BuildRequires: libXrandr-devel +BuildRequires: libXrender-devel +BuildRequires: libXtst-devel +BuildRequires: openssl-devel +BuildRequires: pam-devel +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(libudev) +BuildRequires: procps-devel +BuildRequires: xmlsec1-openssl-devel +BuildRequires: gdk-pixbuf-xlib +BuildRequires: gtk3-devel >= 3.10.0 +BuildRequires: gtkmm30-devel >= 3.10.0 +BuildRequires: libtirpc-devel +BuildRequires: rpcgen +BuildRequires: systemd-rpm-config + +Requires: coreutils +Requires: fuse3 +Requires: iproute +Requires: grep +Requires: pciutils +Requires: sed +Requires: systemd +Requires: tar +Requires: util-linux +Requires: which +Requires: xmlsec1-openssl + +# open-vm-tools >= 10.0.0 do not require open-vm-tools-deploypkg provided by +# VMware. That functionality is now available as part of open-vm-tools package +# itself. +Obsoletes: open-vm-tools-deploypkg <= 10.0.5 + +%description +The %{name} project is an open source implementation of VMware Tools. It +is a suite of open source virtualization utilities and drivers to improve the +functionality, user experience and administration of VMware virtual machines. +This package contains only the core user-space programs and libraries of +%{name}. + +%package desktop +Summary: User experience components for Open Virtual Machine Tools +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description desktop +This package contains only the user-space programs and libraries of +%{name} that are essential for improved user experience of VMware virtual +machines. + +%package sdmp +Summary: Service Discovery components for Open Virtual Machine Tools +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: coreutils +Requires: gawk +Requires: glibc-common +Requires: grep +Requires: iproute +Requires: procps + +%description sdmp +This package contains only the user-space programs and utility scripts of +%{name} that are essential for performing service discovery in VMware +virtual machines by vRealize Operations Service Discovery Management Pack. + +%package salt-minion +Summary: Script file to install/uninstall salt-minion +Group: System Environment/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release}, systemd, curl, coreutils, gawk, grep +ExclusiveArch: x86_64 + +%description salt-minion +This package contains a script to setup Salt Minion on VMware virtual machines. + +%package devel +Summary: Development libraries for Open Virtual Machine Tools +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description devel +This package contains only the user-space programs and libraries of +%{name} that are essential for developing customized applications for +VMware virtual machines. + +%package test +Summary: Test utilities for Open Virtual Machine Tools +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description test +This package contains only the test utilities for %{name} that are +useful for verifying the functioning of %{name} in VMware virtual +machines. + +%prep +%autosetup -p1 -n %{name}-%{version}-%{toolsbuild} + +%build +autoreconf -vif + +%configure \ + --without-kernel-modules \ + --enable-xmlsec1 \ + --enable-resolutionkms \ + --enable-servicediscovery \ +%ifarch x86_64 + --enable-salt-minion \ +%endif + --with-tirpc \ + --without-gtk2 \ + --without-gtkmm \ + --disable-static + +sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool +%make_build + +%install +export DONT_STRIP=1 +%make_install + +# Remove exec bit from config files +chmod a-x %{buildroot}%{_sysconfdir}/pam.d/* +chmod a-x %{buildroot}%{_sysconfdir}/vmware-tools/*.conf +chmod a-x %{buildroot}%{_sysconfdir}/vmware-tools/vgauth/schemas/* + +# Remove exec bit on udev rules. +chmod a-x %{buildroot}%{_udevrulesdir}/99-vmware-scsi-udev.rules + +# Remove the DOS line endings +sed -i "s|\r||g" README + +# Remove "Encoding" key from the "Desktop Entry" +sed -i "s|^Encoding.*$||g" %{buildroot}%{_sysconfdir}/xdg/autostart/vmware-user.desktop + +# Remove unnecessary files from packaging +find %{buildroot}%{_libdir} -name '*.la' -delete +rm -fr %{buildroot}%{_defaultdocdir} +rm -f docs/api/build/html/FreeSans.ttf + +# Remove mount.vmhgfs & symlink +rm -fr %{buildroot}%{_sbindir} %{buildroot}/sbin/mount.vmhgfs + +# Systemd unit files +install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{toolsdaemon}.service +install -p -m 644 -D %{SOURCE2} %{buildroot}%{_unitdir}/%{vgauthdaemon}.service +install -p -m 644 -D '%{SOURCE3}' %{buildroot}%{_unitdir}/run-vmblock\\x2dfuse.mount +install -p -m 644 -D %{SOURCE4} %{buildroot}%{_modulesloaddir}/open-vm-tools.conf +install -p -m 644 -D %{SOURCE5} %{buildroot}%{_sysconfdir}/pam.d/vmtoolsd + +# 'make check' in open-vm-tools rebuilds docs and ends up regenerating the font +# file. We can add %%check secion once 'make check' is fixed upstream. + +%post +%?ldconfig +# Setup mount point for Shared Folders +# NOTE: Use systemd-detect-virt to detect VMware platform because +# vmware-checkvm might misbehave on non-VMware platforms. +if [ -f %{_bindir}/vmware-checkvm -a \ + -f %{_bindir}/vmhgfs-fuse ] && \ + %{_bindir}/systemd-detect-virt | grep -iq VMware && \ + %{_bindir}/vmware-checkvm &> /dev/null && \ + %{_bindir}/vmware-checkvm -p | grep -q Workstation && \ + %{_bindir}/vmhgfs-fuse -e &> /dev/null; then + mkdir -p /mnt/hgfs +fi + +if [ "$1" = "2" ]; then + # Cleanup GuestProxy certs, relevant for upgrades only + if [ -f %{_bindir}/vmware-guestproxycerttool ]; then + %{_bindir}/vmware-guestproxycerttool -e &> /dev/null || /bin/true + fi + if [ -d /etc/vmware-tools/GuestProxyData ]; then + rm -rf /etc/vmware-tools/GuestProxyData &> /dev/null || /bin/true + fi + + # Cleanup vmtoolsd-init.service in case of upgrades + %{_bindir}/systemctl disable %{toolsdaemon}-init.service &> /dev/null || /bin/true +fi +%systemd_post %{vgauthdaemon}.service %{toolsdaemon}.service + +%post desktop +%systemd_post run-vmblock\\x2dfuse.mount +# Need to enable the service as it is not enabled by default. +# Enabling an already-enabled service is not an error. So, we can perform this +# step everytime during the post-install. +if [ -f %{_bindir}/vmware-checkvm ] && \ + %{_bindir}/systemd-detect-virt | grep -iq VMware && \ + %{_bindir}/vmware-checkvm &> /dev/null && \ + %{_bindir}/vmware-checkvm -p | grep -q Workstation; then + %{_bindir}/systemctl enable run-vmblock\\x2dfuse.mount &> /dev/null || /bin/true +fi + +%post sdmp +# Load the newly installed or upgraded SDMP plugin +if %{_bindir}/systemctl is-active %{toolsdaemon}.service &> /dev/null; then + %{_bindir}/systemctl restart %{toolsdaemon}.service &> /dev/null || /bin/true +fi + +%preun +%?ldconfig +%systemd_preun %{toolsdaemon}.service %{vgauthdaemon}.service + +if [ "$1" = "0" -a \ + -f %{_bindir}/vmware-checkvm ] && \ + %{_bindir}/systemd-detect-virt | grep -iq VMware && \ + %{_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 + +%preun desktop +%systemd_preun run-vmblock\\x2dfuse.mount + +%postun +%?ldconfig +%systemd_postun_with_restart %{toolsdaemon}.service %{vgauthdaemon}.service + +%postun desktop +%systemd_postun run-vmblock\\x2dfuse.mount + +%postun sdmp +# In case of uninstall, unload the uninstalled SDMP plugin +if [ "$1" = "0" ] && \ + %{_bindir}/systemctl is-active %{toolsdaemon}.service &> /dev/null; then + %{_bindir}/systemctl restart %{toolsdaemon}.service &> /dev/null || /bin/true +fi + +%files +%license COPYING +%doc AUTHORS ChangeLog NEWS README +%config(noreplace) %{_sysconfdir}/pam.d/* +%dir %{_sysconfdir}/vmware-tools/ +%dir %{_sysconfdir}/vmware-tools/vgauth +%dir %{_sysconfdir}/vmware-tools/vgauth/schemas +%config(noreplace) %{_sysconfdir}/vmware-tools/*.conf +# Don't expect users to modify example tools.conf file +%config %{_sysconfdir}/vmware-tools/tools.conf.example +# Don't expect users to modify VGAuth schema files +%config %{_sysconfdir}/vmware-tools/vgauth/schemas/* +%{_sysconfdir}/vmware-tools/*-vm-default +%{_sysconfdir}/vmware-tools/scripts +%{_sysconfdir}/vmware-tools/statechange.subr +%{_bindir}/VGAuthService +%{_bindir}/vm-support +%{_bindir}/vmhgfs-fuse +%{_bindir}/vmtoolsd +%{_bindir}/vmware-alias-import +%{_bindir}/vmware-checkvm +%{_bindir}/vmware-hgfsclient +%{_bindir}/vmware-namespace-cmd +%{_bindir}/vmware-rpctool +%{_bindir}/vmware-toolbox-cmd +%{_bindir}/vmware-vgauth-cmd +%{_bindir}/vmware-xferlogs +%{_libdir}/libDeployPkg.so.* +%{_libdir}/libguestlib.so.* +%{_libdir}/libguestStoreClient.so.* +%{_libdir}/libhgfs.so.* +%{_libdir}/libvgauth.so.* +%{_libdir}/libvmtools.so.* +%dir %{_libdir}/%{name}/ +%dir %{_libdir}/%{name}/plugins +%dir %{_libdir}/%{name}/plugins/common +%{_libdir}/%{name}/plugins/common/*.so +%dir %{_libdir}/%{name}/plugins/vmsvc +%{_libdir}/%{name}/plugins/vmsvc/libappInfo.so +%{_libdir}/%{name}/plugins/vmsvc/libcomponentMgr.so +%{_libdir}/%{name}/plugins/vmsvc/libdeployPkgPlugin.so +%{_libdir}/%{name}/plugins/vmsvc/libgdp.so +%{_libdir}/%{name}/plugins/vmsvc/libguestInfo.so +%{_libdir}/%{name}/plugins/vmsvc/libguestStore.so +%{_libdir}/%{name}/plugins/vmsvc/libpowerOps.so +%{_libdir}/%{name}/plugins/vmsvc/libresolutionKMS.so +%{_libdir}/%{name}/plugins/vmsvc/libtimeSync.so +%{_libdir}/%{name}/plugins/vmsvc/libvmbackup.so + +%{_datadir}/%{name}/ +%{_udevrulesdir}/99-vmware-scsi-udev.rules +%{_unitdir}/%{toolsdaemon}.service +%{_unitdir}/%{vgauthdaemon}.service +%{_modulesloaddir}/open-vm-tools.conf + +%files desktop +%{_sysconfdir}/xdg/autostart/*.desktop +%{_bindir}/vmware-user +%{_bindir}/vmwgfxctrl +%attr(4755,-,-) %{_bindir}/vmware-user-suid-wrapper +%{_bindir}/vmware-vmblock-fuse +%{_libdir}/%{name}/plugins/vmusr/ +%{_unitdir}/run-vmblock\x2dfuse.mount + +%files sdmp +%{_libdir}/%{name}/plugins/vmsvc/libserviceDiscovery.so +%{_libdir}/%{name}/serviceDiscovery + +%ifarch x86_64 +%files salt-minion +%dir %{_libdir}/%{name}/componentMgr/ +%dir %{_libdir}/%{name}/componentMgr/saltMinion/ +%{_libdir}/%{name}/componentMgr/saltMinion/svtminion.sh +%endif + +%files devel +%doc docs/api/build/* +%exclude %{_includedir}/libDeployPkg/ +%{_includedir}/vmGuestLib/ +%{_libdir}/pkgconfig/*.pc +%{_libdir}/libDeployPkg.so +%{_libdir}/libguestlib.so +%{_libdir}/libguestStoreClient.so +%{_libdir}/libhgfs.so +%{_libdir}/libvgauth.so +%{_libdir}/libvmtools.so + +%files test +%{_bindir}/vmware-vgauth-smoketest + +%changelog +* Mon Jun 20 2022 Chenxi Mao - 12.0.5-1 +- Package init diff --git "a/run-vmblock\\x2dfuse.mount" "b/run-vmblock\\x2dfuse.mount" new file mode 100644 index 0000000000000000000000000000000000000000..d7be7c205ec92a06c5fe6e2f7c4da2ca7c5373f7 --- /dev/null +++ "b/run-vmblock\\x2dfuse.mount" @@ -0,0 +1,17 @@ +[Unit] +Description=VMware vmblock Fuse Mount +Documentation=https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vmblock-fuse/design.txt +DefaultDependencies=no +Before=umount.target vmtoolsd.service +ConditionVirtualization=vmware +After=sys-fs-fuse-connections.mount +Wants=vmtoolsd.service + +[Mount] +What=vmware-vmblock-fuse +Where=/run/vmblock-fuse +Type=fuse +Options=subtype=vmware-vmblock,default_permissions,allow_other + +[Install] +WantedBy=multi-user.target diff --git a/vgauthd.service b/vgauthd.service new file mode 100644 index 0000000000000000000000000000000000000000..d5fef2c167faee36bf423a954c2495859bb22a7e --- /dev/null +++ b/vgauthd.service @@ -0,0 +1,12 @@ +[Unit] +Description=VGAuth Service for open-vm-tools +Documentation=http://github.com/vmware/open-vm-tools +ConditionVirtualization=vmware +PartOf=vmtoolsd.service + +[Service] +ExecStart=/usr/bin/VGAuthService -s +TimeoutStopSec=5 + +[Install] +RequiredBy=vmtoolsd.service diff --git a/vmtoolsd.pam b/vmtoolsd.pam new file mode 100644 index 0000000000000000000000000000000000000000..aa3daa02b0efc67561ee2972f1d476ca89e051a5 --- /dev/null +++ b/vmtoolsd.pam @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth substack password-auth +auth include postlogin +account required pam_nologin.so +account include password-auth diff --git a/vmtoolsd.service b/vmtoolsd.service new file mode 100644 index 0000000000000000000000000000000000000000..54c73124c73f489a11fa76ab0cf7d5251283d006 --- /dev/null +++ b/vmtoolsd.service @@ -0,0 +1,14 @@ +[Unit] +Description=Service for virtual machines hosted on VMware +Documentation=http://github.com/vmware/open-vm-tools +ConditionVirtualization=vmware +Requires=vgauthd.service +After=vgauthd.service + +[Service] +ExecStart=/usr/bin/vmtoolsd +TimeoutStopSec=5 + +[Install] +WantedBy=multi-user.target +Also=vgauthd.service