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:
Minecrell 2020-03-05 21:52:28 +01:00 committed by Oliver Smith
parent cb1f68817f
commit 320b2faa4c
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
7 changed files with 2 additions and 58 deletions

View file

@ -39,8 +39,7 @@ required_programs = ["git", "openssl", "ps"]
# Keys saved in the config file (mostly what we ask in 'pmbootstrap init') # Keys saved in the config file (mostly what we ask in 'pmbootstrap init')
config_keys = ["ccache_size", "device", "extra_packages", "hostname", "jobs", config_keys = ["ccache_size", "device", "extra_packages", "hostname", "jobs",
"kernel", "keymap", "nonfree_firmware", "nonfree_userland", "kernel", "keymap", "nonfree_firmware", "nonfree_userland",
"qemu_native_mesa_driver", "ssh_keys", "timezone", "ui", "user", "ssh_keys", "timezone", "ui", "user", "work", "aports"]
"work", "aports"]
# Config file/commandline default values # Config file/commandline default values
# $WORK gets replaced with the actual value for args.work (which may be # $WORK gets replaced with the actual value for args.work (which may be
@ -70,7 +69,6 @@ defaults = {
"nonfree_firmware": True, "nonfree_firmware": True,
"nonfree_userland": False, "nonfree_userland": False,
"port_distccd": "33632", "port_distccd": "33632",
"qemu_native_mesa_driver": "dri-virtio",
"ssh_keys": False, "ssh_keys": False,
"timezone": "GMT", "timezone": "GMT",
"ui": "weston", "ui": "weston",
@ -458,11 +456,6 @@ aportgen = {
} }
} }
#
# QEMU
#
qemu_native_mesa_drivers = ["dri-swrast", "dri-virtio"]
# #
# NEWAPKBUILD # NEWAPKBUILD
# Options passed through to the "newapkbuild" command from Alpine Linux. They # Options passed through to the "newapkbuild" command from Alpine Linux. They

View file

@ -284,26 +284,6 @@ def ask_for_device(args):
return (device, device_exists, kernel, nonfree) 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): def ask_for_build_options(args, cfg):
# Allow to skip build options # Allow to skip build options
logging.info("Build options: Parallel jobs: " + args.jobs + 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_firmware"] = str(nonfree["firmware"])
cfg["pmbootstrap"]["nonfree_userland"] = str(nonfree["userland"]) 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 # Device keymap
if device_exists: if device_exists:
cfg["pmbootstrap"]["keymap"] = ask_for_keymaps(args, device) cfg["pmbootstrap"]["keymap"] = ask_for_keymaps(args, device)

View file

@ -513,8 +513,6 @@ def install(args):
install_packages += args.extra_packages.split(",") install_packages += args.extra_packages.split(",")
if args.add: if args.add:
install_packages += args.add.split(",") install_packages += args.add.split(",")
if args.device.startswith("qemu-"):
install_packages += ["mesa-" + args.qemu_native_mesa_driver]
for pkgname in install_packages: for pkgname in install_packages:
pmb.build.package(args, pkgname, args.deviceinfo["arch"]) pmb.build.package(args, pkgname, args.deviceinfo["arch"])

View file

@ -152,16 +152,3 @@ def qemu_to_pmos_device(arch):
raise ValueError("Can not map QEMU value '" + arch + "'" raise ValueError("Can not map QEMU value '" + arch + "'"
" to the right postmarketOS device") " 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)

View file

@ -177,7 +177,7 @@ def command_qemu(args, arch, device, img_path):
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 virtio # 2D acceleration support via virtio
if native and args.qemu_native_mesa_driver == "dri-virtio": if native:
command += ["-vga", "virtio"] command += ["-vga", "virtio"]
command += ["-display", args.qemu_display] command += ["-display", args.qemu_display]

View file

@ -84,7 +84,6 @@ class QEMU(object):
pmbootstrap_run(args, config, ["config", "extra_packages", "none"]) pmbootstrap_run(args, config, ["config", "extra_packages", "none"])
pmbootstrap_run(args, config, ["config", "user", "testuser"]) pmbootstrap_run(args, config, ["config", "user", "testuser"])
pmbootstrap_run(args, config, ["config", "ui", ui]) pmbootstrap_run(args, config, ["config", "ui", ui])
pmbootstrap_run(args, config, ["config", "qemu_native_mesa_driver", "dri-swrast"])
# Prepare native chroot # Prepare native chroot
pmbootstrap_run(args, config, ["-y", "zap"]) pmbootstrap_run(args, config, ["-y", "zap"])

View file

@ -213,13 +213,6 @@ def test_questions_keymaps(args, monkeypatch):
assert func(args, "lg-mako") == "" 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): def test_questions_ui(args, monkeypatch):
fake_answers(monkeypatch, ["invalid_UI", "weston"]) fake_answers(monkeypatch, ["invalid_UI", "weston"])
assert pmb.config.init.ask_for_ui(args) == "weston" assert pmb.config.init.ask_for_ui(args) == "weston"