* rebase bc cross bootstrap patch
[t2sde.git] / tests / qemu.in
blob100e9d51b630dcae11fdb70ffed730615ce66ff6
1 #!/bin/bash
3 # Copyright (C) 2022-2024 René Rebe, ExactCODE GmbH; Germany.
5 [ "$QEMUSYS" ] || exit 43
7 qemuargs=
9 vmlinux=vmlinux
10 append="console=ttyS0"
11 isoboot="-boot d"
13 lowmem=128 # installer needs a bit more than minird
14 normmem=768
15 highmem=2048
17 intstorage="-device virtio-blk,drive=drv0 -drive if=none,id=drv0,file="
18 extstorage="-cdrom "
20 host_arch=$(uname -m)
22 efidir=/srv
24 case "$QEMUSYS" in
25 *-alpha)
26 intstorage="-hda "
27 isoboot=
29 *-arm*|*-aarch64*)
30 qemuargs="-M virt"
31 vmlinux=vmlinuz
32 [[ "$QEMUSYS" = *-aarch64* ]] &&
33 qemuargs="$qemuargs -cpu max" &&
34 isoboot="-bios $efidir/RELEASEAARCH64_QEMU_EFI.fd $isoboot"
36 [[ "$QEMUSYS" = *-arm* ]] &&
37 isoboot="-bios $efidir/RELEASEARM_QEMU_EFI.fd $isoboot"
39 [ "$host_arch" = aarch64 ] && qemuargs="$qemuargs --enable-kvm"
40 append= # "console=ttyAMA0"
42 *-mips*)
43 qemuargs="-M malta"
44 [[ "$QEMUSYS" = *mips64* ]] && qemuargs="$qemuargs -cpu P5600"
45 intstorage="-hda "
46 isoboot=
48 *-m68k)
49 qemuargs="-M q800"
50 intstorage="-hda "
51 lowmem=256
52 normmem=512
53 isoboot=
55 *-microblaze|*-nios2|*-or1k)
56 intstorage="-hda "
57 isoboot=
59 *-ppc*)
60 if [[ $QEMU = *64le ]]; then
61 qemuargs="-M powernv"
62 append="console=hvc0"
63 lowmem=1024
64 normmem=1024
65 extstorage="-drive if=virtio,file="
66 isoboot=
67 elif [[ $QEMUSYS = *64 ]]; then
68 intstorage="-hda "
69 qemuargs="-M mac99"
70 append=
71 else
72 qemuargs="-M g3beige"
73 intstorage="-hda "
74 highmem=1024
75 append=
77 [ "$host_arch" = ppc64 ] && qemuargs="$qemuargs --enable-kvm"
79 *-*riscv*)
80 vmlinux=vmlinuz
81 qemuargs="-M virt"
82 extstorage="-drive if=virtio,file="
83 isoboot=
85 *-sh4)
86 append="console=ttySC1,115200"
87 qemuargs="-M r2d"
88 intstorage="-hda "
89 isoboot=
91 *-sparc)
92 qemuargs="-M SS-5" # -cpu 'TI SuperSparc II'"
93 intstorage="-hda "
94 normmem=256 highmem=256
96 *-s390x)
97 vmlinux=vmlinuz
98 qemuargs=
99 isoboot=
101 *-hppa64*)
102 qemuargs="$qemuargs -machine C3700 -cpu hppa64"
103 intstorage="-hda "
104 QEMUSYS=${QEMUSYS%64*}
106 *-*86*)
107 vmlinux=vmlinuz
108 if [[ "$QEMUSYS" = *386 ]]; then
109 lowmem=96
110 isoboot="-bios $efidir/RELEASEIa32_OVMF.fd $isoboot"
111 else
112 isoboot="-bios $efidir/RELEASEX64_OVMF.fd $isoboot"
115 [ "$host_arch" = x86_64 ] && qemuargs="$qemuargs --enable-kvm"
117 esac
119 [[ "$qemuargs" = *enable-kvm* ]] && qemuargs="$qemuargs -smp 2"
121 [ -e $SYSROOT/boot/$vmlinux ] || exit 42