未验证 提交 48022866 编写于 作者: O openharmony_ci 提交者: Gitee

!23068 翻译完成 21506+22205+22030:修改hb安装的错误描述+修改显示格式问题+修改framwork路径

Merge pull request !23068 from ester.zhou/TR-21506
......@@ -19,6 +19,7 @@ You can use the Bootloader provided by the chipset vendor or open-source U-Boot
## Adaptation, Building, Burning, and Startup
1. Prepare the kernel configuration files, especially the chipset-related configuration files.
Source code directory of the configuration files: **kernel/linux/config/**
Create a **<*YOUR_CHIP*>_small_defconfig** file, such as **hi3516dv300_small_defconfig**, in the **linux-4.19/arch/arm/configs/** directory. The configuration file can be created by combining the general-purpose **small_common_defconfig** file and chipset-specific configurations.
......@@ -48,7 +49,7 @@ You can use the Bootloader provided by the chipset vendor or open-source U-Boot
The burning mode varies according to the development board of the chipset. Pay attention to the size of each burnt image and the configuration of the boot parameters. Below is the U-Boot parameter settings of Hi3516D V300:
```
setenv bootargs 'mem=128M console=ttyAMA0,115200 root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),50M(rootfs),50M(userfs)'
```
......@@ -65,16 +66,23 @@ Debug the **init** process, start shell, and run a simple program in the user sp
Based on the preceding process, the recommended verification procedure is as follows:
1. Create a root file system image.
Create a root file system image **rootfs.img** by following instructions in [Building Procedures](../subsystems/subsys-build-all.md). As shown in the preceding figure, the startup process is closely related to the product configuration. You need to complete the following configuration when creating **rootfs.img**:
- Component configuration
In the product component configuration file ***vendor*/{*company*}/{*product*}/config.json**, configure the **init** component of the startup subsystem and the **linux_4_1_9** component of the kernel subsystem.
- System service configuration
Modify the system service configuration file ***vendor*/{*company*}/{*product*}/init_configs/init_xxx.cfg** to start the shell service.
- File system configuration
In the file system configuration file ***vendor*/{*company*}/{*product*}/fs.yml**, create the **/bin/sh -> mksh** and **/lib/ld-musl-arm.so.1 -> libc.so** soft links. These two files are the shell executable program and the c library on which the executable program depends, respectively.
- Startup configuration
In the ***vendor*/{*company*}/{*product*}/init_configs/etc** directory, configure startup settings, including the **fstab**, **rsS**, and **S*xxx*** files. Configure the startup settings as needed.
After the build is complete, check the **rootfs** content in the product compilation output directory to determine whether the generated **rootfs.img** file meets the expectation.
......
......@@ -24,38 +24,38 @@ After learning the compilation framework and setting up the compilation environm
The directory structure is as follows: device/{*chipset solution vendor*}/{*development board*}. For example, if you are using the hispark_taurus development board from HiSilicon, create the following directory in the root directory of the code:
```
mkdir -p device/hisilicon/hispark_taurus
```
```
mkdir -p device/hisilicon/hispark_taurus
```
The chipset solution directory tree is as follows:
```
device
└── company # Chipset solution vendor
└── board # Name of the development board
├── BUILD.gn # Build script
├── hals # OS device API adaptation
├── linux # (Optional) Linux kernel version
│ └── config.gni # Linux build configuration
└── liteos_a # (Optional) LiteOS kernel version
└── config.gni # LiteOS_A build configuration
```
```
device
└── company # Chipset solution vendor
└── board # Name of the development board
├── BUILD.gn # Build script
├── hals # OS device API adaptation
├── linux # (Optional) Linux kernel version
│ └── config.gni # Linux build configuration
└── liteos_a # (Optional) LiteOS kernel version
└── config.gni # LiteOS_A build configuration
```
For example, if you are porting the Linux kernel to the hispark_taurus development board, the directory tree is as follows:
```
device
└── hisilicon
└── hispark_taurus
├── BUILD.gn
├── hals
├── ......
└── linux
└── config.gni
```
```
device
└── hisilicon
└── hispark_taurus
├── BUILD.gn
├── hals
├── ......
└── linux
└── config.gni
```
After the directory tree is created, store the source code related to the development board in the **hispark_taurus** directory.
......@@ -64,63 +64,63 @@ After learning the compilation framework and setting up the compilation environm
You can configure the build options in the **config.gni** file described in step 1. The compilation and building framework will then compile all OS components in the user space based on your configuration. The **config.gni** file contains the following key fields:
```
kernel_type: Kernel used by the development board, for example, LiteOS_A, LiteOS_M, or Linux.
kernel_version: Kernel version used by the development board, for example, 4.19.
board_cpu: CPU of the development board, for example, Cortex-A7 or RISCV32.
board_arch: Chipset architecture of the development board, for example, armv7-a or rv32imac.
board_toolchain: Name of the customized build toolchain used by the development board, for example, gcc-arm-none-eabi. If this field is not specified, ohos-clang will be used.
board_toolchain_prefix: Prefix of the toolchain, for example, gcc-arm-none-eabi.
board_toolchain_type: Toolchain type. Currently, only GCC and clang are supported.
board_cflags: Build options of the .c file configured for the development board.
board_cxx_flags: Build options of the .cpp file configured for the development board.
board_ld_flags: Linking options configured for the development board.
```
For HiSilicon's hispark_taurus development board, the content in **device/hisilicon/hispark_taurus/config.gni** is as follows:
```
# Board CPU type, e.g. "cortex-a7", "riscv32".
board_cpu = "cortex-a7"
# Name of the toolchain used for system building
# E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf.
# Note: The "ohos-clang" toolchain is used by default. You can also customize the toolchain.
board_toolchain = "mips-linux-gnu-gcc"
# Path where the toolchain is installed, which can be left blank if the installation path has been added to ~/.bashrc.
board_toolchain_path =
rebase_path("//prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin",
root_build_dir)
# Prefix of the toolchain
board_toolchain_prefix = "arm-linux-ohoseabi-"
# Type of the compiler, which can be gcc or clang
board_toolchain_type = "gcc"
# Build options related to the development board
board_cflags = [
]
board_cxx_flags = [
]
board_ld_flags = []
# Board related headfiles search path.
board_include_dirs = []
board_include_dirs += [ rebase_path(
"//prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/target/usr/include",
root_build_dir) ]
# Board adapter dir for OHOS components.
board_adapter_dir = ""
# Sysroot path.
board_configed_sysroot = ""
# Board storage type, it used for file system generation.
storage_type = "emmc"
```
```
kernel_type: Kernel used by the development board, for example, LiteOS_A, LiteOS_M, or Linux.
kernel_version: Kernel version used by the development board, for example, 4.19.
board_cpu: CPU of the development board, for example, Cortex-A7 or RISCV32.
board_arch: Chipset architecture of the development board, for example, armv7-a or rv32imac.
board_toolchain: Name of the customized build toolchain used by the development board, for example, gcc-arm-none-eabi. If this field is not specified, ohos-clang will be used.
board_toolchain_prefix: Prefix of the toolchain, for example, gcc-arm-none-eabi.
board_toolchain_type: Toolchain type. Currently, only GCC and clang are supported.
board_cflags: Build options of the .c file configured for the development board.
board_cxx_flags: Build options of the .cpp file configured for the development board.
board_ld_flags: Linking options configured for the development board.
```
For HiSilicon's hispark_taurus development board, the content in **device/hisilicon/hispark_taurus/config.gni** is as follows:
```
# Board CPU type, e.g. "cortex-a7", "riscv32".
board_cpu = "cortex-a7"
# Name of the toolchain used for system building
# E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf.
# Note: The "ohos-clang" toolchain is used by default. You can also customize the toolchain.
board_toolchain = "mips-linux-gnu-gcc"
# Path where the toolchain is installed, which can be left blank if the installation path has been added to ~/.bashrc.
board_toolchain_path =
rebase_path("//prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/bin",
root_build_dir)
# Prefix of the toolchain
board_toolchain_prefix = "arm-linux-ohoseabi-"
# Type of the compiler, which can be gcc or clang
board_toolchain_type = "gcc"
# Build options related to the development board
board_cflags = [
]
board_cxx_flags = [
]
board_ld_flags = []
# Board related headfiles search path.
board_include_dirs = []
board_include_dirs += [ rebase_path(
"//prebuilts/gcc/linux-x86/arm/arm-linux-ohoseabi-gcc/target/usr/include",
root_build_dir) ]
# Board adapter dir for OHOS components.
board_adapter_dir = ""
# Sysroot path.
board_configed_sysroot = ""
# Board storage type, it used for file system generation.
storage_type = "emmc"
```
3. Edit the build script of the development board.
......@@ -128,16 +128,16 @@ After learning the compilation framework and setting up the compilation environm
For example, edit the **device/hisilicon/hispark_taurus/BUILD.gn** file as follows:
```
# It is recommended that the group name be the same as the development board name.
group("hispark_taurus") {
deps = [ "//kernel/linux/patches:linux_kernel" ] # Start kernel compilation.
deps += [
...... # Other compilation units of the development board
]
}
```
```
# It is recommended that the group name be the same as the development board name.
group("hispark_taurus") {
deps = [ "//kernel/linux/patches:linux_kernel" ] # Start kernel compilation.
deps += [
...... # Other compilation units of the development board
]
}
```
4. Start building and debugging.
......
......@@ -14,51 +14,37 @@ Perform the following steps on Ubuntu.
1. Run the following command to install hb and update it to the latest version:
```
pip3 install --user build/lite
```shell
python3 -m pip install --user build/hb
```
2. Set an environment variable.
```
```shell
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
```shell
export PATH=~/.local/bin:$PATH
```
Update the environment variable.
```
```shell
source ~/.bashrc
```
3. Run the **hb -h** command in the source code directory. If the following information is displayed, the installation is successful:
```
usage: hb
OHOS build system
positional arguments:
{build,set,env,clean}
build Build source code
set OHOS build settings
env Show OHOS build env
clean Clean output
optional arguments:
-h, --help show this help message and exit
```
![hb_help](figures/hb_help.png)
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
> - To uninstall hb, run the following command:
>
> ```
> pip3 uninstall ohos-build
>
> ```shell
> python3 -m pip uninstall ohos-build
> ```
>
> - If any issue occurs during the hb installation, see [FAQs](quickstart-pkg-common-hberr.md).
......@@ -77,26 +63,26 @@ Perform the following steps on Ubuntu.
2. [Download LLVM](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar).
3. Decompress the LLVM installation package to **~/llvm**.
```
```shell
tar -zxvf llvm.tar -C ~/
```
4. Set an environment variable.
```
```shell
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
```shell
export PATH=~/llvm/bin:$PATH
```
5. Validate the environment variable.
```
```shell
source ~/.bashrc
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册