summaryrefslogtreecommitdiff
path: root/armv7-versatile/download-image.sh
diff options
context:
space:
mode:
Diffstat (limited to 'armv7-versatile/download-image.sh')
-rwxr-xr-xarmv7-versatile/download-image.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/armv7-versatile/download-image.sh b/armv7-versatile/download-image.sh
new file mode 100755
index 0000000..f283783
--- /dev/null
+++ b/armv7-versatile/download-image.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+set -e
+
+DIR="$1"
+
+if [[ -z "$DIR" ]]; then
+ echo "Usage: $0 <INSTALL DIR>"
+ exit 1
+fi
+
+COMPRESSED_IMAGE="devel-system-armv7-versatile.img.gz"
+DECOMPRESSED_IMAGE=${COMPRESSED_IMAGE/.gz/}
+KERNEL_IMAGE="devel-system-armv7-versatile.zimage"
+
+if [[ ! -d "$DIR" ]]; then
+ mkdir -p "$DIR"
+fi
+
+cd "$DIR"
+
+if [[ ! -f "$COMPRESSED_IMAGE" ]]; then
+ echo "Downloading development image..."
+ curl "http://download.baserock.org/baserock/$COMPRESSED_IMAGE" > \
+ "$COMPRESSED_IMAGE"
+fi
+
+if [[ -f "$KERNEL_IMAGE" ]]; then
+ echo "Downloading kernel image..."
+ curl "http://download.baserock.org/baserock/$KERNEL_IMAGE" > \
+ "$KERNEL_IMAGE"
+fi
+
+if [[ ! -f "$DECOMPRESSED_IMAGE" ]]; then
+ echo "Decompressing development image..."
+ gzip -cd "$COMPRESSED_IMAGE" > "$DECOMPRESSED_IMAGE"
+fi