Blame SOURCES/0270-livenet-don-t-attempt-to-download-the-image-for-ever.patch

18971c
From e5f4bbd804e337a7efaf3a0cb4fc3a37b7e33b47 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 3 Jul 2015 14:00:33 +0200
18971c
Subject: [PATCH] livenet: don't attempt to download the image for every
18971c
 interface
18971c
18971c
https://bugzilla.redhat.com/show_bug.cgi?id=1152485
18971c
---
18971c
 modules.d/90livenet/livenetroot.sh | 10 +++++++++-
18971c
 1 file changed, 9 insertions(+), 1 deletion(-)
18971c
18971c
diff --git a/modules.d/90livenet/livenetroot.sh b/modules.d/90livenet/livenetroot.sh
18971c
index 1bbee55b..2e36ee98 100755
18971c
--- a/modules.d/90livenet/livenetroot.sh
18971c
+++ b/modules.d/90livenet/livenetroot.sh
18971c
@@ -7,12 +7,20 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
18971c
 
18971c
 PATH=/usr/sbin:/usr/bin:/sbin:/bin
18971c
 
18971c
+[ -e /tmp/livenet.downloaded ] && exit 0
18971c
+
18971c
 # args get passed from 40network/netroot
18971c
 netroot="$2"
18971c
 liveurl="${netroot#livenet:}"
18971c
 info "fetching $liveurl"
18971c
 imgfile=$(fetch_url "$liveurl")
18971c
-[ $? = 0 ] || die "failed to download live image: error $?"
18971c
+
18971c
+if [ $? = 0 ]; then
18971c
+	warn "failed to download live image: error $?"
18971c
+	exit 1
18971c
+fi
18971c
+
18971c
+> /tmp/livenet.downloaded
18971c
 
18971c
 # TODO: couldn't dmsquash-live-root handle this?
18971c
 if [ ${imgfile##*.} = "iso" ]; then