From cabf0e38873f0240361b4a5e23d5bd855371fc66 Mon Sep 17 00:00:00 2001 From: Jonathan Maw Date: Wed, 5 Dec 2012 17:01:04 +0000 Subject: Restructure code so that run-baserock-image calls download-image --- armv7-versatile/download-image.sh | 12 +++++++----- 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 " +if [[ -z "$IMAGE_BASENAME" ]]; then + echo "Usage: $0 " + 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 " + 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" -- cgit v1.2.1