set -u and -o pipefail everywhere

As with the previous similar changes, this is intended to catch
problems as they happen instead of ignoring them and continuing on
to potentially fail later.  Setting this on all existing scripts
will allow us to enforce use via Jenkins.

Change-Id: Iad2d490c86dceab148ea9ab08f457c49a5d5352e
This commit is contained in:
Ben Nemec 2014-04-02 21:24:15 -05:00
parent 35d18b8a60
commit 16be6d7ce0
84 changed files with 141 additions and 62 deletions

View File

@ -2,6 +2,7 @@
# Override the default /etc/apt/apt.conf with $DIB_APT_CONF # Override the default /etc/apt/apt.conf with $DIB_APT_CONF
set -ue set -ue
set -o pipefail
# exit directly if DIB_APT_CONF is not defined properly # exit directly if DIB_APT_CONF is not defined properly
if [ -z "${DIB_APT_CONF:-}" ] ; then if [ -z "${DIB_APT_CONF:-}" ] ; then

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# Override the default /etc/apt/sources.list with $DIB_APT_SOURCES # Override the default /etc/apt/sources.list with $DIB_APT_SOURCES
set -e set -eu
set -o pipefail
# exit directly if DIB_APT_SOURCES is not defined properly # exit directly if DIB_APT_SOURCES is not defined properly
if [ -z "$DIB_APT_SOURCES" ] ; then if [ -z "$DIB_APT_SOURCES" ] ; then

View File

@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
# As this is run in cleanup, it's already been automatically unmounted, # As this is run in cleanup, it's already been automatically unmounted,
# so all we need to do here is remove the directory # so all we need to do here is remove the directory

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
set -o xtrace set -o xtrace
touch /var/log/first-boot.d.log touch /var/log/first-boot.d.log

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
if [ -f /sbin/initctl ]; then if [ -f /sbin/initctl ]; then
echo "upstart" echo "upstart"

View File

@ -1,7 +1,9 @@
#!/bin/bash #!/bin/bash
# Store the build-time environment and command line arguments # Store the build-time environment and command line arguments
set -e set -eu
set -o pipefail
source $_LIB/die source $_LIB/die
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set" [ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"

View File

@ -15,6 +15,7 @@
set -eux set -eux
set -o pipefail
declare -a SPECIFIED_ELEMS declare -a SPECIFIED_ELEMS

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
if [ -d /etc/first-boot.d ]; then if [ -d /etc/first-boot.d ]; then
install -m 0755 -o root -g root $(dirname $0)/../dib-first-boot /usr/sbin/ install -m 0755 -o root -g root $(dirname $0)/../dib-first-boot /usr/sbin/

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
# These are useful, or at worst not harmful, for all images we build. # These are useful, or at worst not harmful, for all images we build.
set -e set -eu
set -o pipefail
install-packages vlan open-iscsi install-packages vlan open-iscsi

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# Tweak the stock ubuntu cloud-init config # Tweak the stock ubuntu cloud-init config
set -e set -eu
set -o pipefail
dd of=/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg << EOF dd of=/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg << EOF
manage_etc_hosts: True manage_etc_hosts: True

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# Store build-time environment and command line arguments # Store build-time environment and command line arguments
set -e set -eu
set -o pipefail
if [ -e "/tmp/in_target.d/dib_environment" ]; then if [ -e "/tmp/in_target.d/dib_environment" ]; then
cp /tmp/in_target.d/dib_environment /etc/ cp /tmp/in_target.d/dib_environment /etc/

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# Install baseline packages and tools. # Install baseline packages and tools.
set -e set -eu
set -o pipefail
# If lsb_release is missing, just do nothing. # If lsb_release is missing, just do nothing.
DISTRO=`lsb_release -si` || true DISTRO=`lsb_release -si` || true

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
install -m 0755 -o root -g root $(dirname $0)/../dib-init-system /usr/bin/ install -m 0755 -o root -g root $(dirname $0)/../dib-init-system /usr/bin/

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
# Don't do anything if already mounted (if disk-image-create is invoked with # Don't do anything if already mounted (if disk-image-create is invoked with
# no elements specified, this hook actually fires twice, once during # no elements specified, this hook actually fires twice, once during

