Product Build
更新时间: 2024/12/27
在Gitcode上查看源码

  • Each component of openUBMC has its own build code and repository. The manifest repository integrates all code involved for the build. A main component is started to parse dependencies using the built-in resolution logic of Conan, and then concurrent build is performed based on the dependency logic.
  • The manifest repository is used as the main entry point for the build, and all build capabilities are integrated into the bingo command for convenient use.

Build Command Overview

  • The following is the help document of bingo. This help document in the manifest repository path (product path) is different from that in the component repository path. During product build, you only need to focus on the behavior in the manifest repository.
shell
# Run the following command in the manifest path:
[04:51:58 root(1110):/home/workspace/codehome/manifest]# bingo --help
Integrated commands
    build              Build the package.
    publish            Build the version release package. Use -sc to specify the ToSupportE code and -z  to specify the ToGPD production equipment code.
    qemu               Create a simulation environment and run the built product package.
    fetch              Pull full code based on component versions specified by parameters.
Misc commands
    help               Get command help.

Enter "bingo <command>" -h to get subcommand help.
[04:52:01 root(1110):/home/workspace/codehome/manifest]#
  • The returned information shows the commands available. Only one of the commands is used to build products and release packages. Currently, the build command has the same effect as publish.
shell
[04:52:01 root(1110):/home/workspace/codehome/manifest]# bingo build --help
Building the BMC.

options:
  -h, --help            show this help message and exit
  -b BOARD_NAME, --board_name BOARD_NAME
                        Board package. The value can be a directory name in build/product/.../.
  -bt BUILD_TYPE, --build_type BUILD_TYPE
                        Build type. The options are debug (debug package), release (official release package), and dt (developer test package).
  --stage STAGE         Package type. The options are dev (debugging package), rc (pre-release package), and stable (release package).
                        Default value: dev
  --verbose             Enables detailed log printing for Conan build.
  -ucc, --update_conan_cache
                        Fully update the local Conan cache.
  -r REMOTE, --remote REMOTE
                        Alias of the Conan repository. Check the configured Conan repository in the Conan remote list.
                        Default value: openUBMC_dev
  -sc SUPPORTE_CODE, --supporte_code SUPPORTE_CODE
                        SupportE code to be released. For details about the options, see manifest.yml/tosupporte of the board.
                        Default value: default
  -q, --enable_qemu     Enables QEMU packaging.
  -qi, --qemu_in        Enables QEMU and automatically starts the QEMU environment.
  -as, --asan           Enables the address sanitizer.
  -v VERSION, --version VERSION
                        Build version number. If this parameter is not specified, the version number is read from manifest.yml.
  -t TARGET, --target TARGET
                        Build target. For details, see the build/target directory. The following targets are supported:
                        personal
                        publish
[04:59:33 root(1110):/home/workspace/codehome/manifest]#

1. Product Package Build Commands

  1. Building an HPM package directly

    • Start building an HPM package. Review the help information above to understand its specific meaning. After the command finishes, the built HPM package can be found in the output directory under the manifest directory.

      shell
      # Enter the integrated build environment.
      cd manifest
      # -t personal: Build target. Personal build refers to the HPM package.
      # -b openUBMC: Board name. You can view the supported boards in the help document.
      # -bt release: Build type, which is a official release package.
      # --stage rc: Package type, which is a pre-release package.
      bingo build -t personal -b openUBMC -bt release --stage rc
    • The following lists the files in the generated file directory. rootfs_openUBMC.hpm is the product package.

      shell
      [05:22:48 root(1110):/home/workspace/codehome/manifest/output]# ls -la
       total 70172
       -rw-r--r--  1 root root     1349 Mar 12 17:22 openubmc.perf
       -rw-r--r--  1 root root    54813 Mar 12 17:22 package.lock
       drwxr-xr-x  5 root root     4096 Mar  7 14:32 packet
       -rw-r--r--  1 root root        0 Mar 12 17:20 prof.perf.lock
       -rw-r--r--  2 root root 70144173 Mar 12 17:22 rootfs_openUBMC.hpm
      [05:23:04 root(1110):/home/workspace/codehome/manifest/output]#
  2. Scenario for integrating released components: After a component is released, its version needs to be integrated into the product package. The modification method is as follows:

    • Add the new component to its corresponding type category within the subsys directory. Because subsys separates rc and stable types, you must update both directories simultaneously. The following example demonstrates the rc version. For the stable version, replace the suffix with stable.

      yaml
      # yaml-language-server: $schema=../../schema/subsys.rc.schema.json
      dependencies:
        - conan: "rackmount/1.20.97@openUBMC.release/rc"
        - conan: "Kunpeng/1.10.2@openUBMC.release/rc"
    • Configure the added component in the manifest.yml file. Newly introduced components must be configured with dependencies in the product directory. Otherwise, the components will not be integrated into the product package. In the dependencies field, each configured component is integrated. Do not fill in the version number. If the version number is included, multiple files will need to be modified when the component version is updated.

      yaml
      dependencies:
        - conan: "huawei_secure_c"
        - conan: "kmc"
        - conan: "Signature_Verify_CBB_Library"
        - conan: "sqlite3"
        - conan: "openssh"

2. Release Package Build Commands

  • Release package build commands are slightly different from the preceding commands, as shown in the following:

    shell
    # Enter the integrated build environment.
    cd manifest
    # -t publish: Build target, which is a release package.
    # -sc default: Release package code, which can be found in the tosupporte field in the manifest.yml file.
    # -b openUBMC: Board name. You can view the supported boards in the help document.
    # -bt release: Build type, which is a official release package.
    # --stage stable: Package type, which is a release package.
    bingo build -t publish -sc default -b openUBMC -bt release --stage stable
  • After the execution is complete, files are generated in the output directory. The following shows the tree structure of the output directory (for reference only).

    shell
    [07:05:30 root(1110):/home/workspace/codehome/manifest/output]# tree
    .
    |-- openUBMC.perf
    |-- package.lock
    |-- packet
    |   |-- openUBMC
    |   |   |-- openUBMC-CMT_1.00.00.00.zip
    |   `-- inner
    |       |-- release
    |       |   |-- package_openUBMC.lock
    |-- prof.perf.lock
    `-- rootfs_openUBMC.hpm
    
    4 directories, 6 files
    [07:05:31 root(1110):/home/workspace/codehome/manifest/output]#