Skip to content

Commit

Permalink
Merge pull request chef#638 from svpace/master
Browse files Browse the repository at this point in the history
Refactored vmware tools scripts
  • Loading branch information
Seth Thomas authored Sep 8, 2016
2 parents a87feed + 4591252 commit ae811b6
Show file tree
Hide file tree
Showing 42 changed files with 194 additions and 119 deletions.
4 changes: 3 additions & 1 deletion centos-5.11-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/common/sshd.sh",
"scripts/centos/networking.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion centos-5.11-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/common/sshd.sh",
"scripts/centos/networking.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion centos-6.8-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/common/sshd.sh",
"scripts/centos/networking.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion centos-6.8-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/common/sshd.sh",
"scripts/centos/networking.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion centos-7.2-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/common/sshd.sh",
"scripts/centos/networking.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/centos/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion debian-7.11-amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@
"scripts/debian/networking.sh",
"scripts/debian/sudoers.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/debian/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion debian-7.11-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@
"scripts/debian/networking.sh",
"scripts/debian/sudoers.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/debian/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion debian-8.5-amd64.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@
"scripts/debian/networking.sh",
"scripts/debian/sudoers.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/debian/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion debian-8.5-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@
"scripts/debian/networking.sh",
"scripts/debian/sudoers.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/debian/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion fedora-23-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@
"scripts/fedora/fix-slow-dns.sh",
"scripts/common/sshd.sh",
"scripts/fedora/build-tools.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/common/vagrant.sh",
"scripts/fedora/cleanup.sh",
"scripts/common/minimize.sh"
Expand Down
4 changes: 3 additions & 1 deletion fedora-23-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@
"scripts/fedora/fix-slow-dns.sh",
"scripts/fedora/build-tools.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/common/vagrant.sh",
"scripts/fedora/cleanup.sh",
"scripts/common/minimize.sh"
Expand Down
4 changes: 3 additions & 1 deletion fedora-24-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@
"scripts/fedora/fix-slow-dns.sh",
"scripts/fedora/build-tools.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/common/vagrant.sh",
"scripts/fedora/cleanup.sh",
"scripts/common/minimize.sh"
Expand Down
4 changes: 3 additions & 1 deletion fedora-24-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@
"scripts/fedora/fix-slow-dns.sh",
"scripts/fedora/build-tools.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/common/vagrant.sh",
"scripts/fedora/cleanup.sh",
"scripts/common/minimize.sh"
Expand Down
4 changes: 3 additions & 1 deletion opensuse-13.2-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@
"scripts/common/metadata.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/opensuse/sudoers.sh",
"scripts/opensuse/zypper-locks.sh",
"scripts/opensuse/remove-dvd-source.sh",
Expand Down
4 changes: 3 additions & 1 deletion opensuse-13.2-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@
"scripts/common/metadata.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/opensuse/sudoers.sh",
"scripts/opensuse/zypper-locks.sh",
"scripts/opensuse/remove-dvd-source.sh",
Expand Down
4 changes: 3 additions & 1 deletion opensuse-leap-42.1-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@
"scripts/common/metadata.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/opensuse/sudoers.sh",
"scripts/opensuse/zypper-locks.sh",
"scripts/opensuse/remove-dvd-source.sh",
Expand Down
4 changes: 3 additions & 1 deletion oracle-5.11-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@
"scripts/common/metadata.sh",
"scripts/common/vagrant.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion oracle-5.11-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@
"scripts/common/metadata.sh",
"scripts/common/vagrant.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion oracle-6.7-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/centos/networking.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion oracle-6.7-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/centos/networking.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion oracle-7.2-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/centos/networking.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion rhel-5.11-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@
"scripts/common/metadata.sh",
"scripts/common/vagrant.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion rhel-5.11-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@
"scripts/common/metadata.sh",
"scripts/common/vagrant.sh",
"scripts/common/sshd.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion rhel-6.8-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/centos/networking.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion rhel-6.8-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/centos/networking.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
4 changes: 3 additions & 1 deletion rhel-7.2-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@
"scripts/centos/networking.sh",
"scripts/common/sshd.sh",
"scripts/common/vagrant.sh",
"scripts/common/vmtools.sh",
"scripts/common/virtualbox.sh",
"scripts/common/vmware.sh",
"scripts/common/parallels.sh",
"scripts/centos/cleanup.sh",
"scripts/common/minimize.sh"
],
Expand Down
8 changes: 8 additions & 0 deletions scripts/centos/vmware.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -eux

case "$PACKER_BUILDER_TYPE" in
vmware-iso|vmware-vmx)
yum install -y open-vm-tools;
mkdir /mnt/hgfs;
echo "platform specific vmware.sh executed";
esac
4 changes: 2 additions & 2 deletions scripts/common/minimize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ esac
set +e
swapuuid="`/sbin/blkid -o value -l -s UUID -t TYPE=swap`";
case "$?" in
2|0) ;;
*) exit 1 ;;
2|0) ;;
*) exit 1 ;;
esac
set -e

Expand Down
24 changes: 24 additions & 0 deletions scripts/common/parallels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh -eux

# set a default HOME_DIR environment variable if not set
HOME_DIR="${HOME_DIR:-/home/vagrant}";

case "$PACKER_BUILDER_TYPE" in
parallels-iso|parallels-pvm)
mkdir -p /tmp/parallels;
mount -o loop $HOME_DIR/prl-tools-lin.iso /tmp/parallels;
VER="`cat /tmp/parallels/version`";

echo "Parallels Tools Version: $VER";

/tmp/parallels/install --install-unattended-with-deps \
|| (code="$?"; \
echo "Parallels tools installation exited $code, attempting" \
"to output /var/log/parallels-tools-install.log"; \
cat /var/log/parallels-tools-install.log; \
exit $code);
umount /tmp/parallels;
rm -rf /tmp/parallels;
rm -f $HOME_DIR/*.iso;
;;
esac
18 changes: 18 additions & 0 deletions scripts/common/virtualbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh -eux

case "$PACKER_BUILDER_TYPE" in
virtualbox-iso|virtualbox-ovf)
VER="`cat /home/vagrant/.vbox_version`";

echo "Virtualbox Tools Version: $VER";

mkdir -p /tmp/vbox;
mount -o loop $HOME_DIR/VBoxGuestAdditions_${VER}.iso /tmp/vbox;
sh /tmp/vbox/VBoxLinuxAdditions.run \
|| echo "VBoxLinuxAdditions.run exited $? and is suppressed." \
"For more read https://www.virtualbox.org/ticket/12479";
umount /tmp/vbox;
rm -rf /tmp/vbox;
rm -f $HOME_DIR/*.iso;
;;
esac
Loading

0 comments on commit ae811b6

Please sign in to comment.