1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

pmb: Rename pmb:gpu-accel and deviceinfo_gpu_accelerated

pmb:gpu-accel -> pmb:drm
deviceinfo_gpu_accelerated -> deviceinfo_drm

Allow deviceinfo_gpu_accelerated as deprecated property

Keep pmb:gpu-accel as valid option to avoid failures for older branches
of pmaports.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/merge_requests/2591
This commit is contained in:
Anri Dellal 2025-04-23 20:43:36 +03:00 committed by Stefan Hansson
parent 496d1b657d
commit d7b12d98e6
No known key found for this signature in database
GPG key ID: ACD854892B38D898
4 changed files with 11 additions and 7 deletions

View file

@ -302,7 +302,8 @@ apkbuild_custom_valid_options = [
"!pmb:kconfigcheck", "!pmb:kconfigcheck",
"pmb:cross-native", "pmb:cross-native",
"pmb:cross-native2", "pmb:cross-native2",
"pmb:gpu-accel", "pmb:drm",
"pmb:gpu-accel", # deprecated
"pmb:strict", "pmb:strict",
"pmb:systemd", "pmb:systemd",
"pmb:systemd-never", "pmb:systemd-never",

View file

@ -229,12 +229,13 @@ def ask_for_channel(config: Config) -> str:
def ask_for_ui(deviceinfo: Deviceinfo) -> str: def ask_for_ui(deviceinfo: Deviceinfo) -> str:
ui_list = pmb.helpers.ui.list_ui(deviceinfo.arch) ui_list = pmb.helpers.ui.list_ui(deviceinfo.arch)
hidden_ui_count = 0 hidden_ui_count = 0
device_is_accelerated = deviceinfo.gpu_accelerated == "true" if not deviceinfo.drm == "true":
if not device_is_accelerated:
for i in reversed(range(len(ui_list))): for i in reversed(range(len(ui_list))):
pkgname = f"postmarketos-ui-{ui_list[i][0]}" pkgname = f"postmarketos-ui-{ui_list[i][0]}"
apkbuild = pmb.helpers.pmaports.get(pkgname, subpackages=False, must_exist=False) apkbuild = pmb.helpers.pmaports.get(pkgname, subpackages=False, must_exist=False)
if apkbuild and "pmb:gpu-accel" in apkbuild["options"]: if apkbuild and (
"pmb:drm" in apkbuild["options"] or "pmb:gpu-accel" in apkbuild["options"]
):
ui_list.pop(i) ui_list.pop(i)
hidden_ui_count += 1 hidden_ui_count += 1
@ -251,7 +252,7 @@ def ask_for_ui(deviceinfo: Deviceinfo) -> str:
if hidden_ui_count > 0: if hidden_ui_count > 0:
logging.info( logging.info(
f"NOTE: {hidden_ui_count} UIs are hidden because" f"NOTE: {hidden_ui_count} UIs are hidden because"
' "deviceinfo_gpu_accelerated" is not set (see' ' "deviceinfo_drm" is not set (see'
" https://postmarketos.org/deviceinfo)." " https://postmarketos.org/deviceinfo)."
) )
while True: while True:

View file

@ -23,7 +23,7 @@ import pmb.helpers.pmaports
def get_custom_valid_options() -> list[str]: def get_custom_valid_options() -> list[str]:
"""Build a list of custom valid APKBUILD options that apkbuild-lint should """Build a list of custom valid APKBUILD options that apkbuild-lint should
not complain about. The list consists of hardcoded options from not complain about. The list consists of hardcoded options from
pmb.config.apkbuild_custom_valid_options like pmb:gpu-accel, as well as pmb.config.apkbuild_custom_valid_options like pmb:drm, as well as
dynamically generated options from kconfigcheck.toml dynamically generated options from kconfigcheck.toml
(pmb:kconfigcheck-libcamera etc.).""" (pmb:kconfigcheck-libcamera etc.)."""
ret = list(pmb.config.apkbuild_custom_valid_options) ret = list(pmb.config.apkbuild_custom_valid_options)

View file

@ -110,7 +110,7 @@ class Deviceinfo:
chassis: str chassis: str
keyboard: str | None = "" # deprecated keyboard: str | None = "" # deprecated
external_storage: str | None = "" external_storage: str | None = ""
gpu_accelerated: bool | None = False drm: bool | None = False
dev_touchscreen: str | None = "" dev_touchscreen: str | None = ""
dev_touchscreen_calibration: str | None = "" dev_touchscreen_calibration: str | None = ""
append_dtb: str | None = "" append_dtb: str | None = ""
@ -279,6 +279,8 @@ class Deviceinfo:
# logging.warning(f"deviceinfo: {key} is not a known attribute") # logging.warning(f"deviceinfo: {key} is not a known attribute")
if key == "arch": if key == "arch":
setattr(self, key, Arch.from_str(value)) setattr(self, key, Arch.from_str(value))
elif key == "gpu_accelerated": # deprecated
setattr(self, "drm", value)
else: else:
setattr(self, key, value) setattr(self, key, value)