diff --git a/src/oebuild/app/main.py b/src/oebuild/app/main.py index 60c4c0d0ceaba7b74193a8140bd98429cda74a54..9b1c4823f93686ca8c7c1c093d0cce5c8c5525ea 100644 --- a/src/oebuild/app/main.py +++ b/src/oebuild/app/main.py @@ -11,11 +11,7 @@ See the Mulan PSL v2 for more details. ''' import sys -import argparse import pathlib -import shutil -import textwrap -from io import StringIO from collections import OrderedDict import getpass diff --git a/src/oebuild/app/plugins/bitbake/bitbake.py b/src/oebuild/app/plugins/bitbake/bitbake.py index e9fc70703e217a92171d12ac37ccd9a427c1873c..2fb81900e5a124b97f9bd1381fde18232d797468 100644 --- a/src/oebuild/app/plugins/bitbake/bitbake.py +++ b/src/oebuild/app/plugins/bitbake/bitbake.py @@ -39,8 +39,10 @@ class Bitbake(OebuildCommand): 'bitbake', 'execute bitbake command', textwrap.dedent(''' - Bitbake instructions can enter the build interactive environment and then directly run bitbake-related instructions, - or run bitbake command directly, for example: `oebuild bitbake busybox` + The bitbake command performs the build operation, and for the build environment, + there are two types, one is to build in docker and the other is to build in the + host. There are also two construction methods, one is to build directly, and the + other is to call up the build environment to be operated freely by the user ''') ) diff --git a/src/oebuild/app/plugins/bitbake/in_container.py b/src/oebuild/app/plugins/bitbake/in_container.py index d497d7cab47ea196c7a9383221610cc9bf0d9f32..5fada89d9016f247afadbe347d0b69f1e68f07f5 100644 --- a/src/oebuild/app/plugins/bitbake/in_container.py +++ b/src/oebuild/app/plugins/bitbake/in_container.py @@ -51,7 +51,7 @@ class InContainer(BaseBuild): # check docker image if exists docker_proxy = DockerProxy() if not docker_proxy.is_image_exists(parse_compile.docker_image): - logger.error(f'''the docker image does not exists, please run fellow command: + logger.error('''the docker image does not exists, please run fellow command: `oebuild update docker`''') return @@ -107,8 +107,6 @@ class InContainer(BaseBuild): or env.container.short_id is None \ or not self.client.is_container_exists(env.container.short_id): # judge which container - config = self.configure.parse_oebuild_config() - container_config = config.docker container:Container = self.client.container_run_simple( image=docker_image, volumes=volumns) # type: ignore diff --git a/src/oebuild/app/plugins/bitbake/in_host.py b/src/oebuild/app/plugins/bitbake/in_host.py index 3041a51b843cc02490d1ac08a83d0c17e8eaf5d7..b467932ff2ce2bc456a1b02f1fe97e7a5ca4fb39 100644 --- a/src/oebuild/app/plugins/bitbake/in_host.py +++ b/src/oebuild/app/plugins/bitbake/in_host.py @@ -35,7 +35,7 @@ class InHost(BaseBuild): execute bitbake commands ''' self._init_build_sh(build_dir=os.getcwd()) - self.mk_build_sh(nativesdk_dir=parse_compile.nativesdk_dir, build_dir=os.getcwd()) + self._mk_build_sh(nativesdk_dir=parse_compile.nativesdk_dir, build_dir=os.getcwd()) self.init_bitbake() # add bblayers, this action must before replace local_conf @@ -99,15 +99,13 @@ initialization operations''') self.update_bashrc(new_content) pty.spawn("bash") - def mk_build_sh(self, nativesdk_dir, build_dir): - ''' - xxx - ''' + def _mk_build_sh(self, nativesdk_dir, build_dir): init_sdk_command = f'. {nativesdk_dir}/environment-setup-x86_64-pokysdk-linux' set_template = f'export TEMPLATECONF="{self.configure.source_dir()}/yocto-meta-openeuler/.oebuild"' init_oe_command = f'. {self.configure.source_dir()}/yocto-poky/oe-init-build-env {build_dir}' + ps1_command = 'PS1="\\u\\h:\\W> "' - self._append_build_sh(str_list= [init_sdk_command, set_template, init_oe_command], + self._append_build_sh(str_list= [init_sdk_command, set_template, init_oe_command, ps1_command], build_dir=build_dir) def _init_build_sh(self, build_dir): diff --git a/src/oebuild/app/plugins/generate/generate.py b/src/oebuild/app/plugins/generate/generate.py index bea902b65be10b86746405e994d299c1cacf7e69..a148df7b78928cad4885815c1582374fbcd0f6ba 100644 --- a/src/oebuild/app/plugins/generate/generate.py +++ b/src/oebuild/app/plugins/generate/generate.py @@ -39,7 +39,12 @@ class Generate(OebuildCommand): 'generate', 'help to mkdir build directory and generate compile.yaml', textwrap.dedent('''\ - compile.yaml is generated according to different command parameters by generate + The generate command is the core command in the entire build process, which + is mainly used to customize the build configuration parameters and generate + a compile.yaml by customizing each parameter. In addition, for a large number + of configuration parameter input is not very convenient, generate provides a + way to specify compile.yaml, users can directly specify the file after + customizing the build configuration file ''' )) @@ -242,7 +247,7 @@ class Generate(OebuildCommand): If the system does not recognize which container image to use, select the following container, enter it numerically, and enter q to exit:''') image_list = check_docker_tag.get_tags() - + for key,value in enumerate(image_list): print(f"{key}, {oebuild_config.docker.repo_url}:{value}") k = input("please entry number:") diff --git a/src/oebuild/app/plugins/init/init.py b/src/oebuild/app/plugins/init/init.py index c71bb79bae5ef6a03b43bb2c49cc3864db1d05ef..602a629aa39ffbea0145d0d011311609225101cc 100644 --- a/src/oebuild/app/plugins/init/init.py +++ b/src/oebuild/app/plugins/init/init.py @@ -37,8 +37,17 @@ class Init(OebuildCommand): 'init', 'Initialize an OEBUILD working directory', textwrap.dedent('''\ - Initialize an OEBUILD working directory, and execute - all other OEbuild instructions in the initialized directory + Initialize the OEbuild working directory, and after executing this command, + a new directory will be created as the OEBUILD working directory based on the + current path. After initialization, the working directory will create an .oebuild + directory, which stores configuration-related files, currently the directory has + config and compile.yaml.sample two files, config files record environment-related + parameters, mainly the main build warehouse yocto-meta-openeuler related information + and build container related information, compile.yaml.sample is an example file of + the build configuration file, users can copy the file to other places and then make + certain changes according to their own needs。 This file is to meet the user's global + consideration of the build configuration of OEbuild, and can be easily called by third + parties ''' )) diff --git a/src/oebuild/app/plugins/update/update.py b/src/oebuild/app/plugins/update/update.py index 82eae1d8e5f59df5be567e618648c331cf2837c7..84409a3883f80e01c14c4fd94664d8a283c6493b 100644 --- a/src/oebuild/app/plugins/update/update.py +++ b/src/oebuild/app/plugins/update/update.py @@ -41,8 +41,22 @@ class Update(OebuildCommand): 'update', 'Update the basic environment required for the build', textwrap.dedent(''' - Update the base environment required at build time, such as - updating the necessary docker images and yocto-meta-openeuler repositories + The update command will involve three areas, namely the build container, + yocto-meta-openeuler and the corresponding layers, if there are no parameters + after the update, it will be updated in order yocto-meta-openeuler, build + container and layers, the update of these three places is related, the update + of the build container will be affected by three factors, first, execute the + tag parameter, The container image related to the tag is updated, the second + identifies the build container image bound to the main build repository, in + yocto-meta-openeuler/.oebuild/env.yaml, the third identifies the branch + information of the main build repository, and identifies the type of build image + through the branch information of the main build repository. The layer update must + rely on yocto-meta-openeuler, if the main build repository does not exist will first + download the main build repository (the relevant git information is in .oebuild/config), + the layers update execution logic is different in different directories, if not in + the build directory will be parsed yocto-meta-openeuler/.oebuild/ common.yaml to get + the information that needs to be updated, and if it is in the build directory, it will + parse compile.yaml to get the updated information ''') ) diff --git a/src/oebuild/version.py b/src/oebuild/version.py index d705e18486ec6c342aa62aa5c142fe5ff79bc4c7..1c5b7cdcd3ff320ef8adef7f642ce021b261d95f 100644 --- a/src/oebuild/version.py +++ b/src/oebuild/version.py @@ -10,4 +10,4 @@ MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details. ''' -__version__ = '0.0.26' +__version__ = '0.0.27'