add static supported machines file
Same rationale as the CPU flags file, avoids calling QEMU binary just to query machine types. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
2413972b46
commit
a6ede89808
21
debian/parse-machines.pl
vendored
Executable file
21
debian/parse-machines.pl
vendored
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use warnings;
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
my @machines = ();
|
||||||
|
|
||||||
|
while (<STDIN>) {
|
||||||
|
if (/^\s*Supported machines are:/) {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
s/^\s+//;
|
||||||
|
my @machine = split(/\s+/);
|
||||||
|
next if $machine[0] !~ m/^pc-(i440fx|q35)/;
|
||||||
|
push @machines, $machine[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
die "no QEMU machine types detected from STDIN input" if scalar (@machines) <= 0;
|
||||||
|
|
||||||
|
print join("\n", @machines) or die "$!\n";
|
4
debian/rules
vendored
4
debian/rules
vendored
@ -22,6 +22,7 @@ PACKAGE=pve-qemu-kvm
|
|||||||
destdir := $(CURDIR)/debian/$(PACKAGE)
|
destdir := $(CURDIR)/debian/$(PACKAGE)
|
||||||
|
|
||||||
flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64
|
flagfile := $(destdir)/usr/share/kvm/recognized-CPUID-flags-x86_64
|
||||||
|
machinefile := $(destdir)/usr/share/kvm/machine-versions-x86_64
|
||||||
|
|
||||||
# default QEMU out-of-tree build directory is ./build
|
# default QEMU out-of-tree build directory is ./build
|
||||||
BUILDDIR=build
|
BUILDDIR=build
|
||||||
@ -124,7 +125,7 @@ install: build
|
|||||||
rm $(destdir)/usr/share/kvm/qemu_vga.ndrv
|
rm $(destdir)/usr/share/kvm/qemu_vga.ndrv
|
||||||
rm $(destdir)/usr/share/kvm/slof.bin
|
rm $(destdir)/usr/share/kvm/slof.bin
|
||||||
rm $(destdir)/usr/share/kvm/u-boot.e500
|
rm $(destdir)/usr/share/kvm/u-boot.e500
|
||||||
# remove Aplha files
|
# remove Alpha files
|
||||||
rm $(destdir)/usr/share/kvm/palcode-clipper
|
rm $(destdir)/usr/share/kvm/palcode-clipper
|
||||||
# remove RISC-V files
|
# remove RISC-V files
|
||||||
rm $(destdir)/usr/share/kvm/opensbi-riscv32-generic-fw_dynamic.elf
|
rm $(destdir)/usr/share/kvm/opensbi-riscv32-generic-fw_dynamic.elf
|
||||||
@ -138,6 +139,7 @@ install: build
|
|||||||
|
|
||||||
# CPU flags are static for QEMU version, allows avoiding more costly checks
|
# CPU flags are static for QEMU version, allows avoiding more costly checks
|
||||||
$(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile)
|
$(destdir)/usr/bin/qemu-system-x86_64 -cpu help | ./debian/parse-cpu-flags.pl > $(flagfile)
|
||||||
|
$(destdir)/usr/bin/qemu-system-x86_64 -machine help | ./debian/parse-machines.pl > $(machinefile)
|
||||||
|
|
||||||
# Build architecture-independent files here.
|
# Build architecture-independent files here.
|
||||||
binary-indep: build install
|
binary-indep: build install
|
||||||
|
Loading…
Reference in New Issue
Block a user