Skip to content

Commit

Permalink
get vm-type=qemu working again
Browse files Browse the repository at this point in the history
* Fix virtio storage detection
* avoid overwriting console overwriting, if the kernel package specifies a console name
  • Loading branch information
adrianschroeter committed Jan 12, 2022
1 parent 0eba40b commit f3ceef8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
6 changes: 3 additions & 3 deletions build-vm
Original file line number Diff line number Diff line change
Expand Up @@ -907,14 +907,14 @@ vm_first_stage() {
# some time has passed copying files, lets make sure we should not exit
check_exit

# do vm specific fixups
vm_fixup

# update the hostarch
if test -n "$VM_ROOT" ; then
vm_update_hostarch
fi

# do vm specific fixups
vm_fixup

# copy ccache archive
if test -n "$CCACHE" -a -n "$CCACHE_ARCHIVE" -a "$CCACHE_ARCHIVE" = "${CCACHE_ARCHIVE#redis://}"; then
mkdir -p "$BUILD_ROOT/.build.oldpackages"
Expand Down
21 changes: 10 additions & 11 deletions build-vm-qemu
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ vm_startup_qemu() {
case $BUILD_HOST_ARCH in
armv6l|armv7l)
qemu_bin="/usr/bin/qemu-system-arm"
qemu_console=ttyAMA0
qemu_console=${qemu_console:-ttyAMA0}
qemu_options="-M virt"
qemu_device=virtio-blk-device
qemu_rng_device=virtio-rng-device
qemu_cpu="-cpu cortex-a15"
;;
armv8l|aarch32|aarch64|aarch64_ilp32)
qemu_bin="/usr/bin/qemu-system-aarch64"
qemu_console=ttyAMA0
qemu_console=${qemu_console:-ttyAMA0}
qemu_cpu="-cpu cortex-a72"
qemu_options="$qemu_options -M virt"
qemu_device=virtio-blk-device
qemu_rng_device=virtio-rng-device
;;
ppc|ppcle|ppc64|ppc64le)
qemu_bin="/usr/bin/qemu-system-ppc64"
qemu_console=hvc0
qemu_console=${qemu_console:-hvc0}
qemu_options="-M pseries"
qemu_cpu=""
grep -q PPC970MP /proc/cpuinfo && qemu_check_ppc970
Expand All @@ -65,7 +65,7 @@ vm_startup_qemu() {
;;
riscv64)
qemu_bin="/usr/bin/qemu-system-riscv64"
qemu_console=ttyS0
qemu_console=${qemu_console:-ttyS0}
qemu_cpu="-cpu rv64"
qemu_options="$qemu_options -M virt -bios"
if test -f /usr/share/qemu/opensbi-riscv64-generic-fw_dynamic.bin; then
Expand All @@ -80,7 +80,7 @@ vm_startup_qemu() {
s390|s390x)
qemu_bin="/usr/bin/qemu-system-s390x"
qemu_cpu="-cpu qemu"
qemu_console=hvc0
qemu_console=${qemu_console:-hvc0}
qemu_device=virtio-blk-ccw
qemu_serial_device=virtio-serial-ccw
qemu_rng_device=virtio-rng-ccw
Expand All @@ -95,19 +95,19 @@ vm_startup_qemu() {
#
hppa)
qemu_bin="/usr/bin/qemu-system-hppa"
qemu_console=ttyAMA0
qemu_console=${qemu_console:-ttyAMA0}
qemu_cpu=""
qemu_options="$qemu_options -bios /usr/share/qemu/hppa-firmware.img"
;;
m68k)
qemu_bin="/usr/bin/qemu-system-m68k"
qemu_console=ttyAMA0
qemu_console=${qemu_console:-ttyAMA0}
qemu_cpu="-cpu m68000"
qemu_options="$qemu_options -M none"
;;
riscv32)
qemu_bin="/usr/bin/qemu-system-riscv32"
qemu_console=ttyS0
qemu_console=${qemu_console:-ttyS0}
qemu_cpu="-cpu rv32"
qemu_options="$qemu_options -M virt -bios /usr/share/qemu/opensbi-riscv32-virt-fw_jump.bin"
qemu_device=virtio-blk-device
Expand Down Expand Up @@ -212,9 +212,8 @@ vm_kill_qemu() {

vm_fixup_qemu() {
vm_fixup_kvm

case $qemu_device in
virtio*)
case $BUILD_HOST_ARCH in
armv6l|armv7l|armv8l|aarch32|aarch64|aarch64_ilp32|ppc|ppcle|ppc64|ppc64le|riscv64|s390|s390x)
VM_ROOTDEV=/dev/disk/by-id/virtio-0
VM_SWAPDEV=/dev/disk/by-id/virtio-1
;;
Expand Down

0 comments on commit f3ceef8

Please sign in to comment.