diskimage-builder/elements/dracut-network/install.d/11-patch-dracut
Victor Lowther 43b70ce224 /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
2013-11-17 16:59:31 -06:00

17 lines
726 B
Bash
Executable File

#!/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
# 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