Fix case sensitivity: Qemu => QEMU (!1800)
This commit is contained in:
parent
fd79a60383
commit
2ad8b66ccc
|
@ -106,7 +106,7 @@ Update existing installation on SD card:
|
||||||
$ pmbootstrap install --sdcard=/dev/mmcblk0 --rsync
|
$ pmbootstrap install --sdcard=/dev/mmcblk0 --rsync
|
||||||
```
|
```
|
||||||
|
|
||||||
Run the image in Qemu:
|
Run the image in QEMU:
|
||||||
```
|
```
|
||||||
$ pmbootstrap qemu --image-size=1G
|
$ pmbootstrap qemu --image-size=1G
|
||||||
```
|
```
|
||||||
|
|
|
@ -92,7 +92,7 @@ def init(args, suffix="native"):
|
||||||
"s/^ERROR_CLEANUP=.*/ERROR_CLEANUP=''/",
|
"s/^ERROR_CLEANUP=.*/ERROR_CLEANUP=''/",
|
||||||
"/etc/abuild.conf"], suffix)
|
"/etc/abuild.conf"], suffix)
|
||||||
|
|
||||||
# Qemu workaround (aarch64 only)
|
# QEMU workaround (aarch64 only)
|
||||||
arch = pmb.parse.arch.from_chroot_suffix(args, suffix)
|
arch = pmb.parse.arch.from_chroot_suffix(args, suffix)
|
||||||
emulate = pmb.parse.arch.cpu_emulation_required(args, arch)
|
emulate = pmb.parse.arch.cpu_emulation_required(args, arch)
|
||||||
if emulate and arch == "aarch64":
|
if emulate and arch == "aarch64":
|
||||||
|
|
|
@ -22,7 +22,7 @@ import pmb.chroot.apk
|
||||||
|
|
||||||
def qemu_workaround_aarch64(args, suffix="buildroot_aarch64"):
|
def qemu_workaround_aarch64(args, suffix="buildroot_aarch64"):
|
||||||
"""
|
"""
|
||||||
Qemu has a bug in aarch64 emulation, that causes abuild-tar to omit files
|
QEMU has a bug in aarch64 emulation, that causes abuild-tar to omit files
|
||||||
from the archives it generates in some cases. We build a patched abuild-tar,
|
from the archives it generates in some cases. We build a patched abuild-tar,
|
||||||
which avoids the bug.
|
which avoids the bug.
|
||||||
|
|
||||||
|
|
|
@ -248,12 +248,12 @@ def ask_for_device(args):
|
||||||
|
|
||||||
|
|
||||||
def ask_for_qemu_native_mesa_driver(args, device, arch_native):
|
def ask_for_qemu_native_mesa_driver(args, device, arch_native):
|
||||||
# Native Qemu device selected? (e.g. qemu-amd64 on x86_64)
|
# Native QEMU device selected? (e.g. qemu-amd64 on x86_64)
|
||||||
if not pmb.parse.arch.qemu_check_device(device, arch_native):
|
if not pmb.parse.arch.qemu_check_device(device, arch_native):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
drivers = pmb.config.qemu_native_mesa_drivers
|
drivers = pmb.config.qemu_native_mesa_drivers
|
||||||
logging.info("Which mesa driver do you prefer for your native Qemu device?"
|
logging.info("Which mesa driver do you prefer for your native QEMU device?"
|
||||||
" Only select something other than the default if you are"
|
" Only select something other than the default if you are"
|
||||||
" having graphical problems (such as glitches).")
|
" having graphical problems (such as glitches).")
|
||||||
while True:
|
while True:
|
||||||
|
@ -333,7 +333,7 @@ def frontend(args):
|
||||||
cfg["pmbootstrap"]["nonfree_firmware"] = str(nonfree["firmware"])
|
cfg["pmbootstrap"]["nonfree_firmware"] = str(nonfree["firmware"])
|
||||||
cfg["pmbootstrap"]["nonfree_userland"] = str(nonfree["userland"])
|
cfg["pmbootstrap"]["nonfree_userland"] = str(nonfree["userland"])
|
||||||
|
|
||||||
# Qemu mesa driver
|
# QEMU mesa driver
|
||||||
if cfg["pmbootstrap"]["device"].startswith("qemu-"):
|
if cfg["pmbootstrap"]["device"].startswith("qemu-"):
|
||||||
driver = ask_for_qemu_native_mesa_driver(args, device, args.arch_native)
|
driver = ask_for_qemu_native_mesa_driver(args, device, args.arch_native)
|
||||||
if driver:
|
if driver:
|
||||||
|
|
|
@ -144,7 +144,7 @@ def arguments_qemu(subparser):
|
||||||
help="use SPICE for 2D acceleration (default port:"
|
help="use SPICE for 2D acceleration (default port:"
|
||||||
" 8077)")
|
" 8077)")
|
||||||
display.add_argument("--display", dest="qemu_display", const="sdl,gl=on",
|
display.add_argument("--display", dest="qemu_display", const="sdl,gl=on",
|
||||||
help="Qemu's display parameter (default: sdl,gl=on)",
|
help="QEMU's display parameter (default: sdl,gl=on)",
|
||||||
default="sdl,gl=on", nargs="?")
|
default="sdl,gl=on", nargs="?")
|
||||||
|
|
||||||
ret.add_argument("--host-qemu", dest="host_qemu", action='store_true',
|
ret.add_argument("--host-qemu", dest="host_qemu", action='store_true',
|
||||||
|
|
|
@ -223,7 +223,7 @@ def command_qemu(args, arch, device, img_path, spice_enabled):
|
||||||
if native and os.path.exists("/dev/kvm"):
|
if native and os.path.exists("/dev/kvm"):
|
||||||
command += ["-enable-kvm"]
|
command += ["-enable-kvm"]
|
||||||
else:
|
else:
|
||||||
logging.info("WARNING: Qemu is not using KVM and will run slower!")
|
logging.info("WARNING: QEMU is not using KVM and will run slower!")
|
||||||
|
|
||||||
# 2D acceleration support via QXL/SPICE or virtio
|
# 2D acceleration support via QXL/SPICE or virtio
|
||||||
if spice_enabled:
|
if spice_enabled:
|
||||||
|
@ -278,7 +278,7 @@ def resize_image(args, img_size_new, img_path):
|
||||||
|
|
||||||
def sigterm_handler(number, frame):
|
def sigterm_handler(number, frame):
|
||||||
raise RuntimeError("pmbootstrap was terminated by another process,"
|
raise RuntimeError("pmbootstrap was terminated by another process,"
|
||||||
" and killed the Qemu VM it was running.")
|
" and killed the QEMU VM it was running.")
|
||||||
|
|
||||||
|
|
||||||
def install_depends(args, arch):
|
def install_depends(args, arch):
|
||||||
|
@ -306,12 +306,12 @@ def run(args):
|
||||||
install_depends(args, arch)
|
install_depends(args, arch)
|
||||||
logging.info("Running postmarketOS in QEMU VM (" + arch + ")")
|
logging.info("Running postmarketOS in QEMU VM (" + arch + ")")
|
||||||
|
|
||||||
# Get the Qemu and spice commands
|
# Get the QEMU and spice commands
|
||||||
spice = command_spice(args)
|
spice = command_spice(args)
|
||||||
spice_enabled = True if spice else False
|
spice_enabled = True if spice else False
|
||||||
qemu, env = command_qemu(args, arch, device, img_path, spice_enabled)
|
qemu, env = command_qemu(args, arch, device, img_path, spice_enabled)
|
||||||
|
|
||||||
# Workaround: Qemu runs as local user and needs write permissions in the
|
# Workaround: QEMU runs as local user and needs write permissions in the
|
||||||
# rootfs, which is owned by root
|
# rootfs, which is owned by root
|
||||||
if not os.access(img_path, os.W_OK):
|
if not os.access(img_path, os.W_OK):
|
||||||
pmb.helpers.run.root(args, ["chmod", "666", img_path])
|
pmb.helpers.run.root(args, ["chmod", "666", img_path])
|
||||||
|
@ -329,7 +329,7 @@ def run(args):
|
||||||
logging.info("* (ssh) ssh -p {port} {user}@localhost".format(**vars(args)))
|
logging.info("* (ssh) ssh -p {port} {user}@localhost".format(**vars(args)))
|
||||||
logging.info("* (telnet) telnet localhost " + str(args.port + 1))
|
logging.info("* (telnet) telnet localhost " + str(args.port + 1))
|
||||||
|
|
||||||
# Run Qemu (or Qemu + SPICE) and kill it together with pmbootstrap
|
# Run QEMU (or QEMU + SPICE) and kill it together with pmbootstrap
|
||||||
process = None
|
process = None
|
||||||
try:
|
try:
|
||||||
signal.signal(signal.SIGTERM, sigterm_handler)
|
signal.signal(signal.SIGTERM, sigterm_handler)
|
||||||
|
|
|
@ -18,7 +18,7 @@ along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This file runs various installations and boots into them with Qemu, then checks
|
This file runs various installations and boots into them with QEMU, then checks
|
||||||
via SSH if expected processes are running.
|
via SSH if expected processes are running.
|
||||||
|
|
||||||
We use an extra config file (based on ~/.config/pmbootstrap.cfg), because we
|
We use an extra config file (based on ~/.config/pmbootstrap.cfg), because we
|
||||||
|
@ -83,7 +83,7 @@ def pmbootstrap_yes(args, config, parameters):
|
||||||
working_dir=pmb_src)
|
working_dir=pmb_src)
|
||||||
|
|
||||||
|
|
||||||
class Qemu(object):
|
class QEMU(object):
|
||||||
def __init__(self, request):
|
def __init__(self, request):
|
||||||
self.process = None
|
self.process = None
|
||||||
request.addfinalizer(self.terminate)
|
request.addfinalizer(self.terminate)
|
||||||
|
@ -92,7 +92,7 @@ class Qemu(object):
|
||||||
if self.process:
|
if self.process:
|
||||||
self.process.terminate()
|
self.process.terminate()
|
||||||
else:
|
else:
|
||||||
print("WARNING: The Qemu process wasn't set, so it could not be"
|
print("WARNING: The QEMU process wasn't set, so it could not be"
|
||||||
" terminated.")
|
" terminated.")
|
||||||
|
|
||||||
def run(self, args, tmpdir, ui="none"):
|
def run(self, args, tmpdir, ui="none"):
|
||||||
|
@ -119,12 +119,12 @@ class Qemu(object):
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def qemu(request):
|
def qemu(request):
|
||||||
return Qemu(request)
|
return QEMU(request)
|
||||||
|
|
||||||
|
|
||||||
def ssh_run(args, command):
|
def ssh_run(args, command):
|
||||||
"""
|
"""
|
||||||
Run a command in the Qemu VM on localhost via SSH.
|
Run a command in the QEMU VM on localhost via SSH.
|
||||||
|
|
||||||
:param command: flat string of the command to execute, e.g. "ps au"
|
:param command: flat string of the command to execute, e.g. "ps au"
|
||||||
:returns: the result from the SSH server
|
:returns: the result from the SSH server
|
||||||
|
|
Loading…
Reference in New Issue