f6ba2aeaf4
Using set -e in all of our scripts will prevent some subtle bugs from slipping in, and will allow us to enforce use of set -e with tooling. This change also adds -u and set -o pipefail in the less complex scripts where it is unlikely to cause problems. A follow-up change will enable those options in the complex scripts so that if it breaks something it can be reverted easily. Change-Id: I0ad358ccb98da7277a0ee2e9ce8fda98438675eb
20 lines
751 B
Bash
Executable File
20 lines
751 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
# 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
|
|
# the cmdline to the disk on FC18/FC19.
|
|
#
|
|
#for dracut-network 029 we need a different patch:
|
|
# http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/?id=613ed5cd764d54cac082a1e7b7e8d1f1fed29d35
|
|
IFCFG_FILE="/usr/lib/dracut/modules.d/45ifcfg/write-ifcfg.sh"
|
|
NETGEN_FILE="/usr/lib/dracut/modules.d/40network/net-genrules.sh"
|
|
|
|
if patch --dry-run $NETGEN_FILE < $(dirname $0)/../dracut-029-netgen.patch > /dev/null; then
|
|
patch $NETGEN_FILE < $(dirname $0)/../dracut-029-netgen.patch || true
|
|
else
|
|
patch $IFCFG_FILE < $(dirname $0)/../dracut-write-ifcfg.patch || true
|
|
fi
|