From 43b70ce224772a0eab748ca5c120172142b64b19 Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Wed, 6 Nov 2013 22:25:34 -0600 Subject: [PATCH] /bin/bash all the things. Since we are using bash syntax in some of the element fragments, we should make sure we use bash for all of them, so that things don't break on systems where /bin/sh != /bin/bash. Change-Id: If2f043c57aa4e1492b7f9839213ef6123f683612 --- elements/base/install.d/99-dkms | 2 +- elements/cache-url/bin/cache-url | 2 +- elements/config-applier/install.d/20-config-applier | 2 +- elements/deploy-kexec/install.d/53-install-kexec | 2 +- elements/deploy/install.d/51-install-tgt | 2 +- elements/deploy/install.d/52-install-busybox | 2 +- elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces | 4 +++- elements/dkms/post-install.d/99-dkms | 2 +- elements/dpkg/bin/install-packages | 2 +- elements/dpkg/pre-install.d/00-disable-apt-recommends | 2 +- elements/dpkg/pre-install.d/01-install-bin | 2 +- elements/dracut-network/install.d/11-patch-dracut | 2 +- elements/fedora/bin/install-packages | 2 +- elements/ramdisk/cleanup.d/99-extract-ramdisk-files | 2 +- elements/rhel/bin/install-packages | 2 +- .../rpm-distro/post-install.d/06-network-config-nonzeroconf | 2 +- elements/rpm-distro/pre-install.d/01-install-bin | 2 +- elements/rpm-distro/pre-install.d/01-override-yum-arch | 2 +- elements/selinux-permissive/install.d/11-selinux-permissive | 2 +- elements/serial-console/install.d/20-stty | 2 +- elements/source-repositories/install.d/01-source-repositories | 2 +- elements/ubuntu/pre-install.d/00-remove-apt-xapian-index | 2 +- elements/vm/finalise.d/52-force-text-mode-console | 2 +- 23 files changed, 25 insertions(+), 23 deletions(-) diff --git a/elements/base/install.d/99-dkms b/elements/base/install.d/99-dkms index 56e8e160..44b2d4ce 100755 --- a/elements/base/install.d/99-dkms +++ b/elements/base/install.d/99-dkms @@ -1,2 +1,2 @@ -#!/bin/sh +#!/bin/bash install-packages dkms diff --git a/elements/cache-url/bin/cache-url b/elements/cache-url/bin/cache-url index e1f95366..312cbe5e 100755 --- a/elements/cache-url/bin/cache-url +++ b/elements/cache-url/bin/cache-url @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. diff --git a/elements/config-applier/install.d/20-config-applier b/elements/config-applier/install.d/20-config-applier index c7e863df..1b153fcf 100755 --- a/elements/config-applier/install.d/20-config-applier +++ b/elements/config-applier/install.d/20-config-applier @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash home=$(dirname $0) set -uex diff --git a/elements/deploy-kexec/install.d/53-install-kexec b/elements/deploy-kexec/install.d/53-install-kexec index 19e430e5..1a26ff78 100755 --- a/elements/deploy-kexec/install.d/53-install-kexec +++ b/elements/deploy-kexec/install.d/53-install-kexec @@ -1,2 +1,2 @@ -#!/bin/sh +#!/bin/bash install-packages kexec-tools diff --git a/elements/deploy/install.d/51-install-tgt b/elements/deploy/install.d/51-install-tgt index dc17f90a..9c36dcae 100755 --- a/elements/deploy/install.d/51-install-tgt +++ b/elements/deploy/install.d/51-install-tgt @@ -1,2 +1,2 @@ -#!/bin/sh +#!/bin/bash install-packages tgt diff --git a/elements/deploy/install.d/52-install-busybox b/elements/deploy/install.d/52-install-busybox index 356188ae..fdecb5dd 100755 --- a/elements/deploy/install.d/52-install-busybox +++ b/elements/deploy/install.d/52-install-busybox @@ -1,2 +1,2 @@ -#!/bin/sh +#!/bin/bash install-packages busybox diff --git a/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces b/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces index a9ef2afa..89ddcea8 100755 --- a/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces +++ b/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces @@ -1,4 +1,6 @@ -#!/bin/sh -x +#!/bin/bash + +set -x # Prepare the target system for regenerating /etc/network/interfaces # on its first boot. diff --git a/elements/dkms/post-install.d/99-dkms b/elements/dkms/post-install.d/99-dkms index 02ff606f..1e3773a6 100755 --- a/elements/dkms/post-install.d/99-dkms +++ b/elements/dkms/post-install.d/99-dkms @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Trigger a run of dkms for all the modules installed # to ensure we have valid modules build for all. diff --git a/elements/dpkg/bin/install-packages b/elements/dpkg/bin/install-packages index 35dc9d69..d5ce2306 100644 --- a/elements/dpkg/bin/install-packages +++ b/elements/dpkg/bin/install-packages @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. diff --git a/elements/dpkg/pre-install.d/00-disable-apt-recommends b/elements/dpkg/pre-install.d/00-disable-apt-recommends index 36c310cf..8221e442 100755 --- a/elements/dpkg/pre-install.d/00-disable-apt-recommends +++ b/elements/dpkg/pre-install.d/00-disable-apt-recommends @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Prevent apt from installing recommended packages dd of=/etc/apt/apt.conf.d/95disable-recommends << _EOF_ diff --git a/elements/dpkg/pre-install.d/01-install-bin b/elements/dpkg/pre-install.d/01-install-bin index 555bc782..651085e1 100755 --- a/elements/dpkg/pre-install.d/01-install-bin +++ b/elements/dpkg/pre-install.d/01-install-bin @@ -1,3 +1,3 @@ -#!/bin/sh +#!/bin/bash install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin diff --git a/elements/dracut-network/install.d/11-patch-dracut b/elements/dracut-network/install.d/11-patch-dracut index c15bd7ef..cee09c95 100755 --- a/elements/dracut-network/install.d/11-patch-dracut +++ b/elements/dracut-network/install.d/11-patch-dracut @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # If the patch doesn't apply just do nothing. This patch fixes a small # issue in the script that writes the network configuration files from diff --git a/elements/fedora/bin/install-packages b/elements/fedora/bin/install-packages index d353d2c9..b2ea563c 100644 --- a/elements/fedora/bin/install-packages +++ b/elements/fedora/bin/install-packages @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2012 Hewlett-Packard Development Company, L.P. # All Rights Reserved. diff --git a/elements/ramdisk/cleanup.d/99-extract-ramdisk-files b/elements/ramdisk/cleanup.d/99-extract-ramdisk-files index a1b258c0..aa6de620 100755 --- a/elements/ramdisk/cleanup.d/99-extract-ramdisk-files +++ b/elements/ramdisk/cleanup.d/99-extract-ramdisk-files @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e set -x diff --git a/elements/rhel/bin/install-packages b/elements/rhel/bin/install-packages index d65b4c43..f3f6548c 100644 --- a/elements/rhel/bin/install-packages +++ b/elements/rhel/bin/install-packages @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain diff --git a/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf b/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf index 5e3f2ced..78e53e18 100755 --- a/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf +++ b/elements/rpm-distro/post-install.d/06-network-config-nonzeroconf @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # zeroconf should not be activated or it will add a 169.254.0.0 # route. The route will interfere with access to the nova metadata diff --git a/elements/rpm-distro/pre-install.d/01-install-bin b/elements/rpm-distro/pre-install.d/01-install-bin index 555bc782..651085e1 100755 --- a/elements/rpm-distro/pre-install.d/01-install-bin +++ b/elements/rpm-distro/pre-install.d/01-install-bin @@ -1,3 +1,3 @@ -#!/bin/sh +#!/bin/bash install -m 0755 -o root -g root $(dirname $0)/../bin/* /usr/local/bin diff --git a/elements/rpm-distro/pre-install.d/01-override-yum-arch b/elements/rpm-distro/pre-install.d/01-override-yum-arch index bf0c6ed8..0e4ca66f 100755 --- a/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash if [ "i386" = "$ARCH" ]; then basearch=i386 diff --git a/elements/selinux-permissive/install.d/11-selinux-permissive b/elements/selinux-permissive/install.d/11-selinux-permissive index 40255cf2..a08f9bb1 100755 --- a/elements/selinux-permissive/install.d/11-selinux-permissive +++ b/elements/selinux-permissive/install.d/11-selinux-permissive @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash echo "SELINUX=permissive" > /etc/selinux/config echo "SELINUXTYPE=targeted" >> /etc/selinux/config diff --git a/elements/serial-console/install.d/20-stty b/elements/serial-console/install.d/20-stty index f8fa8e5f..ca91e7df 100755 --- a/elements/serial-console/install.d/20-stty +++ b/elements/serial-console/install.d/20-stty @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash home=$(dirname $0) set -uex diff --git a/elements/source-repositories/install.d/01-source-repositories b/elements/source-repositories/install.d/01-source-repositories index 1f9740a8..4ef606a7 100755 --- a/elements/source-repositories/install.d/01-source-repositories +++ b/elements/source-repositories/install.d/01-source-repositories @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -uex diff --git a/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index b/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index index f1c24647..c785802b 100755 --- a/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index +++ b/elements/ubuntu/pre-install.d/00-remove-apt-xapian-index @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This package is broken and causes real issues on update: # https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/1227420 apt-get --yes remove apt-xapian-index || : diff --git a/elements/vm/finalise.d/52-force-text-mode-console b/elements/vm/finalise.d/52-force-text-mode-console index ebc1a136..a647e00d 100755 --- a/elements/vm/finalise.d/52-force-text-mode-console +++ b/elements/vm/finalise.d/52-force-text-mode-console @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e