Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored vmware tools scripts #638

Merged
merged 1 commit into from
Sep 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

@cheeseplus cheeseplus Jul 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't seem to be getting called by any of the RHEL/CentOS templates

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cheeseplus,

Changed it for Centos 7. Still need to test OVT with older versions. What do you mean by "abstract all of them"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've broken out a vmware.sh but parallels and virtualbox still share a vmtools.sh - it's not necessary for this PR but it feels like we should break them each out or put them all on in one like vmtools.sh.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! changed it. See if this is what you have in mind.

Note 1: Although it is possible to select which script to execute in the packer file, it seemed like a lot of json just to get rid of a couple of "cases" so a left them on the scripts

Note 2: I don't have access to parallels so I can not test it. The change is pretty simple so I believe that it should work.


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