Skip to content

Instantly share code, notes, and snippets.

@oleduc
Last active January 12, 2024 12:32
Show Gist options
  • Save oleduc/a467ec52870f67166ff3383f3aa63ebd to your computer and use it in GitHub Desktop.
Save oleduc/a467ec52870f67166ff3383f3aa63ebd to your computer and use it in GitHub Desktop.
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_1.bin'/>
</qemu:commandline>
</domain>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<uuid>YOUR-HARDWARE-UUID</uuid>
...
<sysinfo type='smbios'>
<bios>
<entry name='vendor'>....</entry>
...
</bios>
<system>
...
<entry name='uuid'>YOUR-HARDWARE-UUID</entry>
...
</system>
...
</sysinfo>
<os>
...
<smbios mode='sysinfo'/>
</os>
<devices>
...
<disk type='block' device='disk'>
...
<source dev='/dev/disk/by-id/YOUR-DISK-HARDWARE-ID'/>
<serial>YOUR-DISK-HARDWARE-SERIAL</serial>
...
</disk>
</devices>
<seclabel type='dynamic' model='dac' relabel='yes'/>
<qemu:commandline>
...
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_1.bin'/>
....
</qemu:commandline>
</domain>
#!/bin/bash
set -e
cat /sys/firmware/acpi/tables/SLIC > slic.bin
cat /sys/firmware/acpi/tables/MSDM > msdm.bin
dmidecode -t 0 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_0.bin
dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment