summaryrefslogtreecommitdiff
path: root/armv7-versatile/run-baserock-image.sh
blob: ad378d2d31703e138b52b59bb6d064dc8099698c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/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
            return 0
	fi
    done
    return 1
}

if ! find_tunctl; then
cat >&2 <<EOF
Could not find tunctl executable in standard paths or PATH

On Fedora it is in the tunctl package.
On Ubuntu it is in the uml-utilities package.
EOF
fi

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"