View File

@ -15,7 +15,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
set -e set -eu
set -o pipefail
# Download a URL to a local cache # Download a URL to a local cache
# e.g. cache-url http://.../foo ~/.cache/image-create/foo # e.g. cache-url http://.../foo ~/.cache/image-create/foo

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -eux set -eux
set -o pipefail
cat > ${TARGET_ROOT}/.extra_settings << EOF cat > ${TARGET_ROOT}/.extra_settings << EOF
DIB_DEBIAN_ALT_INIT_PACKAGE=systemd-sysv DIB_DEBIAN_ALT_INIT_PACKAGE=systemd-sysv
EOF EOF

View File

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
set -eux set -eux
set -o pipefail
cat > ${TARGET_ROOT}/.extra_settings << EOF cat > ${TARGET_ROOT}/.extra_settings << EOF
DIB_DEBIAN_ALT_INIT_PACKAGE=upstart DIB_DEBIAN_ALT_INIT_PACKAGE=upstart
EOF EOF

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -eux set -eux
set -o pipefail
# Working around bug in Debian cloud-init packages with upstart # Working around bug in Debian cloud-init packages with upstart
# where startpar will wait forever for these because they are tasks # where startpar will wait forever for these because they are tasks
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735204 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735204

View File

@ -15,6 +15,7 @@
# under the License. # under the License.
# #
set -eu set -eu
set -o pipefail
if [ -f ${TARGET_ROOT}/.extra_settings ] ; then if [ -f ${TARGET_ROOT}/.extra_settings ] ; then
. ${TARGET_ROOT}/.extra_settings . ${TARGET_ROOT}/.extra_settings
fi fi

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
INTERFACE=${1:-} #optional, if not specified configure all available interfaces INTERFACE=${1:-} #optional, if not specified configure all available interfaces
ENI_FILE="/etc/network/interfaces" ENI_FILE="/etc/network/interfaces"
@ -68,7 +69,7 @@ function config_exists() {
return 0 return 0
fi fi
else else
ifquery $interface >/dev/null 2>&1 && return 0 ifquery $interface >/dev/null 2>&1 && return 0 || return 1
fi fi
return 1 return 1
} }

View File

@ -19,6 +19,7 @@ allowed_regex=${RUN_PARTS_REGEX:-"^[0-9A-Za-z_-]+$"}
show_list= show_list=
set -ue set -ue
set -o pipefail
name=$(basename $0) name=$(basename $0)

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail set -o pipefail
home=$(dirname $0) home=$(dirname $0)

View File

@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
set -e set -eu
set -o pipefail
# install-packages package [package ...] # install-packages package [package ...]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
# Do an apt-get clean. This will free some space. # Do an apt-get clean. This will free some space.
set -e set -eu
set -o pipefail
apt-get clean apt-get clean

View File

@ -15,6 +15,7 @@
# under the License. # under the License.
# #
set -eux set -eux
set -o pipefail
DPKG_MANIFEST_NAME=dib-manifest-dpkg-$(basename ${IMAGE_NAME}) DPKG_MANIFEST_NAME=dib-manifest-dpkg-$(basename ${IMAGE_NAME})

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
# Do an apt-get update, so that packages can be installed. # Do an apt-get update, so that packages can be installed.
set -e set -eu
set -o pipefail
apt-get -y update apt-get -y update

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
install-packages dracut-network patch install-packages dracut-network patch

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
[ -n "$ARCH" ] [ -n "$ARCH" ]
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# Support for hard ware discovery # Support for hard ware discovery
set -e set -eu
set -o pipefail
set -o xtrace set -o xtrace
install-packages hwinfo install-packages hwinfo

