add x86_64 and riscv64 qemu command and options.
test: /srv/result/host-info/2021-01-04/vm-2p8g/debian-sid-aarch64/z9.280125 /srv/result/host-info/2021-01-04/vm-2p8g/debian-sid-x86_64/z9.280114 /srv/result/host-info/2021-01-04/vm-2p8g/debian-sid-riscv64/z9.280135
Signed-off-by: Liu Yinsi liuyinsi@163.com --- providers/qemu/kvm.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 0c98065..1018d06 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -25,6 +25,7 @@ qemu_command() { qemu=( qemu-system-aarch64 + qemu-system-x86_64 qemu-kvm )
@@ -74,6 +75,12 @@ check_option_value() } [ -n "$initrds" ] || exit + + # debian has both qemu-system-x86_64 and qemu-system-riscv64 command + [[ $kernel =~ 'riscv64' ]] && qemu=qemu-system-riscv64 + + ls $bios >/dev/null 2>&1 || bios=/usr/share/ovmf/OVMF.fd + ls $helper >/dev/null 2>&1 || helper=/usr/lib/qemu/qemu-bridge-helper }
get_initrd() @@ -122,6 +129,17 @@ individual_option() -bios $bios -nic $nic ) + + x86_64=( + -bios $bios + -nic $nic + ) + + riscv64=( + -machine virt + -device virtio-net-device,netdev=net0,mac=${mac} + -netdev bridge,br=br0,id=net0,helper=${helper} + ) }
run_qemu() @@ -132,6 +150,13 @@ run_qemu() ;; qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}") + [ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}") + ;; + qemu-system-x86_64) + kvm=("${kvm[@]}" "${x86_64[@]}") + ;; + qemu-system-riscv64) + kvm=("${kvm[@]}" "${riscv64[@]}") ;; esac
@@ -74,6 +75,12 @@ check_option_value() }
[ -n "$initrds" ] || exit
- # debian has both qemu-system-x86_64 and qemu-system-riscv64 command
- [[ $kernel =~ 'riscv64' ]] && qemu=qemu-system-riscv64
- ls $bios >/dev/null 2>&1 || bios=/usr/share/ovmf/OVMF.fd
- ls $helper >/dev/null 2>&1 || helper=/usr/lib/qemu/qemu-bridge-helper
what is ls? if you want to check whether the file exists, use [[ -f file_name ]]
Thanks, Luan Shengde
}
get_initrd() @@ -122,6 +129,17 @@ individual_option() -bios $bios -nic $nic )
- x86_64=(
-bios $bios
-nic $nic
- )
- riscv64=(
-machine virt
-device virtio-net-device,netdev=net0,mac=${mac}
-netdev bridge,br=br0,id=net0,helper=${helper}
- )
}
run_qemu() @@ -132,6 +150,13 @@ run_qemu() ;; qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}")
[ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-x86_64)
kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-riscv64)
esackvm=("${kvm[@]}" "${riscv64[@]}") ;;
-- 2.23.0
On Mon, Jan 04, 2021 at 02:51:03PM +0800, Luan Shengde wrote:
@@ -74,6 +75,12 @@ check_option_value() }
[ -n "$initrds" ] || exit
- # debian has both qemu-system-x86_64 and qemu-system-riscv64 command
- [[ $kernel =~ 'riscv64' ]] && qemu=qemu-system-riscv64
- ls $bios >/dev/null 2>&1 || bios=/usr/share/ovmf/OVMF.fd
- ls $helper >/dev/null 2>&1 || helper=/usr/lib/qemu/qemu-bridge-helper
what is ls? if you want to check whether the file exists, use [[ -f file_name ]]
good
Thanks, Yinsi
Thanks, Luan Shengde
}
get_initrd() @@ -122,6 +129,17 @@ individual_option() -bios $bios -nic $nic )
- x86_64=(
-bios $bios
-nic $nic
- )
- riscv64=(
-machine virt
-device virtio-net-device,netdev=net0,mac=${mac}
-netdev bridge,br=br0,id=net0,helper=${helper}
- )
}
run_qemu() @@ -132,6 +150,13 @@ run_qemu() ;; qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}")
[ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-x86_64)
kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-riscv64)
esackvm=("${kvm[@]}" "${riscv64[@]}") ;;
-- 2.23.0
On Mon, Jan 04, 2021 at 02:03:55PM +0800, Liu Yinsi wrote:
add x86_64 and riscv64 qemu command and options.
test: /srv/result/host-info/2021-01-04/vm-2p8g/debian-sid-aarch64/z9.280125 /srv/result/host-info/2021-01-04/vm-2p8g/debian-sid-x86_64/z9.280114 /srv/result/host-info/2021-01-04/vm-2p8g/debian-sid-riscv64/z9.280135
Signed-off-by: Liu Yinsi liuyinsi@163.com
providers/qemu/kvm.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
diff --git a/providers/qemu/kvm.sh b/providers/qemu/kvm.sh index 0c98065..1018d06 100755 --- a/providers/qemu/kvm.sh +++ b/providers/qemu/kvm.sh @@ -25,6 +25,7 @@ qemu_command() { qemu=( qemu-system-aarch64
qemu-kvm )qemu-system-x86_64
@@ -74,6 +75,12 @@ check_option_value() }
[ -n "$initrds" ] || exit
- # debian has both qemu-system-x86_64 and qemu-system-riscv64 command
- [[ $kernel =~ 'riscv64' ]] && qemu=qemu-system-riscv64
- ls $bios >/dev/null 2>&1 || bios=/usr/share/ovmf/OVMF.fd
- ls $helper >/dev/null 2>&1 || helper=/usr/lib/qemu/qemu-bridge-helper
maybe can add the follow two function: get_bios() get_helper()
-------- Thanks Yu Chuan
}
get_initrd() @@ -122,6 +129,17 @@ individual_option() -bios $bios -nic $nic )
- x86_64=(
-bios $bios
-nic $nic
- )
- riscv64=(
-machine virt
-device virtio-net-device,netdev=net0,mac=${mac}
-netdev bridge,br=br0,id=net0,helper=${helper}
- )
}
run_qemu() @@ -132,6 +150,13 @@ run_qemu() ;; qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}")
[ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-x86_64)
kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-riscv64)
esackvm=("${kvm[@]}" "${riscv64[@]}") ;;
-- 2.23.0
- ls $bios >/dev/null 2>&1 || bios=/usr/share/ovmf/OVMF.fd
- ls $helper >/dev/null 2>&1 || helper=/usr/lib/qemu/qemu-bridge-helper
maybe can add the follow two function: get_bios() get_helper()
good
Thanks, Yinsi
Thanks Yu Chuan
}
get_initrd() @@ -122,6 +129,17 @@ individual_option() -bios $bios -nic $nic )
- x86_64=(
-bios $bios
-nic $nic
- )
- riscv64=(
-machine virt
-device virtio-net-device,netdev=net0,mac=${mac}
-netdev bridge,br=br0,id=net0,helper=${helper}
- )
}
run_qemu() @@ -132,6 +150,13 @@ run_qemu() ;; qemu-kvm) [ "$(arch)" == "aarch64" ] && kvm=("${kvm[@]}" "${aarch64[@]}")
[ "$(arch)" == "x86_64" ] && kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-x86_64)
kvm=("${kvm[@]}" "${x86_64[@]}")
;;
qemu-system-riscv64)
esackvm=("${kvm[@]}" "${riscv64[@]}") ;;
-- 2.23.0