@@ -80,7 +80,7 @@ def urlretrieve(url, filename, reporthook=None):
8080 "solaris" : "2.0.0" ,
8181 "omnios" : "2.0.3" ,
8282 "haiku" : "0.0.2" ,
83- "openindiana" : "2.0.0 "
83+ "openindiana" : "2.0.1 "
8484}
8585
8686VERSION_TOKEN_RE = re .compile (r"[0-9]+|[A-Za-z]+" )
@@ -2275,7 +2275,7 @@ def sync_scp(ssh_cmd, vhost, vguest, sshport, hostid_file, ssh_user):
22752275 "-o" , "StrictHostKeyChecking=no" ,
22762276 "-o" , "UserKnownHostsFile={}" .format (SSH_KNOWN_HOSTS_NULL ),
22772277 "-o" , "LogLevel=ERROR" ,
2278- ] + sources + ["{}@localhost :" .format (ssh_user ) + vguest + "/" ])
2278+ ] + sources + ["{}@127.0.0.1 :" .format (ssh_user ) + vguest + "/" ])
22792279
22802280 if subprocess .call (cmd ) != 0 :
22812281 log ("Warning: SCP sync failed." )
@@ -3023,7 +3023,10 @@ def find_image_link(releases, target_zst, target_xz):
30233023 if config ['nc' ]:
30243024 net_card = config ['nc' ]
30253025 else :
3026- net_card = "e1000"
3026+ if config ['arch' ] == "aarch64" :
3027+ net_card = "virtio-net-pci"
3028+ else :
3029+ net_card = "e1000"
30273030 if config ['os' ] == "openbsd" and config ['release' ]:
30283031 release_base = config ['release' ].split ('-' )[0 ]
30293032 if release_base in OPENBSD_E1000_RELEASES :
@@ -3075,20 +3078,28 @@ def find_image_link(releases, target_zst, target_xz):
30753078 accel = "kvm"
30763079 else :
30773080 log ("Warning: /dev/kvm exists but is not writable. Falling back to TCG." )
3078- elif platform .system () == "Darwin" and hvf_supported ():
3079- accel = "hvf"
3081+ elif platform .system () == "Darwin" :
3082+ # On Apple Silicon, HVF is available if we're on aarch64 host AND the system supports it
3083+ if host_arch == "aarch64" and hvf_supported ():
3084+ accel = "hvf"
3085+ else :
3086+ # Intel Mac trying to run aarch64 -> TCG, or HVF not supported
3087+ accel = "tcg"
30803088
30813089 if config ['cputype' ]:
30823090 cpu = config ['cputype' ]
30833091 else :
3084- cpu = "cortex-a72"
3085-
3086- if accel == "kvm" :
3087- cpu = "host"
3092+ if accel in ["kvm" , "hvf" ]:
3093+ cpu = "host"
3094+ elif config ['os' ] == "openbsd" :
3095+ # OpenBSD fails with "FP exception in kernel" on cpu=max
3096+ cpu = "neoverse-n1"
3097+ else :
3098+ cpu = "max"
30883099
3089- vga_type = config ['vga' ] if config ['vga' ] else "virtio-gpu"
3090- if vga_type == "virtio" :
3091- vga_type = "virtio-gpu"
3100+ vga_type = config ['vga' ] if config ['vga' ] else "virtio-gpu-pci "
3101+ if vga_type in [ "virtio" , "virtio-gpu" ] :
3102+ vga_type = "virtio-gpu-pci "
30923103
30933104 args_qemu .extend ([
30943105 "-machine" , "virt,accel={},gic-version=3,usb=on" .format (accel ),
@@ -3114,8 +3125,15 @@ def find_image_link(releases, target_zst, target_xz):
31143125 "-machine" , machine_opts ,
31153126 "-cpu" , cpu_opts ,
31163127 "-device" , "qemu-xhci" ,
3117- "-device" , "{},netdev=net0" .format (net_card ),
3118- "-kernel" , "/usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin" ,
3128+ "-device" , "{},netdev=net0" .format (net_card )
3129+ ])
3130+
3131+ uboot_bin = "/usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin"
3132+ if not os .path .exists (uboot_bin ):
3133+ fatal ("RISC-V u-boot binary not found at {}.\n Please install it: sudo apt-get install u-boot-qemu" .format (uboot_bin ))
3134+
3135+ args_qemu .extend ([
3136+ "-kernel" , uboot_bin ,
31193137 "-device" , "virtio-balloon-pci"
31203138 ])
31213139 else :
@@ -3229,7 +3247,11 @@ def find_image_link(releases, target_zst, target_xz):
32293247 disp = port - 5900
32303248 # Add audio support if the vnc driver is available
32313249 if check_qemu_audio_backend (qemu_bin , "vnc" ):
3232- args_qemu .extend (["-device" , "intel-hda" , "-device" , "hda-duplex" ])
3250+ if config ['arch' ] == "aarch64" :
3251+ # Use usb-audio on aarch64 to avoid intel-hda driver issues
3252+ args_qemu .extend (["-device" , "usb-audio,audiodev=vnc_audio" ])
3253+ else :
3254+ args_qemu .extend (["-device" , "intel-hda" , "-device" , "hda-duplex" ])
32333255 args_qemu .extend (["-audiodev" , "vnc,id=vnc_audio" ])
32343256 args_qemu .append ("-display" )
32353257 args_qemu .append ("vnc={}:{},audiodev=vnc_audio" .format (addr , disp ))
@@ -3358,7 +3380,7 @@ def fail_with_output(reason):
33583380
33593381 def build_ssh_host_config (host_aliases ):
33603382 host_spec = " " .join (str (x ) for x in host_aliases if x )
3361- host_block = "Host {}\n StrictHostKeyChecking no\n UserKnownHostsFile {}\n ConnectTimeout 10\n ConnectionAttempts 3\n User {}\n HostName localhost \n Port {}\n " .format (
3383+ host_block = "Host {}\n StrictHostKeyChecking no\n UserKnownHostsFile {}\n ConnectTimeout 10\n ConnectionAttempts 3\n User {}\n HostName 127.0.0.1 \n Port {}\n " .format (
33623384 host_spec ,
33633385 SSH_KNOWN_HOSTS_NULL ,
33643386 vm_user ,
@@ -3649,7 +3671,7 @@ def supports_ansi_color(stream):
36493671
36503672 ssh_base_cmd .extend ([
36513673 "-p" , str (config ['sshport' ]),
3652- "{}@localhost " .format (vm_user )
3674+ "{}@127.0.0.1 " .format (vm_user )
36533675 ])
36543676
36553677 boot_timeout_seconds = 600 # 10 minutes
0 commit comments