diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-10-13 19:01:44 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-10-13 19:01:44 +0200 |
commit | 25bb74bc51f7ee36b8da834b8cb1ecc1aa1e5ea9 (patch) | |
tree | c507cd581ac5a9a2d321fd3a91777a9af615728d | |
parent | 088dbe5d1d5f4a383f600227cef9be6c806de02f (diff) | |
download | vyos-build-25bb74bc51f7ee36b8da834b8cb1ecc1aa1e5ea9.tar.gz vyos-build-25bb74bc51f7ee36b8da834b8cb1ecc1aa1e5ea9.zip |
Firmware: bail out when there is a download error
-rwxr-xr-x | data/live-build-config/hooks/live/40-linux-firmware.chroot | 12 |
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 |