forked from Mirror/pmbootstrap
pmb.qemu: remove QEMU mesa driver setup question (!1886)
mesa-dri-swrast and mesa-dri-virtio are both provided by mesa-dri-gallium now, so this option does not have much use anymore. With both selections, exactly the same packages are installed.
This commit is contained in:
parent
cb1f68817f
commit
320b2faa4c
7 changed files with 2 additions and 58 deletions
|
@ -39,8 +39,7 @@ required_programs = ["git", "openssl", "ps"]
|
|||
# Keys saved in the config file (mostly what we ask in 'pmbootstrap init')
|
||||
config_keys = ["ccache_size", "device", "extra_packages", "hostname", "jobs",
|
||||
"kernel", "keymap", "nonfree_firmware", "nonfree_userland",
|
||||
"qemu_native_mesa_driver", "ssh_keys", "timezone", "ui", "user",
|
||||
"work", "aports"]
|
||||
"ssh_keys", "timezone", "ui", "user", "work", "aports"]
|
||||
|
||||
# Config file/commandline default values
|
||||
# $WORK gets replaced with the actual value for args.work (which may be
|
||||
|
@ -70,7 +69,6 @@ defaults = {
|
|||
"nonfree_firmware": True,
|
||||
"nonfree_userland": False,
|
||||
"port_distccd": "33632",
|
||||
"qemu_native_mesa_driver": "dri-virtio",
|
||||
"ssh_keys": False,
|
||||
"timezone": "GMT",
|
||||
"ui": "weston",
|
||||
|
@ -458,11 +456,6 @@ aportgen = {
|
|||
}
|
||||
}
|
||||
|
||||
#
|
||||
# QEMU
|
||||
#
|
||||
qemu_native_mesa_drivers = ["dri-swrast", "dri-virtio"]
|
||||
|
||||
#
|
||||
# NEWAPKBUILD
|
||||
# Options passed through to the "newapkbuild" command from Alpine Linux. They
|
||||
|
|
|
@ -284,26 +284,6 @@ def ask_for_device(args):
|
|||
return (device, device_exists, kernel, nonfree)
|
||||
|
||||
|
||||
def ask_for_qemu_native_mesa_driver(args, device, arch_native):
|
||||
# Native QEMU device selected? (e.g. qemu-amd64 on x86_64)
|
||||
if not pmb.parse.arch.qemu_check_device(device, arch_native):
|
||||
return None
|
||||
|
||||
drivers = pmb.config.qemu_native_mesa_drivers
|
||||
logging.info("Which mesa driver do you prefer for your native QEMU device?"
|
||||
" Only select something other than the default if you are"
|
||||
" having graphical problems (such as glitches).")
|
||||
while True:
|
||||
ret = pmb.helpers.cli.ask(args, "Mesa driver", drivers,
|
||||
args.qemu_native_mesa_driver, True,
|
||||
complete=drivers)
|
||||
if ret in drivers:
|
||||
return ret
|
||||
logging.fatal("ERROR: Please specify a driver from the list. To change"
|
||||
" it, see qemu_native_mesa_drivers in"
|
||||
" pmb/config/__init__.py.")
|
||||
|
||||
|
||||
def ask_for_build_options(args, cfg):
|
||||
# Allow to skip build options
|
||||
logging.info("Build options: Parallel jobs: " + args.jobs +
|
||||
|
@ -376,12 +356,6 @@ def frontend(args):
|
|||
cfg["pmbootstrap"]["nonfree_firmware"] = str(nonfree["firmware"])
|
||||
cfg["pmbootstrap"]["nonfree_userland"] = str(nonfree["userland"])
|
||||
|
||||
# QEMU mesa driver
|
||||
if cfg["pmbootstrap"]["device"].startswith("qemu-"):
|
||||
driver = ask_for_qemu_native_mesa_driver(args, device, args.arch_native)
|
||||
if driver:
|
||||
cfg["pmbootstrap"]["qemu_native_mesa_driver"] = driver
|
||||
|
||||
# Device keymap
|
||||
if device_exists:
|
||||
cfg["pmbootstrap"]["keymap"] = ask_for_keymaps(args, device)
|
||||
|
|
|
@ -513,8 +513,6 @@ def install(args):
|
|||
install_packages += args.extra_packages.split(",")
|
||||
if args.add:
|
||||
install_packages += args.add.split(",")
|
||||
if args.device.startswith("qemu-"):
|
||||
install_packages += ["mesa-" + args.qemu_native_mesa_driver]
|
||||
for pkgname in install_packages:
|
||||
pmb.build.package(args, pkgname, args.deviceinfo["arch"])
|
||||
|
||||
|
|
|
@ -152,16 +152,3 @@ def qemu_to_pmos_device(arch):
|
|||
|
||||
raise ValueError("Can not map QEMU value '" + arch + "'"
|
||||
" to the right postmarketOS device")
|
||||
|
||||
|
||||
def qemu_check_device(device, arch):
|
||||
"""
|
||||
Check whether a device has a specific architecture.
|
||||
|
||||
Examples:
|
||||
qemu_check_device("qemu-amd64", "x86_64") is True
|
||||
qemu_check_device("qemu-vexpress", "armel") is True
|
||||
qemu_check_device("qemu-vexpress", "aarch64") is False
|
||||
"""
|
||||
arch_qemu = uname_to_qemu(arch)
|
||||
return device == qemu_to_pmos_device(arch_qemu)
|
||||
|
|
|
@ -177,7 +177,7 @@ def command_qemu(args, arch, device, img_path):
|
|||
logging.info("WARNING: QEMU is not using KVM and will run slower!")
|
||||
|
||||
# 2D acceleration support via virtio
|
||||
if native and args.qemu_native_mesa_driver == "dri-virtio":
|
||||
if native:
|
||||
command += ["-vga", "virtio"]
|
||||
command += ["-display", args.qemu_display]
|
||||
|
||||
|
|
|
@ -84,7 +84,6 @@ class QEMU(object):
|
|||
pmbootstrap_run(args, config, ["config", "extra_packages", "none"])
|
||||
pmbootstrap_run(args, config, ["config", "user", "testuser"])
|
||||
pmbootstrap_run(args, config, ["config", "ui", ui])
|
||||
pmbootstrap_run(args, config, ["config", "qemu_native_mesa_driver", "dri-swrast"])
|
||||
|
||||
# Prepare native chroot
|
||||
pmbootstrap_run(args, config, ["-y", "zap"])
|
||||
|
|
|
@ -213,13 +213,6 @@ def test_questions_keymaps(args, monkeypatch):
|
|||
assert func(args, "lg-mako") == ""
|
||||
|
||||
|
||||
def test_questions_qemu_native_mesa(args, monkeypatch):
|
||||
func = pmb.config.init.ask_for_qemu_native_mesa_driver
|
||||
fake_answers(monkeypatch, ["invalid_driver", "dri-swrast"])
|
||||
assert func(args, "qemu-amd64", "x86_64") == "dri-swrast"
|
||||
assert func(args, "qemu-aarch64", "x86_64") is None
|
||||
|
||||
|
||||
def test_questions_ui(args, monkeypatch):
|
||||
fake_answers(monkeypatch, ["invalid_UI", "weston"])
|
||||
assert pmb.config.init.ask_for_ui(args) == "weston"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue