* Need root, use sudo.
* Don't do yum remove of packages that aren't installed
* Fix shebang
Change-Id: I883d32898e60333530e2e976710dbd73399aba4b
Signed-off-by: Daniel Farrell <dfarrell@redhat.com>
-yum -y remove gcc cpp kernel-devel kernel-headers perl
-yum -y clean all
+sudo yum -y remove gcc cpp kernel-devel kernel-headers perl
+sudo yum -y clean all
-rm -f /etc/udev/rules.d/70-persistent-net.rules
+sudo rm -f /etc/udev/rules.d/70-persistent-net.rules
if [ -r /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
if [ -r /etc/sysconfig/network-scripts/ifcfg-eth0 ]; then
- sed -i 's/^HWADDR.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
- sed -i 's/^UUID.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
+ sudo sed -i 's/^HWADDR.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
+ sudo sed -i 's/^UUID.*$//' /etc/sysconfig/network-scripts/ifcfg-eth0
-dnf -y remove gcc cpp kernel-devel kernel-headers perl
-dnf -y clean all
+#!/usr/bin/env bash
+
+# Options:
+# -x: Echo commands
+# -e: Fail on errors
+set -ex
+
+# This doesn't seem to reduce the size of the box, and may break
+# Docker builds. See comments on git.opendaylight.org/gerrit/#/c/50382.
+
+# Write 0s in free space until full (full->exit 1, force 0)
+#sudo dd if=/dev/zero of=/EMPTY bs=1M || true
+
+# Remove pointer to all the 0-space
+#sudo rm -f /EMPTY
-dd if=/dev/zero of=/EMPTY bs=1M
-rm -f /EMPTY
# Block until the empty file has been removed, otherwise, Packer
# will try to kill the box while the disk is still full and that's bad
# Block until the empty file has been removed, otherwise, Packer
# will try to kill the box while the disk is still full and that's bad