aboutsummaryrefslogtreecommitdiff
path: root/vm/alpine/armv7/run.sh
blob: 8e5f16dcdcdb5611061915234fba798e75d376f5 (plain) (blame)
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
#!/bin/sh

set -e

cd $(dirname -- "$0")

[ -f alpine.tar.gz ] || \
    curl -L -o alpine.tar.gz https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/armv7/alpine-uboot-3.18.4-armv7.tar.gz

[ -f vmlinuz-lts ] || \
    tar -x -f alpine.tar.gz --strip-components=2 ./boot/vmlinuz-lts

[ -f initramfs-lts ] || \
    tar -x -f alpine.tar.gz --strip-components=2 ./boot/initramfs-lts

[ -f alpine.qcow2 ] || \
    qemu-img create -f qcow2 alpine.qcow2 20G

exec qemu-system-arm \
    -M virt \
    -m 1G \
    -cpu cortex-a15 \
    -kernel vmlinuz-lts \
    -initrd initramfs-lts \
    -append "console=ttyAMA0" \
    -hda alpine.qcow2 \
    -nographic \
    "$@"