Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ x86_64) vm_pkgs="qemu-base edk2-ovmf" ;;
aarch64)
vm_fw=edk2-aarch64
pacman -Si "$vm_fw" >/dev/null 2>&1 || pacman -Qi "$vm_fw" >/dev/null 2>&1 || vm_fw=qemu-system-arm-firmware
vm_pkgs="qemu-base qemu-system-aarch64 $vm_fw"
# The ARM virt machine has no VGA, so machines get a virtio-gpu display, which qemu-base leaves out.
# The -pci package needs the base one but does not depend on it, and without it QEMU crashes when libvirt probes it.
vm_pkgs="qemu-base qemu-system-aarch64 $vm_fw qemu-hw-display-virtio-gpu qemu-hw-display-virtio-gpu-pci"
;;
*) die "My Own Data Center needs a 64-bit Intel, AMD or ARM computer; this one is $arch." ;;
esac
Expand Down
2 changes: 1 addition & 1 deletion omarchyd/machines.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ function domainXml(m, kvm, uuid = '') {
${nic}
<serial type='pty'/><console type='pty'/>
<graphics type='vnc' socket='${xml(join(dir, 'vnc.sock'))}'/>
<video><model type='${arm && layout.video !== 'none' ? 'virtio' : layout.video}'/></video>${o.tablet === false ? '' : "\n <input type='tablet' bus='usb'/>"}${o.agent ? "\n <channel type='unix'><target type='virtio' name='org.qemu.guest_agent.0'/></channel>" : ''}
<video><model type='${arm && layout.video !== 'none' ? 'virtio' : layout.video}'/></video>${arm && (o.tablet !== false || m.usbDevices?.length) ? "\n <controller type='usb' model='qemu-xhci'/>" : ''}${o.tablet === false ? '' : "\n <input type='tablet' bus='usb'/>"}${o.agent ? "\n <channel type='unix'><target type='virtio' name='org.qemu.guest_agent.0'/></channel>" : ''}
<rng model='virtio'><backend model='random'>/dev/urandom</backend></rng>
${(m.usbDevices ?? []).map((d) => hostdevXml(d)).join('\n ')}${m.nixos ? `\n ${nixosConfigFilesystemXml(configDir(dataDir, m.id))}` : ''}
</devices>
Expand Down
4 changes: 2 additions & 2 deletions test/install-arch.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ test('x86-64 installs exactly the packages it always has', {skip}, async () => {
})

test('aarch64 (Omarchy on an M1 Mac) is accepted and gets the ARM QEMU and firmware', {skip}, async () => {
assert.equal(await pick('aarch64', true), 'PKGS qemu-base qemu-system-aarch64 edk2-aarch64')
assert.equal(await pick('aarch64', true), 'PKGS qemu-base qemu-system-aarch64 edk2-aarch64 qemu-hw-display-virtio-gpu qemu-hw-display-virtio-gpu-pci')
// Arch Linux ARM names the same firmware qemu-system-arm-firmware.
assert.equal(await pick('aarch64', false), 'PKGS qemu-base qemu-system-aarch64 qemu-system-arm-firmware')
assert.equal(await pick('aarch64', false), 'PKGS qemu-base qemu-system-aarch64 qemu-system-arm-firmware qemu-hw-display-virtio-gpu qemu-hw-display-virtio-gpu-pci')
})

test('other processors are refused with a clear message', {skip}, async () => {
Expand Down
3 changes: 3 additions & 0 deletions test/machines.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ describe('omarchyd machines', () => {
assert.match(seen.xml, /<backend type='passt'\/>/)
assert.match(seen.xml, /<graphics type='vnc' socket='[^']+vnc\.sock'\/>/)
assert.match(seen.xml, /<domain type='kvm'>/)
assert.doesNotMatch(seen.xml, /qemu-xhci/, 'q35 brings its own USB controller')
assert.match(seen.xml, /<channel type='unix'><target type='virtio' name='org.qemu.guest_agent.0'\/>/)
assert.match(seen.userData, /qemu-guest-agent/)
assert.match(seen.userData, /python3/)
Expand Down Expand Up @@ -1689,6 +1690,8 @@ test('on an ARM server (Omarchy on Apple Silicon) a machine is an aarch64 "virt"
assert.match(xml, /<controller type='scsi' model='virtio-scsi'><driver iothread='1'\/><\/controller>/)
assert.match(xml, /device='cdrom'><driver name='qemu' type='raw'\/>/)
assert.match(xml, /<video><model type='virtio'\/><\/video>/)
// The virt machine has no USB controller of its own, and the tablet needs one: without it libvirt refuses with "USB is disabled for this domain".
assert.match(xml, /<controller type='usb' model='qemu-xhci'\/>\n <input type='tablet' bus='usb'\/>/)
// The catalog query keeps both architectures. The form filters to the host.
const images = await machines.procedures['machines.osImages'].run()
assert.ok(images.some((i) => i.arch === 'arm64' && i.id === 'ubuntu-24.04-server-arm64'))
Expand Down
Loading