Blame 0108-livenet-don-t-attempt-to-download-the-image-for-ever.patch

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