diff options
author | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2012-12-05 17:01:04 +0000 |
---|---|---|
committer | Jonathan Maw <jonathan.maw@codethink.co.uk> | 2012-12-05 17:07:16 +0000 |
commit | cabf0e38873f0240361b4a5e23d5bd855371fc66 (patch) | |
tree | 5ae2d69ebdb64d22a1d066b08a8895fe89748f46 | |
parent | 2b62e95bf4cf7c886a9903fe587e62787dadd467 (diff) | |
download | genivi-initial-setup-cabf0e38873f0240361b4a5e23d5bd855371fc66.tar.gz |
Restructure code so that run-baserock-image calls download-image
-rwxr-xr-x | armv7-versatile/download-image.sh | 12 | ||||
-rw-r--r-- | armv7-versatile/run-baserock-image.sh | 27 |
2 files changed, 33 insertions, 6 deletions
diff --git a/armv7-versatile/download-image.sh b/armv7-versatile/download-image.sh index 0989b3d..eb390c4 100755 --- a/armv7-versatile/download-image.sh +++ b/armv7-versatile/download-image.sh @@ -3,15 +3,17 @@ set -e DIR="$1" +IMAGE_BASENAME="$2" -if [[ -z "$DIR" ]]; then - echo "Usage: $0 <INSTALL DIR>" +if [[ -z "$IMAGE_BASENAME" ]]; then + echo "Usage: $0 <INSTALL DIR> <IMAGE BASE NAME>" + echo "Example: $0 . devel-system-armv7-versatile" exit 1 fi -COMPRESSED_IMAGE="devel-system-armv7-versatile.img.gz" +COMPRESSED_IMAGE="$IMAGE_BASENAME.img.gz" DECOMPRESSED_IMAGE=${COMPRESSED_IMAGE/.gz/} -KERNEL_IMAGE="devel-system-armv7-versatile.zimage" +KERNEL_IMAGE="$IMAGE_BASENAME.zimage" if [[ ! -d "$DIR" ]]; then mkdir -p "$DIR" @@ -25,7 +27,7 @@ if [[ ! -f "$COMPRESSED_IMAGE" ]]; then "$COMPRESSED_IMAGE" fi -if [[ ! -f "$KERNEL_IMAGE" ]]; then +if [[ -f "$KERNEL_IMAGE" ]]; then echo "Downloading kernel image..." curl "http://download.baserock.org/baserock/$KERNEL_IMAGE" > \ "$KERNEL_IMAGE" diff --git a/armv7-versatile/run-baserock-image.sh b/armv7-versatile/run-baserock-image.sh index 00d4921..8318777 100644 --- a/armv7-versatile/run-baserock-image.sh +++ b/armv7-versatile/run-baserock-image.sh @@ -1,5 +1,29 @@ #!/bin/bash +set -e + +DIR="$1" + +if [[ -z "$DIR" ]]; then + echo "Usage: $0 <INSTALL DIR>" + exit 1 +fi + + +if [[ ! -d "$DIR" ]]; then + mkdir -p "$DIR" +fi + +IMAGE_BASENAME="devel-system-armv7-versatile" +COMPRESSED_IMAGE="$DIR/$IMAGE_BASENAME.img.gz" +DECOMPRESSED_IMAGE=${COMPRESSED_IMAGE/.gz/} +KERNEL_IMAGE="$DIR$/$IMAGE_BASENAME.zimage" + +./download-image.sh "$DIR" "$IMAGE_BASENAME" + +# If we ever get multiple disks working on qemu ARM, execute: +# ./create-source-disk.sh "$DIR" + find_tunctl() { for path in `which tunctl` /{usr/,usr/local/}{bin,sbin}/tunctl; do if [ -x "$path" ]; then @@ -18,7 +42,8 @@ On Ubuntu it is in the uml-utilities package. EOF fi -MACHINE=qemuarmv7 PATH="$PATH:$(pwd)" OE_TMPDIR=/ KERNEL="$1" ROOTFS="$2" \ +MACHINE=qemuarmv7 PATH="$PATH:$(pwd)" OE_TMPDIR=/ KERNEL="$KERNEL_IMAGE" \ + ROOTFS="$DECOMPRESSED_IMAGE" \ sh ./runqemu serial \ bootparams="rootflags=subvol=factory-run root=/dev/mmcblk0p1" \ btrfs qemuparams="-m 1024 -M vexpress-a9" |