CLOUDSTACK-7143: move install_packages from postinstall.sh to its own file

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/06c1c16d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/06c1c16d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/06c1c16d

Branch: refs/heads/master
Commit: 06c1c16dc38a615dfead07dd78179b0f0dfb56f2
Parents: 71c913c
Author: Leo Simons <lsim...@schubergphilis.com>
Authored: Mon Jul 21 11:46:02 2014 +0200
Committer: Rohit Yadav <rohit.ya...@shapeblue.com>
Committed: Mon Sep 22 21:37:18 2014 +0200

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/definition.rb  |  3 +-
 .../install_systemvm_packages.sh                | 88 +++++++++++++++++++
 .../definitions/systemvmtemplate/postinstall.sh | 90 --------------------
 3 files changed, 90 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06c1c16d/tools/appliance/definitions/systemvmtemplate/definition.rb
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/definition.rb 
b/tools/appliance/definitions/systemvmtemplate/definition.rb
index 6daa7ff..556b8f2 100644
--- a/tools/appliance/definitions/systemvmtemplate/definition.rb
+++ b/tools/appliance/definitions/systemvmtemplate/definition.rb
@@ -63,8 +63,9 @@ config = {
         'configure_locale.sh',
         'configure_login.sh',
         'configure_networking.sh',
-        'postinstall.sh',
         'configure_acpid.sh',
+        'install_systemvm_packages.sh',
+        'postinstall.sh',
         'configure_conntrack.sh',
         'cleanup.sh',
         'zerodisk.sh'

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06c1c16d/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh
----------------------------------------------------------------------
diff --git 
a/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh 
b/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh
new file mode 100644
index 0000000..daa0efe
--- /dev/null
+++ b/tools/appliance/definitions/systemvmtemplate/install_systemvm_packages.sh
@@ -0,0 +1,88 @@
+install_packages() {
+  DEBIAN_FRONTEND=noninteractive
+  DEBIAN_PRIORITY=critical
+  local arch=`dpkg --print-architecture`
+
+  # Basic packages
+  apt-get --no-install-recommends -q -y --force-yes install rsyslog logrotate 
cron chkconfig insserv net-tools ifupdown vim-tiny netbase iptables
+  apt-get --no-install-recommends -q -y --force-yes install openssh-server 
openssl e2fsprogs dhcp3-client tcpdump socat wget
+  # apt-get --no-install-recommends -q -y --force-yes install grub-legacy
+  apt-get --no-install-recommends -q -y --force-yes install python bzip2 sed 
gawk diffutils grep gzip less tar telnet ftp rsync traceroute psmisc lsof 
procps  inetutils-ping iputils-arping httping
+  apt-get --no-install-recommends -q -y --force-yes install dnsutils zip unzip 
ethtool uuid file iproute acpid virt-what sudo
+
+  # sysstat
+  echo 'sysstat sysstat/enable boolean true' | debconf-set-selections
+  apt-get --no-install-recommends -q -y --force-yes install sysstat
+  # apache
+  apt-get --no-install-recommends -q -y --force-yes install apache2 ssl-cert
+
+  # dnsmasq
+  apt-get --no-install-recommends -q -y --force-yes install dnsmasq 
dnsmasq-utils
+  # nfs client
+  apt-get --no-install-recommends -q -y --force-yes install nfs-common
+  # nfs irqbalance
+  apt-get --no-install-recommends -q -y --force-yes install irqbalance
+
+  # cifs client
+  apt-get --no-install-recommends -q -y --force-yes install samba-common
+  apt-get --no-install-recommends -q -y --force-yes install cifs-utils
+
+  # vpn stuff
+  apt-get --no-install-recommends -q -y --force-yes install xl2tpd bcrelay ppp 
ipsec-tools tdb-tools
+  echo "openswan openswan/install_x509_certificate boolean false" | 
debconf-set-selections
+  echo "openswan openswan/install_x509_certificate seen true" | 
debconf-set-selections
+  apt-get --no-install-recommends -q -y --force-yes install openswan=1:2.6.37-3
+
+  # xenstore utils
+  apt-get --no-install-recommends -q -y --force-yes install xenstore-utils 
libxenstore3.0
+  # keepalived and conntrackd for redundant router
+  apt-get --no-install-recommends -q -y --force-yes install keepalived 
conntrackd ipvsadm libnetfilter-conntrack3 libnl1
+  # ipcalc
+  apt-get --no-install-recommends -q -y --force-yes install ipcalc
+  apt-get update
+  # java
+  apt-get --no-install-recommends -q -y --force-yes install  
openjdk-7-jre-headless
+
+  echo "iptables-persistent iptables-persistent/autosave_v4 boolean true" | 
debconf-set-selections
+  echo "iptables-persistent iptables-persistent/autosave_v6 boolean true" | 
debconf-set-selections
+  apt-get --no-install-recommends -q -y --force-yes install iptables-persistent
+
+  # Hyperv  kvp daemon - 64bit only
+  if [ "${arch}" == "amd64" ]; then
+    # Download the hv kvp daemon
+    wget http://people.apache.org/~rajeshbattala/hv-kvp-daemon_3.1_amd64.deb
+    dpkg -i hv-kvp-daemon_3.1_amd64.deb
+  fi
+
+  #libraries required for rdp client (Hyper-V)
+  apt-get --no-install-recommends -q -y --force-yes install libtcnative-1 
libssl-dev libapr1-dev
+
+  # vmware tools
+  apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
+  # commented installaion of vmware-tools  as we are using the opensource 
open-vm-tools:
+  # apt-get --no-install-recommends -q -y --force-yes install build-essential 
linux-headers-`uname -r`
+  # df -h
+  # PREVDIR=$PWD
+  # cd /opt
+  # wget 
http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
+  # tar xzf VMwareTools-9.2.1-818201.tar.gz
+  # rm VMwareTools-*.tar.gz
+  # cd vmware-tools-distrib
+  # ./vmware-install.pl -d
+  # cd $PREV
+  # rm -fr /opt/vmware-tools-distrib
+  # apt-get -q -y --force-yes purge build-essential
+
+  apt-get --no-install-recommends -q -y --force-yes install haproxy
+
+  #32 bit architecture support:: not required for 32 bit template
+  if [ "${arch}" != "i386" ]; then
+    dpkg --add-architecture i386
+    apt-get update
+    apt-get --no-install-recommends -q -y --force-yes install links:i386 
libuuid1:i386
+  fi
+
+  apt-get --no-install-recommends -q -y --force-yes install radvd
+}
+
+install_packages

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06c1c16d/tools/appliance/definitions/systemvmtemplate/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh 
b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
index 7ce032c..cf995dc 100644
--- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh
+++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh
@@ -21,93 +21,6 @@ ROOTPW=password
 HOSTNAME=systemvm
 CLOUDSTACK_RELEASE=4.5.0
 
-install_packages() {
-  DEBIAN_FRONTEND=noninteractive
-  DEBIAN_PRIORITY=critical
-  local arch=`dpkg --print-architecture`
-
-  # Basic packages
-  apt-get --no-install-recommends -q -y --force-yes install rsyslog logrotate 
cron chkconfig insserv net-tools ifupdown vim-tiny netbase iptables
-  apt-get --no-install-recommends -q -y --force-yes install openssh-server 
openssl e2fsprogs dhcp3-client tcpdump socat wget
-  # apt-get --no-install-recommends -q -y --force-yes install grub-legacy
-  apt-get --no-install-recommends -q -y --force-yes install python bzip2 sed 
gawk diffutils grep gzip less tar telnet ftp rsync traceroute psmisc lsof 
procps  inetutils-ping iputils-arping httping
-  apt-get --no-install-recommends -q -y --force-yes install dnsutils zip unzip 
ethtool uuid file iproute acpid virt-what sudo
-
-  # sysstat
-  echo 'sysstat sysstat/enable boolean true' | debconf-set-selections
-  apt-get --no-install-recommends -q -y --force-yes install sysstat
-  # apache
-  apt-get --no-install-recommends -q -y --force-yes install apache2 ssl-cert
-
-  # dnsmasq
-  apt-get --no-install-recommends -q -y --force-yes install dnsmasq 
dnsmasq-utils
-  # nfs client
-  apt-get --no-install-recommends -q -y --force-yes install nfs-common
-  # nfs irqbalance
-  apt-get --no-install-recommends -q -y --force-yes install irqbalance
-
-  # cifs client
-  apt-get --no-install-recommends -q -y --force-yes install samba-common
-  apt-get --no-install-recommends -q -y --force-yes install cifs-utils
-
-  # vpn stuff
-  apt-get --no-install-recommends -q -y --force-yes install xl2tpd bcrelay ppp 
ipsec-tools tdb-tools
-  echo "openswan openswan/install_x509_certificate boolean false" | 
debconf-set-selections
-  echo "openswan openswan/install_x509_certificate seen true" | 
debconf-set-selections
-  apt-get --no-install-recommends -q -y --force-yes install openswan=1:2.6.37-3
-
-  # xenstore utils
-  apt-get --no-install-recommends -q -y --force-yes install xenstore-utils 
libxenstore3.0
-  # keepalived and conntrackd for redundant router
-  apt-get --no-install-recommends -q -y --force-yes install keepalived 
conntrackd ipvsadm libnetfilter-conntrack3 libnl1
-  # ipcalc
-  apt-get --no-install-recommends -q -y --force-yes install ipcalc
-  apt-get update
-  # java
-  apt-get --no-install-recommends -q -y --force-yes install  
openjdk-7-jre-headless
-
-  echo "iptables-persistent iptables-persistent/autosave_v4 boolean true" | 
debconf-set-selections
-  echo "iptables-persistent iptables-persistent/autosave_v6 boolean true" | 
debconf-set-selections
-  apt-get --no-install-recommends -q -y --force-yes install iptables-persistent
-
-  # Hyperv  kvp daemon - 64bit only
-  if [ "${arch}" == "amd64" ]; then
-    # Download the hv kvp daemon
-    wget http://people.apache.org/~rajeshbattala/hv-kvp-daemon_3.1_amd64.deb
-    dpkg -i hv-kvp-daemon_3.1_amd64.deb
-  fi
-
-  #libraries required for rdp client (Hyper-V)
-  apt-get --no-install-recommends -q -y --force-yes install libtcnative-1 
libssl-dev libapr1-dev
-
-  # vmware tools
-  apt-get --no-install-recommends -q -y --force-yes install open-vm-tools
-  # commented installaion of vmware-tools  as we are using the opensource 
open-vm-tools:
-  # apt-get --no-install-recommends -q -y --force-yes install build-essential 
linux-headers-`uname -r`
-  # df -h
-  # PREVDIR=$PWD
-  # cd /opt
-  # wget 
http://people.apache.org/~bhaisaab/cloudstack/VMwareTools-9.2.1-818201.tar.gz
-  # tar xzf VMwareTools-9.2.1-818201.tar.gz
-  # rm VMwareTools-*.tar.gz
-  # cd vmware-tools-distrib
-  # ./vmware-install.pl -d
-  # cd $PREV
-  # rm -fr /opt/vmware-tools-distrib
-  # apt-get -q -y --force-yes purge build-essential
-
-  apt-get --no-install-recommends -q -y --force-yes install haproxy
-
-  #32 bit architecture support:: not required for 32 bit template
-  if [ "${arch}" != "i386" ]; then
-    dpkg --add-architecture i386
-    apt-get update
-    apt-get --no-install-recommends -q -y --force-yes install links:i386 
libuuid1:i386
-  fi
-
-  apt-get --no-install-recommends -q -y --force-yes install radvd
-}
-
 fix_vhdutil() {
   wget --no-check-certificate 
http://download.cloud.com.s3.amazonaws.com/tools/vhd-util -O /bin/vhd-util
   chmod a+x /bin/vhd-util
@@ -176,9 +89,6 @@ do_signature() {
 
 begin=$(date +%s)
 
-echo "*************INSTALLING PACKAGES********************"
-install_packages
-echo "*************DONE INSTALLING PACKAGES********************"
 configure_services
 configure_apache2
 echo "*************DONE SETTING UP SERVICES********************"

Reply via email to