diff options
Diffstat (limited to 'scripts/package-build/linux-kernel/build-jool.py')
-rwxr-xr-x | scripts/package-build/linux-kernel/build-jool.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/scripts/package-build/linux-kernel/build-jool.py b/scripts/package-build/linux-kernel/build-jool.py index e51301fc..570293f5 100755 --- a/scripts/package-build/linux-kernel/build-jool.py +++ b/scripts/package-build/linux-kernel/build-jool.py @@ -1,21 +1,14 @@ #!/usr/bin/env python3 -import toml - from tomllib import loads as toml_loads from requests import get from pathlib import Path from subprocess import run - -package: dict = toml.load("package.toml") - - def find_arch() -> str: tmp=run(['dpkg-architecture', '-q', 'DEB_HOST_ARCH'], capture_output=True) return tmp.stdout.decode().strip() - # dependency modifier def add_depends(package_dir: str, package_name: str, depends: list[str]) -> None: @@ -35,8 +28,10 @@ def add_depends(package_dir: str, package_name: str, # find kernel version and source path arch: str = find_arch() -KERNEL_VER: str = package.get('defaults').get('kernel_version') -KERNEL_FLAVOR: str = package.get('defaults').get('kernel_flavor') +defaults_file: str = Path('../../../data/defaults.toml').read_text() +architecture_file: str = Path(f'../../../data/architectures/{arch}.toml').read_text() +KERNEL_VER: str = toml_loads(defaults_file).get('kernel_version') +KERNEL_FLAVOR: str = toml_loads(architecture_file).get('kernel_flavor') KERNEL_SRC: str = Path.cwd().as_posix() + '/linux' # define variables |