From c93dfeec7f1f5126ec5857e61d42cbfa8ae1c621 Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Fri, 16 Aug 2013 14:58:39 +0200 Subject: [PATCH] Fixed a network setup issue for F19 IP address is passed as a kernel boot param when booting undercloud machine. For Fedora 19, this IP is not set, instead IP is fetched from DHCP. The problem is caused by a bug in dracut-network version 029, which causes that dracut network setup script is not executed properly. This patch applies a fix for the bug when building undercloud image. Fixes: bug #1213833 Change-Id: Ie94a86ed716044343791628973143c1a7d0778dc --- .../dracut-network/dracut-029-netgen.patch | 19 +++++++++++++++++++ .../dracut-network/install.d/11-patch-dracut | 16 +++++++++++++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 elements/dracut-network/dracut-029-netgen.patch diff --git a/elements/dracut-network/dracut-029-netgen.patch b/elements/dracut-network/dracut-029-netgen.patch new file mode 100644 index 00000000..dcd9a08b --- /dev/null +++ b/elements/dracut-network/dracut-029-netgen.patch @@ -0,0 +1,19 @@ +diff --git a/modules.d/40network/net-genrules.sh b/modules.d/40network/net-genrules.sh +index f6b7d9a..31cd1e6 100755 +--- a/modules.d/40network/net-genrules.sh ++++ b/modules.d/40network/net-genrules.sh +@@ -74,7 +74,13 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh + done + echo 'LABEL="net_end"' + +- for iface in $MASTER_IFACES; do ++ if [ -n "$MASTER_IFACES" ]; then ++ wait_ifaces=$MASTER_IFACES ++ else ++ wait_ifaces=$IFACES ++ fi ++ ++ for iface in $wait_ifaces; do + if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then + echo "[ -f /tmp/setup_net_${iface}.ok ]" >$hookdir/initqueue/finished/wait-$iface.sh + fi diff --git a/elements/dracut-network/install.d/11-patch-dracut b/elements/dracut-network/install.d/11-patch-dracut index 5674bfa2..c15bd7ef 100755 --- a/elements/dracut-network/install.d/11-patch-dracut +++ b/elements/dracut-network/install.d/11-patch-dracut @@ -1,6 +1,16 @@ #!/bin/sh -# If the patch doesn't apply just do nothing. This patch fix a small +# 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. -patch /usr/lib/dracut/modules.d/45ifcfg/write-ifcfg.sh < $(dirname $0)/../dracut-write-ifcfg.patch || true +# 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