forked from Mirror/pmbootstrap
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:
parent
496d1b657d
commit
d7b12d98e6
4 changed files with 11 additions and 7 deletions
|
@ -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",
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue