cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [23/50] git commit: updated refs/heads/master to 1290e10
Date Mon, 22 Sep 2014 19:44:22 GMT
CLOUDSTACK-7143: cleanup zerodisk.sh code


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

Branch: refs/heads/master
Commit: 44ceeabb2813bb40a1a5f95a19a514470a71b52f
Parents: f67a379
Author: Leo Simons <lsimons@schubergphilis.com>
Authored: Mon Jul 21 13:08:35 2014 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Sep 22 21:38:13 2014 +0200

----------------------------------------------------------------------
 .../definitions/systemvmtemplate/zerodisk.sh    | 36 +++++++++++++-------
 1 file changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/44ceeabb/tools/appliance/definitions/systemvmtemplate/zerodisk.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/definitions/systemvmtemplate/zerodisk.sh b/tools/appliance/definitions/systemvmtemplate/zerodisk.sh
index b00f7ae..1c8fb53 100644
--- a/tools/appliance/definitions/systemvmtemplate/zerodisk.sh
+++ b/tools/appliance/definitions/systemvmtemplate/zerodisk.sh
@@ -1,15 +1,27 @@
-# Clean up stuff copied in by veewee
-rm -fv /root/*.iso
-rm -fv /root/base.sh /root/cleanup.sh /root/postinstall.sh /root/zerodisk.sh
-rm -fv .veewee_version .veewee_params .vbox_version
+#!/bin/bash
 
-echo "Cleaning up"
+set -e
+set -x
+
+# clean up stuff copied in by veewee
+function cleanup_veewee() {
+  # this has to be here since it is the last file to run (and we remove ourselves)
+  rm -fv /root/*.iso
+  rm -fv /root/{apt_upgrade,build_time,cleanup,install_systemvm_packages,zerodisk}.sh
+  rm -fv /root/configure_{acpid,conntrack,grub,locale,login,networking,systemvm_services}.sh
+  rm -fv .veewee_version .veewee_params .vbox_version
+}
 
 # Zero out the free space to save space in the final image:
-for path in / /boot /usr /var /opt /tmp /home
-do
-  dd if=/dev/zero of=$path/zero bs=1M
-  sync
-  rm -f $path/zero
-  echo "Completed zero-ing out disk on $path"
-done
+function zero_disk() {
+  cleanup_veewee
+
+  for path in / /boot /usr /var /opt /tmp /home
+  do
+    dd if=/dev/zero of=${path}/zero bs=1M || true
+    sync
+    rm -f ${path}/zero
+  done
+}
+
+return 2>/dev/null || zero_disk


Mime
View raw message