Scripts to clean disk and shut down

This changeset adds two simple scripts: one fills the unused space
of the root disk with zeroes to allow for better compression of the
resulting disk image, the other shuts the computer down.

Partial-Bug: 1312764
Implements: blueprint openstack-training-labs
Change-Id: I2e80518733b0e1e17a59192c6e2522f423709551
This commit is contained in:
Roger Luethi 2014-06-18 09:53:54 +02:00
parent cd9c8afb0d
commit 05bb9668f4
2 changed files with 25 additions and 0 deletions

13
labs/scripts/shutdown.sh Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
source "$TOP_DIR/config/paths"
source "$LIB_DIR/functions.guest"
indicate_current_auto
exec_logfile
echo "Shutting down"
# Shutdown some time after returning so our caller has time to finish
sudo -b sh -c 'sleep 2; /sbin/shutdown -P now'

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
source "$TOP_DIR/config/paths"
source "$LIB_DIR/functions.guest"
indicate_current_auto
exec_logfile
# Fill unused disk space with zeroes (the disk image is easier to compress when
# it doesn't contain leftovers from deleted files)
zero_empty_space