-
Notifications
You must be signed in to change notification settings - Fork 29
/
test
executable file
·27 lines (24 loc) · 1.46 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
cd ../edk2
. ../edk2/edksetup.sh
#build -b DEBUG -p i915ovmfPkg/i915ovmf.dsc || exit
build -b RELEASE -p i915ovmfPkg/i915ovmf.dsc || exit
cd ../i915_simple
cp ../edk2/Build/i915ovmf/RELEASE_GCC5/X64/i915ovmf.rom ./ || exit
#cp ../edk2/Build/i915ovmf/DEBUG_GCC5/X64/i915ovmf.rom ./ || exit
if [ -e /sys/bus/pci/devices/0000:00:02.0/2aee154e-7d0d-11e8-88b8-6f45320c7162 ]
then
true
else
modprobe kvmgt || exit
#sudo dd if=/sys/class/drm/card0-HDMI-A-1/edid of=/sys/class/drm/card0/gvt_edid bs=128 count=1
echo 2aee154e-7d0d-11e8-88b8-6f45320c7162 > /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4/create || exit
fi
# Create an UEFI disk that immediately shuts down the VM when booted
mkdir -p tmpfat
mount disk tmpfat
mkdir -p tmpfat/EFI/BOOT
cp shutdown.efi tmpfat/EFI/BOOT/BOOTX64.EFI
umount tmpfat
rmdir tmpfat
qemu-system-x86_64 -k en-us -name uefitest,debug-threads=on -serial stdio -m 2048 -M pc -cpu host -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -machine kernel_irqchip=on -nodefaults -rtc base=localtime,driftfix=slew -no-hpet -global kvm-pit.lost_tick_policy=discard -enable-kvm -bios /home/hqm/gpdvm/bin/ovmf.fd -display gtk,gl=on,grab-on-hover=on -full-screen -vga none -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/2aee154e-7d0d-11e8-88b8-6f45320c7162,addr=02.0,display=on,x-igd-opregion=on,romfile=`pwd`/i915ovmf.rom -device qemu-xhci,p2=8,p3=8 -device usb-kbd -device usb-tablet -drive format=raw,file=disk