diff --git a/src/oebuild/app/plugins/bitbake/bitbake.py b/src/oebuild/app/plugins/bitbake/bitbake.py index 7a35c5327121da9c7def21a23555338ca2c97c9b..6d55155bda0003ed2bde13776d7daf4ef074808e 100644 --- a/src/oebuild/app/plugins/bitbake/bitbake.py +++ b/src/oebuild/app/plugins/bitbake/bitbake.py @@ -97,10 +97,11 @@ class Bitbake(OebuildCommand): yocto_dir = os.path.join(self.configure.source_dir(), "yocto-meta-openeuler") manifest_path = os.path.join(yocto_dir, ".oebuild/manifest.yaml") - oebuild_util.download_repo_from_manifest( - repo_list=compile_param.repos, - src_dir=self.configure.source_dir(), - manifest_path=manifest_path) + if compile_param.no_layer is None or compile_param.no_layer is not True: + oebuild_util.download_repo_from_manifest( + repo_list=compile_param.repos, + src_dir=self.configure.source_dir(), + manifest_path=manifest_path) parse_env = ParseEnv(env_dir='.env') if compile_param.build_in == oebuild_const.BUILD_IN_HOST: diff --git a/src/oebuild/app/plugins/bitbake/in_container.py b/src/oebuild/app/plugins/bitbake/in_container.py index abf26593619803d6eb375035c0946fe554871a4f..eecbbe41fa5f57ba4d5d67301d2dd640e1dc893f 100644 --- a/src/oebuild/app/plugins/bitbake/in_container.py +++ b/src/oebuild/app/plugins/bitbake/in_container.py @@ -70,7 +70,7 @@ class InContainer(BaseBuild): volumns.append(os.getcwd() + ':' + os.path.join(oebuild_const.CONTAINER_BUILD, os.path.basename(os.getcwd()))) if toolchain_dir is not None: - volumns.append(toolchain_dir + ":" + oebuild_const.NATIVE_GCC_DIR) + volumns.append(toolchain_dir + ":" + oebuild_const.NATIVE_GCC_MAP) if sstate_mirrors is not None: volumns.append(sstate_mirrors + ":" + oebuild_const.SSTATE_MIRRORS) diff --git a/src/oebuild/app/plugins/generate/generate.py b/src/oebuild/app/plugins/generate/generate.py index 9a2691866cc925f46e0a3be69f720ad7e87d10f3..e21c8d72a1112836f685ec6f468661f1216dbd3b 100644 --- a/src/oebuild/app/plugins/generate/generate.py +++ b/src/oebuild/app/plugins/generate/generate.py @@ -57,6 +57,7 @@ class Generate(OebuildCommand): self.toolchain_dir = None self.llvm_toolchain_dir = None self.sstate_mirrors = None + self.sstate_dir = None self.tmp_dir = None self.oebuild_kconfig_path = os.path.expanduser( '~') + '/.local/oebuild_kconfig/' @@ -145,6 +146,9 @@ class Generate(OebuildCommand): if args.sstate_mirrors is not None: self.sstate_mirrors = args.sstate_mirrors + if args.sstate_dir is not None: + self.sstate_dir = args.sstate_dir + if args.tmp_dir is not None: self.tmp_dir = args.tmp_dir @@ -200,6 +204,7 @@ class Generate(OebuildCommand): param['llvm_toolchain_dir'] = self.llvm_toolchain_dir param['build_in'] = args.build_in param['sstate_mirrors'] = self.sstate_mirrors + param['sstate_dir'] = self.sstate_dir param['tmp_dir'] = self.tmp_dir param['datetime'] = args.datetime param['no_fetch'] = args.no_fetch @@ -633,14 +638,14 @@ endif config COMMON_SSTATE-MIRRORS string "sstate_mirrors (this param is for SSTATE_MIRRORS)" default "None" - depends on IMAGE && BUILD_IN-HOST + depends on IMAGE """) # add sstate_dir common_str += (""" config COMMON_SSTATE-DIR string "sstate_dir (this param is for SSTATE_DIR)" default "None" - depends on IMAGE && BUILD_IN-HOST + depends on IMAGE """) # add tmp_dir common_str += (""" diff --git a/src/oebuild/const.py b/src/oebuild/const.py index 851756239ad196247b17dfda02fa967333a1b35a..88125720f6c4b362ac023364340b6954202222ca 100644 --- a/src/oebuild/const.py +++ b/src/oebuild/const.py @@ -33,9 +33,10 @@ SSTATE_MIRRORS = "SSTATE_MIRRORS" SSTATE_DIR = "SSTATE_DIR" TMP_DIR = "TMPDIR" -NATIVE_GCC_DIR = '/usr1/openeuler/native_gcc' -NATIVE_LLVM_DIR = '/usr1/openeuler/native_llvm' -SSTATE_MIRRORS = '/usr1/openeuler/sstate-cache' +NATIVE_GCC_MAP = '/usr1/openeuler/native_gcc' +NATIVE_LLVM_MAP = '/usr1/openeuler/native_llvm' +SSTATE_MIRRORS_MAP = '/usr1/openeuler/sstate-mirrors' +SSTATE_DIR_MAP = '/usr1/openeuler/sstate-dir' EXTERNAL_LLVM = "EXTERNAL_TOOLCHAIN_LLVM" EXTERNAL_GCC = "EXTERNAL_TOOLCHAIN_GCC" diff --git a/src/oebuild/local_conf.py b/src/oebuild/local_conf.py index d6b4bb4131bcd56c1ea75e6753220134f955b302..a17c0dde0915318e56886ceeb76391bb6585e492 100644 --- a/src/oebuild/local_conf.py +++ b/src/oebuild/local_conf.py @@ -129,7 +129,7 @@ class LocalConf: if compile_param.build_in == oebuild_const.BUILD_IN_DOCKER: # check if exists TXTERNAL_TOOLCHAIN_GCC, replace it or replace TXTERNAL_TOOLCHAIN replace_toolchain_str = f''' -{oebuild_const.EXTERNAL_LLVM} = "{oebuild_const.NATIVE_LLVM_DIR}"''' +{oebuild_const.EXTERNAL_LLVM} = "{oebuild_const.NATIVE_LLVM_MAP}"''' else: replace_toolchain_str = f''' {oebuild_const.EXTERNAL_LLVM} = "{compile_param.llvm_toolchain_dir}"''' @@ -152,7 +152,7 @@ class LocalConf: new_str = f"file://.* {compile_param.sstate_mirrors}/PATH;downloadfilename=PATH" else: if compile_param.build_in == oebuild_const.BUILD_IN_DOCKER: - new_str = f"file://.* file://{oebuild_const.SSTATE_MIRRORS}/PATH" + new_str = f"file://.* file://{oebuild_const.SSTATE_MIRRORS_MAP}/PATH" else: new_str = f"file://.* file://{compile_param.sstate_mirrors}/PATH" pre_content += f'{oebuild_const.SSTATE_MIRRORS} = "{new_str}"\n' @@ -181,10 +181,10 @@ class LocalConf: oebuild_const.EXTERNAL, oebuild_const.EXTERNAL_GCC) replace_toolchain_str = f''' -{toolchain_type} = "{oebuild_const.NATIVE_GCC_DIR}"''' +{toolchain_type} = "{oebuild_const.NATIVE_GCC_MAP}"''' else: replace_toolchain_str = f''' -{compile_param.toolchain_type} = "{oebuild_const.NATIVE_GCC_DIR}"''' +{compile_param.toolchain_type} = "{oebuild_const.NATIVE_GCC_MAP}"''' else: if len(re.findall(f'^({oebuild_const.EXTERNAL_GCC})*', self.content)) > 0: toolchain_type = compile_param.toolchain_type.replace( diff --git a/src/oebuild/parse_param.py b/src/oebuild/parse_param.py index feae9e81ed440966a17d6593255e3c3d32b25d2d..8d6b384a94b5ac0928b95d4a1a7d9012822f73b2 100644 --- a/src/oebuild/parse_param.py +++ b/src/oebuild/parse_param.py @@ -116,6 +116,7 @@ class ParseCompileParam: build_in: str machine: str toolchain_type: str + no_layer: Optional[bool] repos: Optional[list] layers: Optional[list] local_conf: Optional[LiteralScalarString] @@ -158,6 +159,7 @@ class ParseCompileParam: oebuild_const.BUILD_IN_DOCKER), machine=get_value_from_dict('machine', compile_param_dict, None), toolchain_type=get_value_from_dict('toolchain_type', compile_param_dict, None), + no_layer=get_value_from_dict('no_layer', compile_param_dict, None), toolchain_dir=get_value_from_dict('toolchain_dir', compile_param_dict, None), llvm_toolchain_dir=get_value_from_dict('llvm_toolchain_dir', compile_param_dict, None), nativesdk_dir=get_value_from_dict('nativesdk_dir', compile_param_dict, None), @@ -179,6 +181,8 @@ class ParseCompileParam: compile_obj['build_in'] = compile_param.build_in compile_obj['machine'] = compile_param.machine compile_obj['toolchain_type'] = compile_param.toolchain_type + if compile_param.no_layer is not None: + compile_obj['no_layer'] = compile_param.no_layer if compile_param.toolchain_dir is not None: compile_obj['toolchain_dir'] = compile_param.toolchain_dir if compile_param.llvm_toolchain_dir is not None: diff --git a/src/oebuild/parse_template.py b/src/oebuild/parse_template.py index 0f4a4e8d0f5dc472887d1e34e337e22c0ea1ca88..7f4cd1893d62f15cfc6d0e1aed3a84c5d819b2af 100644 --- a/src/oebuild/parse_template.py +++ b/src/oebuild/parse_template.py @@ -189,6 +189,7 @@ class ParseTemplate: llvm_toolchain_dir=None build_in: str = oebuild_const.BUILD_IN_DOCKER, sstate_mirrors=None, + sstate_dir=None, tmp_dir=None, datetime=None, no_fetch=False, @@ -250,7 +251,8 @@ class ParseTemplate: "compile_dir": param['compile_dir'], "toolchain_dir": param['toolchain_dir'], "llvm_toolchain_dir": param['llvm_toolchain_dir'], - "sstate_mirrors": param['sstate_mirrors'] + "sstate_mirrors": param['sstate_mirrors'], + "sstate_dir": param['sstate_dir'] } ) @@ -265,6 +267,8 @@ class ParseTemplate: compile_conf['llvm_toolchain_dir'] = param['llvm_toolchain_dir'] if param['sstate_mirrors'] is not None: compile_conf['sstate_mirrors'] = param['sstate_mirrors'] + if param['sstate_dir'] is not None: + compile_conf['sstate_dir'] = param['sstate_dir'] if param['tmp_dir'] is not None: compile_conf['tmp_dir'] = param['tmp_dir'] return compile_conf @@ -293,6 +297,7 @@ def get_docker_param_dict(docker_image, dir_list): toolchain_dir llvm_toolchain_dir sstate_mirrors + sstate_dir ''' parameters = oebuild_const.DEFAULT_CONTAINER_PARAMS volumns = [] @@ -303,11 +308,13 @@ def get_docker_param_dict(docker_image, dir_list): volumns.append(dir_list['compile_dir'] + ":" + os.path.join( oebuild_const.CONTAINER_BUILD, os.path.basename(dir_list['compile_dir']))) if dir_list['toolchain_dir'] is not None: - volumns.append(dir_list['toolchain_dir'] + ":" + oebuild_const.NATIVE_GCC_DIR) + volumns.append(dir_list['toolchain_dir'] + ":" + oebuild_const.NATIVE_GCC_MAP) if dir_list['llvm_toolchain_dir'] is not None: - volumns.append(dir_list['llvm_toolchain_dir'] + ":" + oebuild_const.NATIVE_LLVM_DIR) + volumns.append(dir_list['llvm_toolchain_dir'] + ":" + oebuild_const.NATIVE_LLVM_MAP) if dir_list['sstate_mirrors'] is not None: volumns.append(dir_list['sstate_mirrors'] + ":" + oebuild_const.SSTATE_MIRRORS) + if dir_list['sstate_dir'] is not None: + volumns.append(dir_list['sstate_dir'] + ":" + oebuild_const.SSTATE_DIR) docker_param = {} docker_param['image'] = docker_image diff --git a/src/oebuild/struct.py b/src/oebuild/struct.py index 08e6cd84560c7def1575f96e5d43e901b36d3a02..e946934630016041274669baf21c933f44cc290d 100644 --- a/src/oebuild/struct.py +++ b/src/oebuild/struct.py @@ -70,6 +70,7 @@ class CompileParamComm: build_in: str machine: str toolchain_type: str + no_layer: Optional[bool] repos: Optional[list] layers: Optional[list] local_conf: Optional[LiteralScalarString]