From 5fefd608e98bf0e9fdf8483414603a0108b9fadb Mon Sep 17 00:00:00 2001
From: Markos Chandras <mchandras@suse.de>
Date: Tue, 30 Jan 2018 16:59:16 +0000
Subject: xci: scripts: vm: Install additional packages to clean VM

Install some additional packages to the clean VM which can be useful
during debugging. Moreover, we move the common distribution packages
into a variable in order to simplify the code a little bit.

Change-Id: I0405820900a15fec730a2bbfc95a1d1f3485bf0f
Signed-off-by: Markos Chandras <mchandras@suse.de>
---
 xci/scripts/vm/start-new-vm.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh
index 3048d1b9..e5a13b6b 100755
--- a/xci/scripts/vm/start-new-vm.sh
+++ b/xci/scripts/vm/start-new-vm.sh
@@ -112,15 +112,17 @@ if ! sudo -n "true"; then
 	exit 1
 fi
 
+COMMON_DISTRO_PKGS=(vim strace gdb htop dnsmasq docker iptables ebtables virt-manager qemu-kvm)
+
 case ${ID,,} in
 	*suse)
-		pkg_mgr_cmd="sudo zypper -q -n install virt-manager qemu-kvm qemu-tools libvirt-daemon docker libvirt-client libvirt-daemon-driver-qemu iptables ebtables dnsmasq"
+		pkg_mgr_cmd="sudo zypper -q -n install ${COMMON_DISTRO_PKGS[@]} qemu-kvm qemu-tools libvirt-daemon libvirt-client libvirt-daemon-driver-qemu"
 		;;
 	centos)
-		pkg_mgr_cmd="sudo yum install -q -y epel-release && sudo yum install -q -y in virt-manager qemu-kvm qemu-kvm-tools qemu-img libvirt-daemon-kvm docker iptables ebtables dnsmasq"
+		pkg_mgr_cmd="sudo yum install -q -y epel-release && sudo yum install -q -y in ${COMMON_DISTRO_PKGS[@]} qemu-kvm-tools qemu-img libvirt-daemon-kvm"
 		;;
 	ubuntu)
-		pkg_mgr_cmd="sudo apt-get install -y -q=3 virt-manager qemu-kvm libvirt-bin qemu-utils docker.io docker iptables ebtables dnsmasq"
+		pkg_mgr_cmd="sudo apt-get install -y -q=3 ${COMMON_DISTRO_PKGS[@]} libvirt-bin qemu-utils docker.io"
 		;;
 esac
 
-- 
cgit