blob: 33f3ff3527beb0112e5ed1e6a1ec0d721bb5c71f (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 \
"$@"
|