View File

@ -2,7 +2,9 @@
# Save user SSH public key if available. # Save user SSH public key if available.
# (Obviously not suitable for downloadable images). # (Obviously not suitable for downloadable images).
set -e set -eu
set -o pipefail
source $_LIB/die source $_LIB/die
[ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set" [ -n "$TMP_HOOKS_PATH" ] || die "Temp hook path not set"

View File

@ -2,7 +2,8 @@
# Save user SSH public key if available. # Save user SSH public key if available.
# XXX: Obviously not suitable for downloadable images. # XXX: Obviously not suitable for downloadable images.
set -e set -eu
set -o pipefail
if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then
mkdir -p /root/.ssh mkdir -p /root/.ssh

View File

@ -2,7 +2,8 @@
# Save the HTTP/[S] and noproxy settings if available. # Save the HTTP/[S] and noproxy settings if available.
# XXX: Obviously not suitable for downloadable images. # XXX: Obviously not suitable for downloadable images.
set -e set -eu
set -o pipefail
set -o xtrace set -o xtrace
have_apt= have_apt=

View File

@ -15,6 +15,7 @@
# under the License. # under the License.
# #
set -eux set -eux
set -o pipefail
if [ -d $TMP_MOUNT_PATH/${DIB_MANIFEST_IMAGE_DIR} ]; then if [ -d $TMP_MOUNT_PATH/${DIB_MANIFEST_IMAGE_DIR} ]; then
# Move the dib_environment and dib_arguments files into the manifests dir # Move the dib_environment and dib_arguments files into the manifests dir

View File

@ -15,6 +15,7 @@
# under the License. # under the License.
# #
set -eu set -eu
set -o pipefail
export DIB_MANIFEST_IMAGE_DIR=${DIB_MANIFEST_IMAGE_DIR:-/etc/dib-manifests} export DIB_MANIFEST_IMAGE_DIR=${DIB_MANIFEST_IMAGE_DIR:-/etc/dib-manifests}
export DIB_MANIFEST_SAVE_DIR=${DIB_MANIFEST_SAVE_DIR:-${IMAGE_NAME}.d/} export DIB_MANIFEST_SAVE_DIR=${DIB_MANIFEST_SAVE_DIR:-${IMAGE_NAME}.d/}

View File

@ -15,5 +15,6 @@
# under the License. # under the License.
# #
set -eux set -eux
set -o pipefail
sudo mkdir -p $TMP_MOUNT_PATH/${DIB_MANIFEST_IMAGE_DIR} sudo mkdir -p $TMP_MOUNT_PATH/${DIB_MANIFEST_IMAGE_DIR}

View File

@ -1,7 +1,8 @@
#!/bin/bash #!/bin/bash
# Ensure we load the mellanox driver somehow # Ensure we load the mellanox driver somehow
set -e set -eu
set -o pipefail
home=$(dirname $0) home=$(dirname $0)

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -ex set -eux
set -o pipefail
MODULES_LIST=${DIB_MODPROBE_BLACKLIST:?"Please set DIB_MODPROBE_BLACKLIST."} MODULES_LIST=${DIB_MODPROBE_BLACKLIST:?"Please set DIB_MODPROBE_BLACKLIST."}

View File

@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
set -e set -eu
set -o pipefail
function run_zypper() { function run_zypper() {
# TODO: Uncertain if this can ever block wanting input from user # TODO: Uncertain if this can ever block wanting input from user

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eux
set -x set -o pipefail
export OPENSUSE_EXTRAS_PATH="$TMP_MOUNT_PATH/tmp/opensuse-extras" export OPENSUSE_EXTRAS_PATH="$TMP_MOUNT_PATH/tmp/opensuse-extras"
mkdir -p $OPENSUSE_EXTRAS_PATH mkdir -p $OPENSUSE_EXTRAS_PATH

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
# Setup ccache symlinks, as openSUSE's ccache package doesn't # Setup ccache symlinks, as openSUSE's ccache package doesn't
# include them. # include them.

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
sed -i -e "s,^USERGROUPS_ENAB.*$,USERGROUPS_ENAB yes," /etc/login.defs sed -i -e "s,^USERGROUPS_ENAB.*$,USERGROUPS_ENAB yes," /etc/login.defs

View File

@ -3,6 +3,7 @@
# here. # here.
set -eu set -eu
set -o pipefail
# To have access to FS_TYPE # To have access to FS_TYPE
_LIB="/tmp/opensuse-extras" _LIB="/tmp/opensuse-extras"

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
[ -n "$ARCH" ] [ -n "$ARCH" ]
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
PIP_CACHE_DIR=$HOME/.cache/image-create/pip PIP_CACHE_DIR=$HOME/.cache/image-create/pip
mkdir -p $PIP_CACHE_DIR mkdir -p $PIP_CACHE_DIR

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
PYPI_MIRROR_URL=${PYPI_MIRROR_URL:-''} PYPI_MIRROR_URL=${PYPI_MIRROR_URL:-''}
if [ -n "$PYPI_MIRROR_URL" ]; then if [ -n "$PYPI_MIRROR_URL" ]; then

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
if [ -e ~/.pip/pip.conf.orig ]; then if [ -e ~/.pip/pip.conf.orig ]; then
mv ~/.pip/pip.conf{.orig,} mv ~/.pip/pip.conf{.orig,}

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eux
set -x set -o pipefail
IMAGE_NAME=${IMAGE_NAME:-'image'} IMAGE_NAME=${IMAGE_NAME:-'image'}

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eux
set -x set -o pipefail
export RAMDISK_BUILD_PATH="$TMP_MOUNT_PATH/tmp/ramdisk-build" export RAMDISK_BUILD_PATH="$TMP_MOUNT_PATH/tmp/ramdisk-build"
mkdir -p $RAMDISK_BUILD_PATH mkdir -p $RAMDISK_BUILD_PATH

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -eux set -eux
set -o pipefail
DISTRO=`lsb_release -si` || true DISTRO=`lsb_release -si` || true

View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
# Ensure that all binaries listed in ramdisk elements, exist # Ensure that all binaries listed in ramdisk elements, exist
set -e set -eux
set -x set -o pipefail
export TARGET_DIR="/tmp/in_target.d/" export TARGET_DIR="/tmp/in_target.d/"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eux
set -x set -o pipefail
_LIB="/tmp/ramdisk-build" _LIB="/tmp/ramdisk-build"

View File

@ -5,6 +5,7 @@
set -eu set -eu
set -o pipefail
BASE_IMAGE_FILE=$1 BASE_IMAGE_FILE=$1
BASE_IMAGE_TAR=$2 BASE_IMAGE_TAR=$2

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -eux set -eux
set -o pipefail
rm -rf /tmp/grub rm -rf /tmp/grub

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
if [ -d /etc/first-boot.d ]; then if [ -d /etc/first-boot.d ]; then
rc_local=/etc/rc.d/rc.local rc_local=/etc/rc.d/rc.local

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
install -m 0755 -o root -g root /opt/stack/lsb-release/lsb_release /usr/local/bin install -m 0755 -o root -g root /opt/stack/lsb-release/lsb_release /usr/local/bin

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
yum remove -y grub2 yum remove -y grub2
# Install grub2 dependencies to minimise packages installed during finalise. # Install grub2 dependencies to minimise packages installed during finalise.

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]; then if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]; then
if [[ "$DIB_REG_TYPE" == "rhn" ]]; then if [[ "$DIB_REG_TYPE" == "rhn" ]]; then

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ] if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ]
then then

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
[ -n "$ARCH" ] [ -n "$ARCH" ]
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
[ -n "$ARCH" ] [ -n "$ARCH" ]
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail set -o pipefail
if [ "i386" = "$ARCH" ]; then if [ "i386" = "$ARCH" ]; then

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -uex set -uex
set -o pipefail
SCRIPTDIR=$(dirname $0) SCRIPTDIR=$(dirname $0)
DIB_INIT_SYSTEM=$(dib-init-system) DIB_INIT_SYSTEM=$(dib-init-system)

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
# If the old cache exists, move it to the new name # If the old cache exists, move it to the new name
function make_new_cache(){ function make_new_cache(){

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -uex set -uex
set -o pipefail
# Git isn't a dependency of this element, but is a dependency of pbr # Git isn't a dependency of this element, but is a dependency of pbr
# if you are doing pip install on a git cloned directoy, because this # if you are doing pip install on a git cloned directoy, because this

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
if [ -d /etc/first-boot.d ]; then if [ -d /etc/first-boot.d ]; then
rc_local=/etc/rc.local rc_local=/etc/rc.local

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
# Ubuntu's cloud images don't include drivers for real hardware. # Ubuntu's cloud images don't include drivers for real hardware.
install-packages linux-image-generic install-packages linux-image-generic

View File

@ -3,7 +3,8 @@
# found (as happens in a chroot). # found (as happens in a chroot).
# Temporarily remove grub, to avoid that confusion. # Temporarily remove grub, to avoid that confusion.
set -e set -eu
set -o pipefail
if dpkg-query -W grub-pc; then if dpkg-query -W grub-pc; then
apt-get -y remove grub-pc apt-get -y remove grub-pc

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eu set -eu
set -o pipefail
DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-} DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-}

