Skip to content

Commit

Permalink
Use kernel directory by default in runner
Browse files Browse the repository at this point in the history
  • Loading branch information
vmordan committed Oct 3, 2023
1 parent 96e946d commit 5dc5be1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions configs/bridge/runner.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"Builder": {
"cif": "<path to CIF>",
"version": "5.10.193",
"kernel dir": "<path to kernel dir>",
"work dir": "/ssd/build_base",
"cache ": "/ssd/build_base/build-base-linux-5.10.193-allmodconfig"
},
"Klever": {
"user": "admin",
Expand Down
8 changes: 4 additions & 4 deletions scripts/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
TAG_KLEVER = "Klever"
TAG_BUILDER = "Builder"
TAG_INSTALL_DIR = "install dir"
TAG_VERSION = "version"
TAG_KERNEL_DIR = "kernel dir"
TAG_CIF = "cif"
TAG_WORK_DIR = "work dir"
TAG_CACHE = "cache"
Expand Down Expand Up @@ -93,7 +93,7 @@ def __init__(self, general_config: dict):
builder_config = self.config[TAG_BUILDER]

# Builder config
self.linux_version = builder_config.get(TAG_VERSION, None)
self.kernel_dir = builder_config.get(TAG_KERNEL_DIR, None)
self.cif_path = self.__normalize_dir(builder_config.get(TAG_CIF, ""))
self.builder_work_dir = self.__normalize_dir(builder_config.get(TAG_WORK_DIR, ""))
self.build_base_cached = self.__normalize_dir(builder_config.get(TAG_CACHE, ""))
Expand Down Expand Up @@ -140,12 +140,12 @@ def builder(self) -> str:
return self.build_base_cached
self.logger.info("Preparing build base")
builder_script = os.path.join(self.klever_home_dir, BUILDER_SCRIPT)
cmd = f"{builder_script} --cif {self.cif_path} --version {self.linux_version} " \
cmd = f"{builder_script} --cif {self.cif_path} --kernel-dir {self.kernel_dir} " \
f"--workdir {self.builder_work_dir} --arch {self.arch} --make {self.make_cmd}"
if self.command_caller(cmd):
sys.exit("Cannot build Linux kernel")
build_base_dir = os.path.join(self.builder_work_dir,
f"build-base-linux-{self.linux_version}-{self.arch}-{self.make_cmd}")
f"build-base-{self.kernel_dir}-{self.arch}-{self.make_cmd}")
self.logger.info(f"Build base has been prepared in {build_base_dir}")
return build_base_dir

Expand Down

0 comments on commit 5dc5be1

Please sign in to comment.