diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2023-01-22 17:42:02 +0100 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2023-01-22 17:42:02 +0100 |
| commit | 7f6d37650d228f4765fc8b9a0bde2feaaaee4927 (patch) | |
| tree | 247f5575d2bd2db8db9723d353d830dc68fcbb6d /vm/debian/armv7/run.sh | |
| parent | 438409775af7a475fb1db1256994bab2040d99e1 (diff) | |
.
Diffstat (limited to 'vm/debian/armv7/run.sh')
| -rwxr-xr-x | vm/debian/armv7/run.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/vm/debian/armv7/run.sh b/vm/debian/armv7/run.sh new file mode 100755 index 0000000..33f3ff3 --- /dev/null +++ b/vm/debian/armv7/run.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +set -e + +cd $(dirname -- "$0") + +ISO_URL=https://cdimage.debian.org/debian-cd/current/armhf/iso-cd/debian-11.6.0-armhf-netinst.iso +KERNEL_URL=http://ftp.us.debian.org/debian/dists/stable/main/installer-armhf/current/images/cdrom/vmlinuz +INITRD_URL=http://ftp.us.debian.org/debian/dists/stable/main/installer-armhf/current/images/cdrom/initrd.gz + +ISO_PATH=$(basename $ISO_URL) +KERNEL_PATH=$(basename $KERNEL_URL) +INITRD_PATH=$(basename $INITRD_URL) + +IMG_PATH=debian.qcow2 + +if [ ! -f $ISO_PATH ]; then + curl -L -o $ISO_PATH $ISO_URL +fi + +if [ ! -f $KERNEL_PATH ]; then + curl -L -o $KERNEL_PATH $KERNEL_URL +fi + +if [ ! -f $INITRD_PATH ]; then + curl -L -o $INITRD_PATH $INITRD_URL +fi + +if [ ! -f $IMG_PATH ]; then + qemu-img create -f qcow2 $IMG_PATH 20G +fi + +exec qemu-system-arm \ + -machine virt \ + -cpu cortex-a15 \ + -smp 4 \ + -m 2G \ + -kernel $KERNEL_PATH \ + -initrd $INITRD_PATH \ + -append "console=ttyAMA0" \ + -drive if=none,file=$ISO_PATH,media=cdrom,id=drive0 \ + -drive if=none,file=$IMG_PATH,media=disk,id=drive1 \ + -netdev user,id=netdev0 \ + -device virtio-scsi-device \ + -device scsi-cd,drive=drive0 \ + -device scsi-hd,drive=drive1 \ + -device virtio-net-device,netdev=netdev0 \ + -nographic \ + "$@" |