View File

@ -2,6 +2,7 @@
# These are useful, or at worst not harmful, for all images we build. # These are useful, or at worst not harmful, for all images we build.
set -eu set -eu
set -o pipefail
[ -n "$ARCH" ] [ -n "$ARCH" ]
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
source $_LIB/die source $_LIB/die
[ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set" [ -n "$IMAGE_BLOCK_DEVICE" ] || die "Image block device not set"

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -eux set -eux
set -o pipefail
if [ "openSUSE project" = "$(lsb_release -is)" ]; then if [ "openSUSE project" = "$(lsb_release -is)" ]; then
# workaround for https://bugzilla.novell.com/show_bug.cgi?id=859493 # workaround for https://bugzilla.novell.com/show_bug.cgi?id=859493

View File

@ -3,8 +3,8 @@
# Configure grub. Note that the various conditionals here are to handle # Configure grub. Note that the various conditionals here are to handle
# different distributions gracefully. # different distributions gracefully.
set -e set -eux
set -x set -o pipefail
# FIXME: # FIXME:
[ -n "$IMAGE_BLOCK_DEVICE" ] [ -n "$IMAGE_BLOCK_DEVICE" ]

View File

@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
set -e set -eu
set -o pipefail
EXTRA_ARGS= EXTRA_ARGS=
ACTION=install ACTION=install

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
sudo sed -i 's/keepcache=0/keepcache=1/' /etc/yum.conf sudo sed -i 's/keepcache=0/keepcache=1/' /etc/yum.conf
sudo sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' /etc/yum.conf sudo sed -i 's/cachedir=\/var\/cache\/yum/cachedir=\/tmp\/yum/' /etc/yum.conf

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
# Disable caching packages for all repositories # Disable caching packages for all repositories
sudo zypper modifyrepo --all --no-keep-packages sudo zypper modifyrepo --all --no-keep-packages

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
# Enable caching packages for all repositories # Enable caching packages for all repositories
sudo zypper modifyrepo --all --keep-packages sudo zypper modifyrepo --all --keep-packages

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -eu
set -o pipefail
[ -n "$TARGET_ROOT" ] [ -n "$TARGET_ROOT" ]