diskimage-builder/elements/dracut-network/install.d/11-patch-dracut

20 lines
755 B
Plaintext
Raw Normal View History

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