summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-13 19:01:44 +0200
committerChristian Poessinger <christian@poessinger.com>2019-10-13 19:01:44 +0200
commit25bb74bc51f7ee36b8da834b8cb1ecc1aa1e5ea9 (patch)
treec507cd581ac5a9a2d321fd3a91777a9af615728d
parent088dbe5d1d5f4a383f600227cef9be6c806de02f (diff)
downloadvyos-build-25bb74bc51f7ee36b8da834b8cb1ecc1aa1e5ea9.tar.gz
vyos-build-25bb74bc51f7ee36b8da834b8cb1ecc1aa1e5ea9.zip
Firmware: bail out when there is a download error
-rwxr-xr-xdata/live-build-config/hooks/live/40-linux-firmware.chroot12
1 files changed, 9 insertions, 3 deletions
diff --git a/data/live-build-config/hooks/live/40-linux-firmware.chroot b/data/live-build-config/hooks/live/40-linux-firmware.chroot
index a7f431da..7d0de1f2 100755
--- a/data/live-build-config/hooks/live/40-linux-firmware.chroot
+++ b/data/live-build-config/hooks/live/40-linux-firmware.chroot
@@ -4,10 +4,16 @@
# of the linux-firmware repository
COMMIT="aa95e90b2c638f1ca6647d12b2d1b18284428f9c"
-echo I: Retrieving Linux Firmware - commit ${COMMIT}
+echo "I: Retrieving Linux Firmware - commit ${COMMIT}"
+
+ret=$(curl -w "%{http_code}" -o /tmp/linux-firmware-${COMMIT}.tar.gz \
+ https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${COMMIT}.tar.gz)
+
+if [ "${ret}" != "200" ]; then
+ echo E: Received HTTP error code \"${ret}\" when downloading Linux Firmware ...
+ exit 1
+fi
-curl -o /tmp/linux-firmware-${COMMIT}.tar.gz \
- https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${COMMIT}.tar.gz
tar xf /tmp/linux-firmware-${COMMIT}.tar.gz -C /lib
mv /lib/linux-firmware-${COMMIT} /lib/firmware
rm -f /tmp/linux-firmware-${COMMIT}.tar.gz