Skip to content

Commit

Permalink
fix: update defconfig and ucodename definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
seppzer0 committed May 27, 2024
1 parent 01915f4 commit 60d5f84
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
24 changes: 20 additions & 4 deletions builder/core/kernel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,33 @@ def write_localversion() -> None:

@property
def _ucodename(self) -> str:
return "dumplinger" if self.codename in ("dumpling", "cheeseburger") else self.codename
"""Unified codename for devices series with identical kernels."""
if self.codename in ("dumpling", "cheeseburger"):
return "dumplinger"
elif "guacamole" in self.codename:
return "guacamoles"
else:
return self.codename

@property
def _defconfig(self) -> Path:
defconfigs = {
"""Define defconfig."""
# list the defconfigs used
op7_defconfigs = {
"los": "lineage_sm8150_defconfig",
}
op5_defconfigs = {
"los": "lineage_oneplus5_defconfig",
"pa": "vendor/paranoid_defconfig" if self.lkv == "4.14" else "paranoid_defconfig",
"x": "msm8998_oneplus_android_defconfig" if self.lkv == "4.14" else "oneplus5_defconfig"
}
# convert whatever output to path object
return Path(defconfigs[self.base])
# convert output to path object
if "guacamole" in self.codename:
return Path(op7_defconfigs[self.base])
elif self.codename in ("dumpling", "cheeseburger"):
return Path(op5_defconfigs[self.base])
else:
return Path()

def clean_build(self) -> None:
print("\n", end="")
Expand Down
6 changes: 5 additions & 1 deletion tests/unit/builder/core/test_kernel_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
(
{"codename": "dumpling", "base": "x", "lkv": "4.4", "clean_kernel": True, "ksu": True},
Path("oneplus5_defconfig")
)
),
(
{"codename": "guacamoleb", "base": "los", "lkv": "4.14", "clean_kernel": True, "ksu": False},
Path("lineage_sm8150_defconfig")
),
)
)
def test__defconfig__check(config: dict[str, str], expected_defconfig: Path) -> None:
Expand Down

0 comments on commit 60d5f84

Please sign in to comment.