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