Long-Term Supported Versions

    Container Build Guide

    The openEuler Embedded build process is based on the openEuler OS, and requires many system tools and build tools to be installed. To help developers quickly set up a build environment, the operating system and tools on which the build process depends are encapsulated into a container. In this way, developers can avoid the time-consuming environment preparation process and focus on development.

    Environment Preparation

    Use Docker to create a container environment. The software and hardware requirements of Docker are as follows:

    • OS: openEuler 20.03/22.03, Ubuntu 20.04/22.04, Debian 11, and SUSE 12.05 are recommended.
    • Kernel: Linux 3.8 or later is recommended.
    • Driver: The kernel must include a proper storage driver, for example, Device Mapper, AUFS, vfs, btrfs, or ZFS.
    • Architecture: 64-bit architecture (x86_64 or AMD64).

    Installing Docker


    1. Check whether Docker has been installed in the current environment.

    Run the following command. If the Docker version is displayed, Docker has been installed in the current environment. You can use it directly.

    docker version
    
    1. If Docker is not installed, install it by referring to the official document.

    Install Docker on openEuler by referring to the installation guide for CentOS.

    For example, run the following command to install Docker on openEuler:

    sudo yum install docker
    

    Obtaining the Container Image


    Run the docker pull command to pull the image from Huawei Cloud to the host machine:

    docker pull swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container:lastest
    

    Preparing the Container Build Environment


    1. Start a container.

    Run the docker run command to start the container. To ensure that the container can run in the background and access the Internet after being started, you are advised to run the following command to start the container:

    docker run -idt --network host swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container:lastest bash
    

    Parameter description:

    • -i: keeps the standard input open.
    • -d: starts a container in daemon mode in the background.
    • -t: allocates a pseudo-tty and binds it to the standard input of the container.
    • --network: connects the container to the network of the host machine.
    • swr.cn-north-4.myhuaweicloud.com/openeuler-embedded/openeuler-container:lastest (image_name:image_version)
    • bash: method for accessing a container.

    2. Check the ID of the started container.

    docker ps
    

    3. Enter the container.

    docker exec -it <container_id> bash
    

    After the build environment is ready, you can build in the container.

    Version Build

    Downloading Source Code

    1. Obtain the source code download script.
    git clone https://gitee.com/openeuler/yocto-meta-openeuler.git -b openEuler-22.03-LTS -v /usr1/openeuler/src/yocto-meta-openeuler
    
    1. Download the source code using the script.
    cd /usr1/openeuler/src/yocto-meta-openeuler/scripts
    sh download_code.sh /usr1/openeuler/src
    

    Compiling the build

    • Compilation architecture: aarch64-std, aarch64-pro, arm-std or raspberrypi4-64
    • Build directory: /usr1/build
    • Source code directory: /usr1/openeuler/src
    • Path of the compiler: /usr1/openeuler/gcc/openeuler_gcc_arm64le

    NOTE

    • Use different compilers for different compilation architectures. aarch64-std, aarch64-pro, and raspberrypi4-64 use the openeuler_gcc_arm64le compiler, and arm-std uses the openeuler_gcc_arm32le compiler.
    • The following uses the aarch64-std architecture as an example.
    1. Change the owner group of the /usr1 directory to openeuler. Otherwise, permission issues may occur when switching to the openeuler user.
    chown -R openeuler:users /usr1
    
    1. Switch to the openeuler user.
    su openeuler
    
    1. Go to the path where the compilation script is stored and run the script.
    cd /usr1/openeuler/src/yocto-meta-openeuler/scripts
    source compile.sh aarch64-std /usr1/build /usr1/openeuler/gcc/openeuler_gcc_arm64le
    bitbake openeuler-image
    

    Build Result

    By default, the files are generated in the output directory of the build directory. For example, the built files of the aarch64-std example are generated in the /usr1/build/output directory, as shown in the following table:

    FilenameDescription
    Image-*openEuler Embedded image
    openeuler-glibc-x86_64-openeuler-image-*-toolchain-**.shopenEuler Embedded SDK toolchain
    openeuler-image-qemu-aarch64-*.rootfs.cpio.gzopenEuler Embedded file system
    zImageopenEuler Embedded compressed image

    Bug Catching

    Buggy Content

    Bug Description

    Submit As Issue

    It's a little complicated....

    I'd like to ask someone.

    PR

    Just a small problem.

    I can fix it online!

    Bug Type
    Specifications and Common Mistakes

    ● Misspellings or punctuation mistakes;

    ● Incorrect links, empty cells, or wrong formats;

    ● Chinese characters in English context;

    ● Minor inconsistencies between the UI and descriptions;

    ● Low writing fluency that does not affect understanding;

    ● Incorrect version numbers, including software package names and version numbers on the UI.

    Usability

    ● Incorrect or missing key steps;

    ● Missing prerequisites or precautions;

    ● Ambiguous figures, tables, or texts;

    ● Unclear logic, such as missing classifications, items, and steps.

    Correctness

    ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

    ● Incorrect schematic or architecture diagrams;

    ● Incorrect commands or command parameters;

    ● Incorrect code;

    ● Commands inconsistent with the functions;

    ● Wrong screenshots.

    Risk Warnings

    ● Lack of risk warnings for operations that may damage the system or important data.

    Content Compliance

    ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

    ● Copyright infringement.

    How satisfied are you with this document

    Not satisfied at all
    Very satisfied
    Submit
    Click to create an issue. An issue template will be automatically generated based on your feedback.
    Bug Catching
    编组 3备份