-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
executable file
·40 lines (30 loc) · 916 Bytes
/
run.py
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
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python3
# pylint: disable=missing-docstring
import os
import subprocess
def run(*cmd):
print(' '.join(cmd))
subprocess.run(cmd, check=True)
def main():
run('rustc', '+nightly', '--version')
run('cargo', '+nightly', 'build')
efi_partition = 'efi_partition'
qemu = 'qemu-system-x86_64'
ovmf = 'ovmf.fd'
build_target = 'x86_64-unknown-uefi'
build_mode = 'debug'
efi_app = os.path.join('target', build_target, build_mode,
'uefi-div-bug.efi')
run('cp', efi_app, os.path.join(efi_partition, 'EFI/BOOT/BOOTX64.EFI'))
# yapf: disable
run(
qemu,
'-enable-kvm',
'-display', 'none',
'-serial', 'stdio',
'-drive', 'if=pflash,format=raw,readonly,file=' + ovmf,
'-drive', 'format=raw,file=fat:rw:' + efi_partition,
)
# yapf: enable
if __name__ == '__main__':
main()