提交 8f20178a 编写于 作者: O openharmony_ci 提交者: Gitee

!271 OpenHarmony 1.1.0 LTS docs update

Merge pull request !271 from NEEN/master
......@@ -4,8 +4,7 @@
- [HPM-based Docker](#en-us_topic_0000001055701144_section580016182283)
- [Standalone Docker Environment](#en-us_topic_0000001055701144_section319412277287)
- [Setting Up the Docker Environment](#en-us_topic_0000001055701144_section436042904715)
- [Building for and](#en-us_topic_0000001055701144_section19121250134716)
- [Setting Up the Docker Environment for](#en-us_topic_0000001055701144_section776616712419)
- [Building](#en-us_topic_0000001055701144_section19121250134716)
- [Acquiring the Device Development Tool \(HUAWEI DevEco Device Tool\)](#en-us_topic_0000001055701144_section2452141120244)
- [Acquiring the Application Development Tool \(HUAWEI DevEco Studio\)](#en-us_topic_0000001055701144_section0904101019258)
......@@ -103,7 +102,7 @@ Start building. The following takes ip\_camera\_hi3518ev300 as an example. Docke
The following will be displayed if the building is successful:
```
......
...
ohos ipcamera_hi3518 build success!
@ohos/ip_camera_hi3518ev300: distribution building completed.
```
......@@ -128,7 +127,7 @@ Start building. The following takes ip\_camera\_hi3518ev300 as an example. Docke
The Docker image of OpenHarmony is hosted on [HUAWEI Cloud SWR](https://auth.huaweicloud.com/authui/login.html?service=https%3A%2F%2Fconsole.huaweicloud.com%2Fswr%2F%3Fregion%3Dcn-south-1%26cloud_route_state%3D%2Fapp%2Fwarehouse%2FwarehouseMangeDetail%2Fgoldensir%2Fopenharmony-docker%2Fopenharmony-docker%3Ftype%3DownImage&locale=en-us#/login). Using the Docker image will help simplify environment configurations needed for the building. After configuring the development environments, perform the steps below to access the Docker environment. The following steps use Ubuntu as an example \(Windows is also supported\).
### Setting Up the Docker Environment<a name="en-us_topic_0000001055701144_section436042904715"></a>
### Setting Up the Docker Environment for Mini-System Devices \(reference memory ≥ 128 KB\) and Small-System Devices \(reference memory ≥ 1 MB\)<a name="en-us_topic_0000001055701144_section436042904715"></a>
**Method 1: Obtaining the Docker image from HuaweiCloud SWR**
......@@ -207,50 +206,11 @@ The following uses the Hi3516 platform as an example to describe the build proce
The files will be generated in the **out/hispark\_taurus/ipcamera\_hispark\_taurus** directory.
### Setting Up the Docker Environment for Large-System Devices \(reference memory ≥ 1 GB\)<a name="en-us_topic_0000001055701144_section776616712419"></a>
**Method 1: Obtaining the Docker image from HuaweiCloud SWR**
1. Obtain the Docker image.
```
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3
```
2. Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:
```
docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3
```
**Method 2: Using the Dockerfile to Build a Local Docker Image**
1. Obtain the Dockerfile script for a local Docker image.
```
git clone https://gitee.com/openharmony/docs.git
```
2. Go to the directory of the Dockerfile code and run the following command to build the Docker image:
```
cd docs/docker
./build.sh
```
3. Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:
```
docker run -it -v $(pwd):/home/openharmony openharmony-docker:0.0.3
```
## Acquiring the Device Development Tool \(HUAWEI DevEco Device Tool\)<a name="en-us_topic_0000001055701144_section2452141120244"></a>
HUAWEI DevEco Device Tool is a one-stop integrated development environment \(IDE\) provided to develop applications for HarmonyOS-based smart devices. It allows on-demand customization of HarmonyOS components, code editing, compilation, burning, and debugging, and supports C and C++ languages. This tool is installed in Visual Studio Code as a plug-in. For details, see [Tool Acquisition](https://device.harmonyos.com/en/ide) and [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/service_introduction-0000001050166905).
HUAWEI DevEco Device Tool is a one-stop integrated development environment \(IDE\) provided to develop applications for OpenHarmony-based smart devices. It allows on-demand customization of OpenHarmony components, code editing, compilation, burning, and debugging, and supports C and C++ languages. This tool is installed in Visual Studio Code as a plug-in. For details, see [Tool Acquisition](https://device.harmonyos.com/en/ide) and [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/service_introduction-0000001050166905).
## Acquiring the Application Development Tool \(HUAWEI DevEco Studio\)<a name="en-us_topic_0000001055701144_section0904101019258"></a>
HUAWEI DevEco Studio \(DevEco Studio for short\) is a one-stop IDE oriented to Huawei devices in all scenarios. It provides E2E HarmonyOS application development services, ranging from project template creation to development, compilation, debugging, and release. With DevEco Studio, you will be able to efficiently develop HarmonyOS applications with distributed capabilities while speeding up innovation. For details, see [Tool Acquisition](https://developer.harmonyos.com/en/develop/deveco-studio) and [HUAWEI DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/tools_overview-0000001053582387).
HUAWEI DevEco Studio \(DevEco Studio for short\) is a one-stop IDE oriented to Huawei devices in all scenarios. It provides E2E OpenHarmony application development services, ranging from project template creation to development, compilation, debugging, and release. With DevEco Studio, you will be able to efficiently develop OpenHarmony applications with distributed capabilities while speeding up innovation. For details, see [Tool Acquisition](https://developer.harmonyos.com/en/develop/deveco-studio) and [HUAWEI DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/tools_overview-0000001053582387).
......@@ -5,7 +5,7 @@
## Building Process<a name="section1111311235313"></a>
The compilation and building subsystem is a building system based on Generate Ninja \(GN\) and Ninja. The following figure shows the building process.
The compilation and building subsystem is a building system based on Generate Ninja \(GN\) and Ninja. It supports on-demand configuration, tailoring, and assembly by component to customize desired products. The following figure shows the building process.
**Figure 1** Building process<a name="fig23781931124913"></a>
![](figures/building-process.png "building-process")
......@@ -15,7 +15,7 @@ The compilation and building subsystem is a building system based on Generate Ni
>![](public_sys-resources/icon-note.gif) **NOTE:**
>If the building type is debug, XTS will be involved in the building. If the building type is release, the symbol table and debugging information of the file generated after building will be removed.
- **Read the product configuration**: Read the **vendor/_x\_company_/_x\_product_.json** file that contains the development board, kernel type, kernel version, and components to configure.
- **Read the product configuration**: Read the **vendor/_my\_company_/_my\_product_.json** file that contains the development board, kernel type, kernel version, and components to configure.
- **Run the gn gen command to generate the ninja file**: Based on the parsed product configuration, add the selected components to build according to the corresponding building toolchain and configure global building options.
- **Use Ninja to start building**: Build and link the components one by one.
......@@ -29,13 +29,13 @@ You need to create a directory for the development board. Taking the **RTL8720*
The **ohos-clang** toolchain is used by default. SoC vendors can also customize the configuration based on their development boards. The building-related variables in the building configuration file of the development board are described as follows:
- **kernel\_type**: kernel type used by the development board, for example, **"liteos\_a"**, **"liteos\_m"**, or **"Linux"**.
- **kernel\_type**: kernel type used by the development board, for example, **"liteos\_a"**, **"liteos\_m"**, or **"linux"**.
- **kernel\_version**: kernel version used for development, for example, **"4.19"**.
- **board\_cpu**: CPU type of the development board, for example, **"cortex-a7"** or **"riscv32"**.
- **board\_arch**: chip architecture of the development board, for example, **"armv7-a"**, or **"rv32imac"**.
- **board\_arch**: chip architecture of the development board, for example, **"armv7-a"** or **"rv32imac"**.
- **board\_toolchain**: name of the customized building toolchain used by the development board, for example, **"gcc-arm-none-eabi"**. If this variable is not specified, **ohos-clang** will be used by default.
- **board\_toolchain\_prefix**: prefix of the building toolchain, for example, **"gcc-arm-none-eabi"**.
- **board\_toolchain\_type**: building toolchain type. Currently, GNU compiler collection \(GCC\) and clang are supported, for example, **"gcc"** and **"clang"**.
- **board\_toolchain\_type**: building toolchain type. Currently, GNU compiler collection \(GCC\) and clang are supported, for example, **"gcc"** or **"clang"**.
- **board\_cflags**: building options of the **.c** file configured for the development board.
- **board\_cxx\_flags**: building options of the **.cpp** file configured for the development board.
- **board\_ld\_flags**: link options configured for the development board.
......@@ -50,7 +50,7 @@ You need to create a directory for the development board. Taking the **RTL8720*
kernel_type = "liteos_m"
# Kernel version.
kernel_version = ""
kernel_version = "3.0.0"
# Board CPU type, e.g. "cortex-a7", "riscv32".
board_cpu = "real-m300"
......@@ -80,20 +80,59 @@ You need to create a directory for the development board. Taking the **RTL8720*
board_ld_flags = []
```
2. Compile the development board script.
2. Edit the building script of the development board.
For a newly added development board, the **BUILD.gn** file that functions as the entry for building must be added to the board directory. Taking the RTL8720 development board of Realtek as an example, the content in the **device/realtek/rtl8720/BUILD.gn** file is as follows:
```
group("rlt8720") {
group("rtl8720") {
...
}
```
3. Start building and debugging
3. Build and debug the development board.
1. Run the **hb set** command in any directory to set the source code path and the product to build.
2. Run the **hb build** command in the development board directory to start the building.
4. Build and debug the product.
Write the development board and component information to the product configuration file. Fields in the configuration file are as follows:
- **product\_name**: product name, which can be customized. It is recommended that the value be the same as the level-3 directory name under the **vendor** directory.
- **ohos\_version**: OpenHarmony version number, which must be the same as the actual version number.
- **device\_company**: name of the chip solution vendor. It is recommended that the value be the same as the level-2 directory name under the **device** directory.
- **board**: name of the development board. It is recommended that the value be the same as the level-3 directory name under the **device** directory.
- **kernel\_type**: kernel type, which must match the kernel type supported by the development board.
- **kernel\_version**: kernel version, which must match the kernel version supported by the development board.
- **subsystem**: OpenHarmony subsystem selected for the product. For details about the subsystems supported by OpenHarmony, see the descriptions of the subsystems in the **build/lite/components** directory.
- **components**: subsystem-specific components selected for the product. For details about the components supported by the selected subsystem, see the **build/lite/components/_Specific subsystem_.json** file.
- **features**: component-specific features configured for the product. For details about the features supported by the selected component, see the **features** field of the component in **build/lite/components/_Specific subsystem_.json** file.
Taking the Wi-Fi IoT module based on the RTL8720 development board as an example, the **vendor/my\_company/wifiiot/config.json** file is as follows:
```
{
"product_name": "wifiiot", # Product name
"ohos_version": "OpenHarmony 1.0", # In-use OS version
"device_company": "realtek", # Name of the chip solution vendor
"board": "rtl8720", # Name of the development board
"kernel_type": "liteos_m", # Selected kernel type
"kernel_version": "3.0.0", # Selected kernel version
"subsystems": [
{
"subsystem": "kernel", # Selected subsystem
"components": [
{ "component": "liteos_m", "features":[] } # Selected component and its features
]
},
...
{
More subsystems and components
}
]
}
```
......@@ -14,7 +14,7 @@ The Utils subsystem provides common basic components that can be used by other s
**Description for HAL APIs of the Utils subsystem**
The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the SoC file system APIs, see [HAL Header Files of Utils](https://gitee.com/openharmony/utils_native_lite/tree/master/hals/file).
The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the SoC file system APIs, see [HAL header files of Utils](https://gitee.com/openharmony/utils_native_lite/tree/master/hals/file).
## IoT Peripheral Subsystem<a name="section958113200811"></a>
......@@ -24,7 +24,7 @@ The IoT peripheral subsystem provides dedicated peripheral operation interfaces
**Description for HAL APIs of the IoT peripheral subsystem**
The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the chip peripheral APIs, see [HAL Header Files of wifiiot](https://gitee.com/openharmony/iothardware_hals_wifiiot_lite/tree/master).
The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the chip peripheral APIs, see [HAL header files of IoT peripherals](https://gitee.com/openharmony/iothardware_peripheral/tree/master/interfaces/kits).
## WLAN<a name="section1331917210911"></a>
......@@ -70,5 +70,5 @@ vendor/hisi/hi3861/hi3861_adapter/hals/communication/wifi_lite/wifiservice/
└── wifi_hotspot.c
```
The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the chip peripheral APIs, see [Header Files of WLAN](https://gitee.com/openharmony/communication_interfaces_kits_wifi_lite/tree/master/wifiservice).
The SoC needs to implement related APIs. For details about the dependency of OpenHarmony on the chip peripheral APIs, see [header files of WLAN](https://gitee.com/openharmony/communication_wifi_lite/tree/master/interfaces/wifiservice).
......@@ -9,16 +9,18 @@
- [Using Docker to Install the Linux Environment](#section107932281315)
- [Using an Installation Package to Install the Linux Environment](#section497484245614)
- [Connecting to a Linux Server](#section723115618340)
- [Changing Linux Shell to Bash](#section1715027152617)
- [Installing a Python Environment](#section11255767343)
- [Installing and Configuring Python](#section11255767343)
- [Installing gn](#section9262166183410)
- [Installing ninja](#section02645617348)
- [Installing LLVM](#section149564754)
- [Installing hb](#section6201103143120)
- [Obtaining Source Code](#section1545225464016)
- [Obtaining OpenHarmony Source Code](#section1545225464016)
- [FAQ](#section19253140111619)
- [What should I do if garbled characters and segmentation faults occur during hb installation?](#section347685141717)
- [What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?](#section1996804118553)
- [What should I do if the message "module 'platform' has no attribute 'linux\_distribution'" is displayed during hb Installation?](#section6992181918582)
- [What should I do if the message "ImportError: No module named apt\_pkg" is displayed during the execution of an unidentifiable command?](#section7854153010120)
Before setting up the environment for a development board, you must set up the basic OS environment for OpenHarmony first. The basic OS environment refers to the building environment and development environment of OpenHarmony. You can choose one of the following methods to set up the basic OS environment based on your preference and the hardware and software used.
......@@ -142,14 +144,7 @@ The following table describes the tools required for setting up the general envi
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p43003270510"><a name="p43003270510"></a><a name="p43003270510"></a>Executes script compilation.</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p18254155164617"><a name="p18254155164617"></a><a name="p18254155164617"></a><a href="https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz" target="_blank" rel="noopener noreferrer">https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz</a></p>
</td>
</tr>
<tr id="row42668197206"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p426711912014"><a name="p426711912014"></a><a name="p426711912014"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p14267131962014"><a name="p14267131962014"></a><a name="p14267131962014"></a>Executes commands.</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p14267101962014"><a name="p14267101962014"></a><a name="p14267101962014"></a>Internet</p>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p34760459518"><a name="p34760459518"></a><a name="p34760459518"></a>Internet</p>
</td>
</tr>
<tr id="row1711946154018"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p15588165684216"><a name="p15588165684216"></a><a name="p15588165684216"></a>gn</p>
......@@ -177,7 +172,7 @@ The following table describes the tools required for setting up the general envi
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p1244114913492"><a name="p1244114913492"></a><a name="p1244114913492"></a>Compiles the source code.</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p1244120916499"><a name="p1244120916499"></a><a name="p1244120916499"></a>The <strong id="b146115915482"><a name="b146115915482"></a><a name="b146115915482"></a>build_lite</strong> repository in HarmonyOS source code</p>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p1463918124619"><a name="p1463918124619"></a><a name="p1463918124619"></a>Internet</p>
</td>
</tr>
</tbody>
......@@ -218,30 +213,7 @@ Using PuTTY to log in to a Linux server from a PC running Windows
![](figures/successful-login.png "successful-login")
### Changing Linux Shell to Bash<a name="section1715027152617"></a>
Check whether bash is used as the shell.
```
ls -l /bin/sh
```
If **/bin/sh -\> bash** is not displayed, do as follows to change shell to bash.
**Method 1:** Run the following command on the device and then click **No**.
```
sudo dpkg-reconfigure dash
```
**Method 2:** Run the first command to delete **sh** and then run the second command to create a new soft link.
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### Installing a Python Environment<a name="section11255767343"></a>
### Installing and Configuring Python<a name="section11255767343"></a>
1. Start a Linux server.
2. Check the Python version \(Python 3.7 or later is required\).
......@@ -265,40 +237,33 @@ sudo ln -s /bin/bash /bin/sh
sudo apt-get install python3.8
```
- If the Ubuntu version is **16**, download the installation package and install Python.
- If the Ubuntu version is 16, perform the following steps:
1. Install Python environment dependencies \(gcc, g++, make, zlib, libffi\).
a. Install dependency packages.
```
sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
sudo apt update && sudo apt install software-properties-common
```
1. Obtain the [Python 3.8.5 installation package](https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz), save it to the Linux server, and run the following command:
b. Add the source of deadsnakes PPA and press **Enter**.
```
tar -xvzf Python-3.8.5.tgz && cd Python-3.8.5 && sudo ./configure && sudo make && sudo make install
sudo add-apt-repository ppa:deadsnakes/ppa
```
c. Install Python 3.8.
```
sudo apt upgrade && sudo apt install python3.8
```
3. Link the Python path to **/usr/bin/python** after Python is installed.
Check whether Python is soft linked to Python 3.8.
```
python --version
```
If the command output is not **python 3.8.5**, run the following command to check the directory where Python 3.8 is stored:
```
which python3.8
```
Replace **python3.8-path** in the following command with the output path of the **which python3.8** command.
3. Set the soft link of **python** and **python3** to **python3.8**.
```
cd /usr/bin && sudo rm python && sudo rm python3 && sudo ln -s python3.8-path python && sudo ln -s python3.8-path python3 && python3 --version
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
```
4. Install and upgrade the Python package management tool \(pip3\) using either of the following methods:
......@@ -317,104 +282,6 @@ sudo ln -s /bin/bash /bin/sh
```
5. Install setuptools.
```
pip3 install setuptools
```
6. Install the GUI menuconfig tool \(Kconfiglib\). You are advised to install Kconfiglib 13.2.0 or later.
- **Command line:**
```
sudo pip3 install kconfiglib
```
- **Installation package:**
1. Download the **.whl** file, for example, **kconfiglib-13.2.0-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/kconfiglib\#files](https://pypi.org/project/kconfiglib#files)
1. Install the **.whl** file.
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
7. <a name="li195884268616"></a>Install **pycryptodome** using either of the following methods:
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>Steps [7](#li195884268616) to [9](#li125926111510) are required only for the Hi3861 development board.
Install the Python component packages on which the file signature depends, including pycryptodome, six, and ecdsa. As the installation of **ecdsa** depends on that of **six**, install **six** first.
- **Command line:**
```
sudo pip3 install pycryptodome
```
- **Installation package:**
1. Download the **.whl** file \(for example, **pycryptodome-3.9.9-cp38-cp38-manylinux1\_x86\_64.whl**\).
Download path: [https://pypi.org/project/pycryptodome/\#files](https://pypi.org/project/pycryptodome/#files)
1. Install the **.whl** file.
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
8. Install **six** using either of the following methods:
- **Command line:**
```
sudo pip3 install six --upgrade --ignore-installed six
```
- **Installation package:**
1. Download the **.whl** file, for example, **six-1.12.0-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files)
1. Install the **.whl** file.
```
sudo pip3 install six-1.12.0-py2.py3-none-any.whl
```
9. <a name="li125926111510"></a>Install **ecdsa** using either of the following methods:
- **Command line:**
```
sudo pip3 install ecdsa
```
- **Installation package:**
1. Download the **.whl** file, for example, **ecdsa-0.14.1-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/ecdsa/\#files](https://pypi.org/project/ecdsa/#files)
1. Install the **.whl** file.
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
### Installing gn<a name="section9262166183410"></a>
......@@ -513,15 +380,15 @@ sudo ln -s /bin/bash /bin/sh
**Prerequisites**
- Python 3.7.4 or later has been installed. For details, see steps 1 to 4 in [Installing a Python Environment](#section11255767343).
- Python 3.7.4 or later has been installed. For details, see [Installing and Configuring Python](#section11255767343).
- The source code has been downloaded. For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md).
**Installation**
1. Run the following command in the root directory of the source code:
1. Install **hb**.
```
python3 -m pip install --user build/lite
python3 -m pip install --user ohos-build
```
2. Set an environment variable.
......@@ -542,7 +409,7 @@ sudo ln -s /bin/bash /bin/sh
source ~/.bashrc
```
3. Run the **hb -h** command. The installation is successful until the following information is displayed:
3. Run the **hb -h** command. If the following information is displayed, the installation is successful:
```
usage: hb
......@@ -572,7 +439,7 @@ python3 -m pip uninstall ohos-build
## Obtaining OpenHarmony Source Code<a name="section1545225464016"></a>
You need to acquire [OpenHarmony source code](https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz), download it on a Linux server, and decompress it. For more obtaining methods, see [Source Code Acquisition](../get-code/source-code-acquisition.md).
You need to acquire OpenHarmony [source code](https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz), download it on a Linux server, and decompress it. For more obtaining methods, see [Source Code Acquisition](../get-code/source-code-acquisition.md).
## FAQ<a name="section19253140111619"></a>
......@@ -580,7 +447,7 @@ You need to acquire [OpenHarmony source code](https://repo.huaweicloud.com/harm
- **Symptom**
Garbled characters and segmentation faults occur during execution of the **python3 -m pip install --user build/lite** command.
Garbled characters and segmentation faults occur during the execution of the **python3 -m pip install --user ohos-build** command.
- **Possible Causes**
......@@ -589,10 +456,72 @@ You need to acquire [OpenHarmony source code](https://repo.huaweicloud.com/harm
- **Solutions**
Run the following command to upgrade pip:
Upgrade pip.
```
python3 -m pip install -U pip
```
### What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?<a name="section1996804118553"></a>
- **Symptom**
The message "cannot import 'sysconfig' from 'distutils'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
- **Possible Causes**
The **distutils** module is unavailable.
- **Solutions**
Install **distutils**.
```
sudo apt-get install python3.8-distutils
```
### What should I do if the message "module 'platform' has no attribute 'linux\_distribution'" is displayed during hb Installation?<a name="section6992181918582"></a>
- **Symptom**
The message "module 'platform' has no attribute 'linux\_distribution'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
- **Possible Causes**
There is a compatibility issue of python3-pip.
- **Solutions**
Reinstall pip.
```
sudo apt remove python3-pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
```
### What should I do if the message "ImportError: No module named apt\_pkg" is displayed during the execution of an unidentifiable command?<a name="section7854153010120"></a>
- **Symptom**
The message "ImportError: No module named apt\_pkg" is displayed when an unidentifiable command is executed on the Linux server.
- **Possible Causes**
There is a compatibility issue of python3-apt.
- **Solutions**
Reinstall python3-apt.
```
sudo apt-get remove python3-apt
sduo apt-get install python3-apt
```
......@@ -6,6 +6,8 @@
- [Software Requirements](#section965634210501)
- [Installing the Linux Compilation Environment](#section182916865219)
- [Changing Linux Shell to Bash](#section1715027152617)
- [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251)
- [Installing a File Packing Tool](#section8352161417450)
- [Installing hc-gen](#section2075110583451)
- [Installing the JVM](#section101989994613)
......@@ -47,11 +49,25 @@ The following table describes the tools required for setting up the general envi
</th>
</tr>
</thead>
<tbody><tr id="row76242594498"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p1682494111548"><a name="p1682494111548"></a><a name="p1682494111548"></a>dosfstools, mtools, and mtd-utils</p>
<tbody><tr id="row167343191518"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p467443191517"><a name="p467443191517"></a><a name="p467443191517"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p1362445934918"><a name="p1362445934918"></a><a name="p1362445934918"></a>Pack files.</p>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p0674153114151"><a name="p0674153114151"></a><a name="p0674153114151"></a>Processes CLI commands.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p1262475944916"><a name="p1262475944916"></a><a name="p1262475944916"></a>apt-get install</p>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p116746312151"><a name="p116746312151"></a><a name="p116746312151"></a>System configuration</p>
</td>
</tr>
<tr id="row14885193315201"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>Basic software package for compilation and building (required only for Ubuntu 20+)</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p258814561424"><a name="p258814561424"></a><a name="p258814561424"></a>Provides a basic software package for compilation and building.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p1749611716181"><a name="p1749611716181"></a><a name="p1749611716181"></a>Internet</p>
</td>
</tr>
<tr id="row52253812238"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p28007392236"><a name="p28007392236"></a><a name="p28007392236"></a>dosfstools, mtools, and mtd-utils</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p98008390232"><a name="p98008390232"></a><a name="p98008390232"></a>Pack files.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p280018394233"><a name="p280018394233"></a><a name="p280018394233"></a>apt-get install</p>
</td>
</tr>
<tr id="row18516509507"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p14521650135017"><a name="p14521650135017"></a><a name="p14521650135017"></a>hc-gen</p>
......@@ -77,6 +93,37 @@ The following table describes the tools required for setting up the general envi
>- If you acquire the source code using an HPM component or HPM CLI tool, compilation tools like **LLVM** and **hc-gen** are not required.
>- \(Recommended\) If you obtain the source code through an image site or a code repository, install compilation tools like **LLVM** and **hc-gen**. When installing **LLVM** and **hc-gen**, ensure that the environment variable paths of the compilation tools are unique.
### Changing Linux Shell to Bash<a name="section1715027152617"></a>
Check whether bash is used as the shell.
```
ls -l /bin/sh
```
If **/bin/sh -\> bash** is not displayed, do as follows to change shell to bash.
**Method 1:** Run the following command on the device and then click **No**.
```
sudo dpkg-reconfigure dash
```
**Method 2:** Run the first command to delete **sh** and then run the second command to create a new soft link.
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)<a name="section45512412251"></a>
Install the software.
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### Installing a File Packing Tool<a name="section8352161417450"></a>
1. Start a Linux server.
......
# Setting Up the Hi3518 Development Environment<a name="EN-US_TOPIC_0000001054022306"></a>
- [Prerequisites](#section2074878255)
- [Requirements Specific to the Hi3518 Development Environment](#section1724111409282)
- [Setting Up the Hi3518 Development Environment](#section1724111409282)
- [Hardware Requirements](#section487353718276)
- [Software Requirements](#section17315193935817)
- [Installing the Linux Compilation Environment](#section8831868501)
- [Changing Linux Shell to Bash](#section1715027152617)
- [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251)
- [Installing a File Packing Tool](#section480195453419)
- [Installing hc-gen](#section351420104218)
......@@ -14,7 +16,7 @@
You must complete the settings in [Basic OS Environment Setup](basic-os-environment-setup.md).
## Requirements Specific to the Hi3518 Development Environment<a name="section1724111409282"></a>
## Setting Up the Hi3518 Development Environment<a name="section1724111409282"></a>
### Hardware Requirements<a name="section487353718276"></a>
......@@ -45,7 +47,21 @@ The following table describes the tools required for setting up the general envi
</th>
</tr>
</thead>
<tbody><tr id="row08231641105420"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p1682494111548"><a name="p1682494111548"></a><a name="p1682494111548"></a>dosfstools, mtools, and mtd-utils</p>
<tbody><tr id="row18630134151917"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p1563113417199"><a name="p1563113417199"></a><a name="p1563113417199"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p463193418190"><a name="p463193418190"></a><a name="p463193418190"></a>Processes CLI commands.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p1063118344191"><a name="p1063118344191"></a><a name="p1063118344191"></a>System configuration</p>
</td>
</tr>
<tr id="row7598468212"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p659815642111"><a name="p659815642111"></a><a name="p659815642111"></a>Basic software package for compilation and building (required only for Ubuntu 20+)</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>Provides a basic software package for compilation and building.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p125983652118"><a name="p125983652118"></a><a name="p125983652118"></a>Internet</p>
</td>
</tr>
<tr id="row08231641105420"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p1682494111548"><a name="p1682494111548"></a><a name="p1682494111548"></a>dosfstools, mtools, and mtd-utils</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p1362445934918"><a name="p1362445934918"></a><a name="p1362445934918"></a>Pack files.</p>
</td>
......@@ -68,6 +84,37 @@ The following table describes the tools required for setting up the general envi
>- If you acquire the source code using an HPM component or HPM CLI tool, compilation tools like **gn**, **ninja**, **LLVM**, and **hc-gen** are not required.
>- \(Recommended\) If you obtain the source code through an image site or a code repository, compilation tools like **LLVM** and **hc-gen** need to be installed. When installing **LLVM** and **hc-gen**, ensure that the environment variable paths of the compilation tools are unique.
### Changing Linux Shell to Bash<a name="section1715027152617"></a>
Check whether bash is used as the shell.
```
ls -l /bin/sh
```
If **/bin/sh -\> bash** is not displayed, do as follows to change shell to bash.
**Method 1:** Run the following command on the device and then click **No**.
```
sudo dpkg-reconfigure dash
```
**Method 2:** Run the first command to delete **sh** and then run the second command to create a new soft link.
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)<a name="section45512412251"></a>
Install the software.
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### Installing a File Packing Tool<a name="section480195453419"></a>
1. Start a Linux server.
......
......@@ -3,19 +3,21 @@
- [Prerequisites](#section2074878255)
- [Requirements Specific to the Hi3861 Development Environment](#section466851916410)
- [Installing the Linux Compilation Environment](#section497484245614)
- [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251)
- [Installing Scons](#section13515123015279)
- [Installing Python Modules](#section88701892341)
- [Installing gcc\_riscv32 \(Compilation Toolchain for WLAN Module\)](#section1842910288284)
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>This section describes how to use an installation package to set up the compilation and building environment. If you are going to use Docker to set up the environment, the Linux server-related tools SCons 3.0.4+ and build-essential are not required, and you only need to install the Windows workstation.
## Prerequisites<a name="section2074878255"></a>
You must complete the settings in [Basic OS Environment Setup](basic-os-environment-setup.md).
## Requirements Specific to the Hi3861 Development Environment<a name="section466851916410"></a>
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>This section describes how to use an installation package to set up the compilation and building environment. If you are going to use Docker to set up the environment, the Linux server-related tools in [Table 1](#table6299192712513) are not required, and you only need to install the Windows workstation.
The following table describes the environment configuration requirements specific to the Hi3861 development board.
**Table 1** Hi3861 development environment-specific requirements
......@@ -31,7 +33,16 @@ The following table describes the environment configuration requirements specifi
</th>
</tr>
</thead>
<tbody><tr id="row1397335913612"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p3711468218"><a name="p3711468218"></a><a name="p3711468218"></a>Linux server</p>
<tbody><tr id="row935218593572"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p105554418586"><a name="p105554418586"></a><a name="p105554418586"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p45551740589"><a name="p45551740589"></a><a name="p45551740589"></a>Basic software package for compilation and building (required only for Ubuntu 20+)</p>
</td>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p655594115814"><a name="p655594115814"></a><a name="p655594115814"></a>Provides a basic software package for compilation and building.</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p165558415589"><a name="p165558415589"></a><a name="p165558415589"></a>Internet</p>
</td>
</tr>
<tr id="row1397335913612"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p3711468218"><a name="p3711468218"></a><a name="p3711468218"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p097355911620"><a name="p097355911620"></a><a name="p097355911620"></a>SCons 3.0.4+</p>
</td>
......@@ -40,13 +51,22 @@ The following table describes the environment configuration requirements specifi
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p1722663441514"><a name="p1722663441514"></a><a name="p1722663441514"></a>Internet</p>
</td>
</tr>
<tr id="row1463517494402"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>Linux server</p>
<tr id="row1968013216717"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p2681632977"><a name="p2681632977"></a><a name="p2681632977"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p1991501391312"><a name="p1991501391312"></a><a name="p1991501391312"></a>Python modules: setuptools, Kconfiglib, PyCryptodome, six, and ecdsa</p>
</td>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p968120325715"><a name="p968120325715"></a><a name="p968120325715"></a>Executes script compilation.</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p268116326711"><a name="p268116326711"></a><a name="p268116326711"></a>Internet</p>
</td>
</tr>
<tr id="row020914491313"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p20209749103116"><a name="p20209749103116"></a><a name="p20209749103116"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p258814561424"><a name="p258814561424"></a><a name="p258814561424"></a>build-essential</p>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p7209104910317"><a name="p7209104910317"></a><a name="p7209104910317"></a>gcc riscv32</p>
</td>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p1749611716181"><a name="p1749611716181"></a><a name="p1749611716181"></a>Provides basic software package for compilation.</p>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p102093498311"><a name="p102093498311"></a><a name="p102093498311"></a>Executes script compilation.</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p8635174916403"><a name="p8635174916403"></a><a name="p8635174916403"></a>Internet</p>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p321054953116"><a name="p321054953116"></a><a name="p321054953116"></a>Internet</p>
</td>
</tr>
<tr id="row1596703610215"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p071946112113"><a name="p071946112113"></a><a name="p071946112113"></a>Windows workstation</p>
......@@ -55,7 +75,7 @@ The following table describes the environment configuration requirements specifi
</td>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p94491342131413"><a name="p94491342131413"></a><a name="p94491342131413"></a>USB-to-Serial adapter driver</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p6449184214148"><a name="p6449184214148"></a><a name="p6449184214148"></a><a href="http://www.wch-ic.com/downloads/CH341SER_EXE.html" target="_blank" rel="noopener noreferrer">http://www.wch-ic.com/downloads/CH341SER_EXE.html</a></p>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p6449184214148"><a name="p6449184214148"></a><a name="p6449184214148"></a><a href="http://www.wch-ic.com/downloads/CH341SER_EXE.html" target="_blank" rel="noopener noreferrer">http://www.wch.cn/search?q=ch340g&amp;t=downloads</a></p>
</td>
</tr>
</tbody>
......@@ -67,39 +87,129 @@ The following table describes the environment configuration requirements specifi
>- If you acquire the source code using an HPM component or HPM CLI tool, **gcc\_riscv32** is not required.
>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install **gcc\_riscv32**. When installing **gcc\_riscv32**, ensure that the environment variable paths of the compilation tools are unique.
### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)<a name="section45512412251"></a>
Install the software.
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### Installing Scons<a name="section13515123015279"></a>
1. Start a Linux server.
2. Install the SCons installation package.
```
sudo apt-get install scons -y
python3 -m pip install scons
```
3. Check whether the installation is successful.
```
scons -v
```
If the installation package cannot be found in the software source, do as follows:
**Figure 1** Successful installation \(SCons version requirement: 3.0.4 or later\)<a name="fig235815252492"></a>
![](figures/successful-installation-(scons-version-requirement-3-0-4-or-later).png "successful-installation-(scons-version-requirement-3-0-4-or-later)")
1. Download the source code package from [https://scons.org/pages/download.html](https://scons.org/pages/download.html). The recommended SCons version is 3.0.4 or later.
2. Decompress the source code package to any directory, for example, scons-3.1.2.
### Installing Python Modules<a name="section88701892341"></a>
1. Install setuptools.
```
pip3 install setuptools
```
2. Install the GUI menuconfig tool \(Kconfiglib\). You are advised to install Kconfiglib 13.2.0 or later.
- **Command line:**
```
tar -xvf scons-3.1.2.tar.gz
sudo pip3 install kconfiglib
```
3. Go to the source code directory and run the following command to install the source code package:
- **Installation package:**
1. Download the **.whl** file \(for example, **kconfiglib-13.2.0-py2.py3-none-any.whl**\).
Download path: [https://pypi.org/project/kconfiglib\#files](https://pypi.org/project/kconfiglib#files)
1. Install the **.whl** file.
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
3. Install **PyCryptodome** using either of the following methods:
Install the Python component packages on which the file signature depends, including PyCryptodome, six, and ecdsa. As the installation of **ecdsa** depends on that of **six**, install **six** first.
- **Command line:**
```
sudo python3 setup.py install
sudo pip3 install pycryptodome
```
- **Installation package:**
1. Download the **.whl** file \(for example, **pycryptodome-3.9.9-cp38-cp38-manylinux1\_x86\_64.whl**\).
3. Check whether the installation is successful.
Download path: [https://pypi.org/project/pycryptodome/\#files](https://pypi.org/project/pycryptodome/#files)
1. Install the **.whl** file.
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
4. Install **six** using either of the following methods:
- **Command line:**
```
sudo pip3 install six --upgrade --ignore-installed six
```
- **Installation package:**
1. Download the **.whl** file, for example, **six-1.12.0-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files)
1. Install the **.whl** file.
```
sudo pip3 install six-1.12.0-py2.py3-none-any.whl
```
5. Install **ecdsa** using either of the following methods:
- **Command line:**
```
sudo pip3 install ecdsa
```
- **Installation package:**
1. Download the **.whl** file, for example, **ecdsa-0.14.1-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/ecdsa/\#files](https://pypi.org/project/ecdsa/#files)
1. Install the **.whl** file.
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
```
scons -v
```
**Figure 1** Successful installation<a name="fig235815252492"></a>
![](figures/successful-installation.png "successful-installation")
### Installing gcc\_riscv32 \(Compilation Toolchain for WLAN Module\)<a name="section1842910288284"></a>
......@@ -172,7 +282,7 @@ The following table describes the environment configuration requirements specifi
cd /opt && mkdir gcc_riscv32
```
13. Build **Bintutils**.
13. Compile **binutils**.
```
mkdir build_binutils && cd build_binutils && ../riscv-binutils-gdb/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --bindir=/opt/gcc_riscv32/bin --libexecdir=/opt/gcc_riscv32/riscv32 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd ..
......@@ -181,7 +291,7 @@ The following table describes the environment configuration requirements specifi
14. Build **Newlib**.
```
mkdir build_newlib && cd build_newlib && ../riscv-newlib/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --bindir=/opt/gcc_riscv32/bin --libexecdir=/opt/gcc_riscv32 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd ..
mkdir build_newlib && cd build_newlib && ../riscv-newlib/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" \CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --bindir=/opt/gcc_riscv32/bin --libexecdir=/opt/gcc_riscv32 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd ..
```
15. Build **GCC**.
......
......@@ -7,7 +7,7 @@ This module implements automatic service initialization. That is, the initializa
For details about how to include the **zInit** code segment, see the Hi3861 linker script in **vendor/hisi/hi3861/hi3861/build/link/link.ld.S**.
For details about the macros used by the bootstrap module to implement automatic service initialization, see [API document](https://gitee.com/openharmony/docs/blob/master/api/api-SmartVision-Devices/OHOS-Init.md) for the startup subsystem.
For details about the macros used by the bootstrap module to implement automatic service initialization, see [API document](https://device.harmonyos.com/en/docs/develop/apiref/init-0000001054598113) the startup subsystem.
## Available APIs<a name="section1633115419401"></a>
......
......@@ -52,7 +52,7 @@
- **Solution**
```
sudo apt-get install dosfstools mtools
sudo apt-get install dosfstools mtools
```
......@@ -67,7 +67,7 @@
Permission is required to access files in the **riscv** compiler path.
- **Solution**
1. Run the following command to query the directory where **hcc\_riscv32** is located:
1. Run the following command to query the directory where **gcc\_riscv32** is located:
```
which riscv32-unknown-elf-gcc
......
......@@ -15,7 +15,6 @@ build/lite # Primary directory for compilation and building
│ ├── kernel # Compilation configuration parameters of the kernel
│ └── subsystem # Subsystem template
├── ndk # NDK-related compilation scripts and configuration parameters
├── product # Full configuration tables of the product, which contain configuration units, the subsystem list, and the compiler
└── toolchain # Compilation toolchains, which contain the compiler directories, compilation options, and linking options
```
......
......@@ -102,17 +102,16 @@ It is considered best practice to learn the following basic concepts before you
build a specified product with
{product_name}@{company}, eg: ipcamera@hisilcon
-f, --full full code compilation
-n, --ndk compile ndk
```
- If you run **hb build** with no argument, the previously configured code directory, product, and options are used for the compilation.
- If you run **hb build** with no argument, the previously configured code directory, product, and options are used for the compilation. The **-f** option will delete all products to be compiled, which is equivalent to running **hb clean** and **hb build**.
- You can run **hb build** _\{component\_name\}_ to compile product components separately based on the development board and kernel set for the product, for example, **hb build kv\_store**.
- You can run **hb build -p ipcamera@hisilicon** to skip the setting step and compile the product directly.
- You can run **hb build** in **device/device\_company/board** to select the kernel and start compilation based on the current development board and the selected kernel to generate an image that contains the kernel and driver only.
4. **hb clean**
Clear the compilation result of the product in the **out** directory, and leave the **args.gn** and **build.log** files only. To clear files in a specified directory, add the directory parameter to the command, for example, **hb clean** _xxx_**/out/**_xxx_.
Clear the compilation result of the product in the **out** directory, and retain the **args.gn** and **build.log** files only. To clear files in a specified directory, add the directory parameter to the command, for example, **hb clean** _xxx_**/out/**_xxx_.
```
......
......@@ -3,7 +3,15 @@
- [When to Use](#section18502174174019)
- [Signature Verification Process](#section554632717226)
- [Available APIs](#section1633115419401)
- [How to Develop](#section4207112818418)
- [Development Procedure \(Scenario 1\)](#section4207112818418)
- [Signature Verification](#section11470123816297)
- [Self-signed Application Generation](#section167151429133312)
- [Development Examples](#section174318361353)
- [Development Procedure \(Scenario 2\)](#section81272563427)
- [Signature Verification](#section07028210442)
- [Development Examples](#section1930711345445)
- [Debugging and Verification](#section427316292411)
## When to Use<a name="section18502174174019"></a>
......@@ -23,24 +31,23 @@ After the HAP is signed, a signature block is added between the file block and t
The signature verification process consists of three steps: HAP signature verification, signature verification for the profile signature block, and profile content verification.
- HAP signature verification
The process is as follows:
1. Use the preset root certificate of the device to verify the certificate chain in the file signature block and prove that the leaf certificate is trusted.
2. Use the public key in the leaf certificate to verify the file signature block and prove that this block is not tampered with.
3. Calculate and merge the digests of the file block, central directory, and EOCD. Merge the calculation result with the digest of the profile signature block in the signature block. Then compare the merge result with the digest of the file signature block. If they are the same, the HAP signature verification is successful.
**HAP signature verification**
Use the preset root certificate of the device and the certificate chain to prove that the leaf certificate is trusted. Then use the digest obtained by decrypting the public key of the leaf certificate to prove that the HAP is not tampered with.
- Signature verification for the profile signature block
The process is as follows:
First of all, check who issued the signature of the profile signature block. If the signature was issued by the application market, the signature is trusted and does not need to be verified. Otherwise, the signature needs to be verified. Next, verify the certificate chain and then use the leaf certificate to verify the signature of the profile signature block to prove that it is not tampered with.
1. Use the preset root certificate of the device to verify the certificate chain in the file signature block and prove that the leaf certificate is trusted.
2. Use the public key in the leaf certificate to verify the file signature block and prove that this block is not tampered with.
3. Calculate and merge the digests of the file block, central directory, and EOCD. Merge the calculation result with the digest of the profile signature block in the signature block. Then compare the merge result with the digest of the file signature block. If they are the same, the HAP signature verification is successful.
**Signature verification for the profile signature block**
- Profile content verification
First of all, check who issued the signature of the profile signature block. If the signature was issued by the application market, the signature is trusted and does not need to be verified. Otherwise, the signature needs to be verified. Next, verify the certificate chain and then use the leaf certificate to verify the signature of the profile signature block to prove that it is not tampered with.
Obtain the profile and check the validity of its content. If the HAP is a debugging application, check whether the UDID of the current device is contained in the UDID list in the profile. If yes, the verification is successful. Then compare the certificate in the profile with the leaf certificate used for HAP verification \(this is not required for a released or OpenHarmony self-signed application\). If they are the same, the entire signature verification process is complete.
**Profile content verification**
Obtain the profile and check the validity of its content. If the HAP is a debugging application, check whether the UDID of the current device is contained in the UDID list in the profile. If yes, the verification is successful. Then compare the certificate in the profile with the leaf certificate used for HAP verification \(this is not required for a released or OpenHarmony self-signed application\). If they are the same, the entire signature verification process is complete.
## Available APIs<a name="section1633115419401"></a>
......@@ -74,62 +81,81 @@ The following table lists the innerkits APIs provided by the signature verificat
</tbody>
</table>
## How to Develop<a name="section4207112818418"></a>
## Development Procedure \(Scenario 1\)<a name="section4207112818418"></a>
Application signature verification applies to the following scenarios:
### Signature Verification<a name="section11470123816297"></a>
- Verification of applications released in the application market, debugging applications signed with debugging certificates of the application market, and OpenHarmony self-signed applications
- Verification of applications signed with certificates that are based on debugging root keys
Verification of applications released in the application market, debugging applications signed with debugging certificates of the application market, and OpenHarmony self-signed applications
The signature verification procedure in the first scenario is as follows:
1. Construct the **VerifyResult** structure.
1. Construct the VerifyResult structure.
```
VerifyResult verifyResult = {0};
```
2. Call the **APPVERI\_AppVerify** function by specifying the file path and **VerifyResult** to verify the application signature.
2. Call the APPVERI\_AppVerify function by specifying the file path and VerifyResult to verify the application signature.
```
int32_t ret = APPVERI_AppVerify(hapFilepath.c_str(), &verifyResult);
```
3. Check the returned result. If the verification is successful, obtain and process the data in **VerifyResult**.
3. Check the returned result. If the verification is successful, obtain and process the data in VerifyResult.
```
signatureInfo.appId = verifyResult.profile.appid;
signatureInfo.provisionBundleName = verifyResult.profile.bundleInfo.bundleName;
```
4. Call the **APPVERI\_FreeVerifyRst** function to release memory in **VerifyResult**.
4. Call the APPVERI\_FreeVerifyRst function to release memory in VerifyResult.
```
APPVERI_FreeVerifyRst(&verifyResult);
```
>![](public_sys-resources/icon-note.gif) **NOTE:**
>To obtain a OpenHarmony self-signed application, prepare the signature tool, system application HAP, system application profile \(\*.p7b\), signing certificate \(\*.cer\), and signing public/private key pair \(\*.jks\).
>After obtaining the preceding materials, perform the following operations:
>1. Place all the materials in the same directory and start the shell.
>2. Run the following command in the shell to sign the application:
> ```
> java -jar hapsigntoolv2.jar sign -mode localjks -privatekey "OpenHarmony Software Signature" -inputFile camera.hap -outputFile signed_camera.hap -signAlg SHA256withECDSA -keystore OpenHarmony.jks -keystorepasswd 123456 -keyaliaspasswd 123456 -profile camera_release.p7b -certpath OpenHarmony.cer -profileSigned 1
> ```
> Key fields:
> **-jar**: signature tool, which is **[hapsigntool](https://repo.huaweicloud.com/harmonyos/develop_tools/hapsigntoolv2.jar)**
> **-mode**: local signature flag, which is fixed at **localjks**
> **-privatekey**: alias of the public/private key pair, which is **OpenHarmony Software Signature**
> **-inputFile**: application to be signed, which is generated through compilation
> **-outputFile**: signed application
> **-signAlg**: signing algorithm, which is fixed at **SHA256withECDSA**
> **-keystore**: public/private key pair, which is **[OpenHarmony.jks](https://gitee.com/openharmony/security_services_app_verify/blob/master/OpenHarmonyCer/OpenHarmony.jks)** in the **OpenHarmonyCer** directory of the **security\_services\_app\_verify** repository. The default password is **123456**. You can use a tool \(such as keytool\) to change the password.
> **-keystorepasswd**: password of the public/private key pair, which is **123456** by default
> **-keyaliaspasswd**: password of the public/private key pair alias, which is **123456** by default
> **-profile**: application profile, which is stored in the code directory
> **-certpath**: signing certificate, which is **[OpenHarmony.cer](https://gitee.com/openharmony/security_services_app_verify/blob/master/OpenHarmonyCer/OpenHarmony.cer)** in the **OpenHarmonyCer** directory of the **security\_services\_app\_verify** repository.
> **-profileSigned**: whether the signature block contains the profile. The value is fixed at **1**, indicating that the signature block contains the profile.
### OpenHarmony Self-signed Application Generation<a name="section167151429133312"></a>
The OpenHarmony self-signed application generation procedure is as follows:
1. Prepare required materials.
Prepare the signature tool, system application HAP, system application profile \(\*.p7b\), signing certificate \(\*.cer\), and signing public/private key pair \(\*.jks\).
2. Place all the materials in the same directory and start the shell.
3. Run the following command in the shell to sign the application:
```
java -jar hapsigntoolv2.jar sign -mode localjks -privatekey "OpenHarmony Software Signature" -inputFile camera.hap -outputFile signed_camera.hap -signAlg SHA256withECDSA -keystore OpenHarmony.jks -keystorepasswd 123456 -keyaliaspasswd 123456 -profile camera_release.p7b -certpath OpenHarmony.cer -profileSigned 1
```
Key fields:
**-jar**: signature tool, which is **[hapsigntool](https://repo.huaweicloud.com/harmonyos/develop_tools/hapsigntoolv2.jar)**
**-mode**: local signature flag, which is fixed at **localjks**
**-privatekey**: alias of the public/private key pair, which is **OpenHarmony Software Signature**
**-inputFile**: application to be signed, which is generated through compilation
**-outputFile**: signed application
**-signAlg**: signing algorithm, which is fixed at **SHA256withECDSA**
**-keystore**: public/private key pair, which is [OpenHarmony.jks](https://gitee.com/openharmony/security_appverify/blob/master/interfaces/innerkits/appverify_lite/OpenHarmonyCer/OpenHarmony.jks) in the **OpenHarmonyCer** directory of the **security\_services\_app\_verify** repository. The default password is **123456**. You can use a tool \(such as keytool\) to change the password.
**-keystorepasswd**: password of the public/private key pair, which is **123456** by default
**-keyaliaspasswd**: password of the public/private key pair alias, which is **123456** by default
**-profile**: application profile, which is stored in the code directory
**-certpath**: signing certificate, which is [OpenHarmony.cer](https://gitee.com/openharmony/security_appverify/blob/master/interfaces/innerkits/appverify_lite/OpenHarmonyCer/OpenHarmony.cer) in the **OpenHarmonyCer** directory of the **security\_services\_app\_verify** repository.
**-profileSigned**: whether the signature block contains the profile. The value is fixed at **1**, indicating that the signature block contains the profile.
### Development Examples<a name="section174318361353"></a>
The following example describes how the application management framework component verifies the signature of an application during its installation.
......@@ -160,9 +186,13 @@ uint8_t HapSignVerify::VerifySignature(const std::string &hapFilepath, Signature
}
```
The signature verification procedure in the second scenario is as follows:
## Development Procedure \(Scenario 2\)<a name="section81272563427"></a>
1. Call the **APPVERI\_SetDebugMode\(true\)** function to enable debugging mode.
### Signature Verification<a name="section07028210442"></a>
The procedure is as follows:
1. Call the APPVERI\_SetDebugMode\(true\) function to enable the debugging mode.
```
ManagerService::SetDebugMode(true);
......@@ -181,13 +211,15 @@ The signature verification procedure in the second scenario is as follows:
```
2. Construct the **VerifyResult** structure, verify the application signature, and release memory in **VerifyResult**.
3. Call the **APPVERI\_SetDebugMode\(false\)** function to disable debugging mode.
3. Call the APPVERI\_SetDebugMode\(false\) function to disable the debugging mode.
```
ManagerService::SetDebugMode(false);
```
### Development Examples<a name="section1930711345445"></a>
The following is the example code \(supplemented based on the example code for scenario 1\):
```
......
# OpenHarmony 1.0.1 \(2021-03-15\)<a name="EN-US_TOPIC_0000001125880475"></a>
- [Overview](#section1677664815431)
- [Source Code Acquisition](#section84808293211)
- [Acquiring Source Code from an Image Site](#section19634542131218)
- [Acquiring Source Code Using the repo Command](#section7180193542317)
- [Kernel](#section11256141314463)
- [New Features](#section1834713384464)
- [Modified Features](#section6894155811483)
......@@ -59,6 +63,80 @@
OpenHarmony 1.0.1 supports more subsystems, including the AI, power management, pan-sensor, and update subsystems, and provides a unified AI engine framework. The LiteOS Cortex-M kernel has been reconstructed for porting third-party chips to OpenHarmony. The driver subsystem provides models for the WLAN, sensor, input, and display drivers. The graphics subsystem has been optimized for an enhanced UI and improved performance and memory for the JS application framework. In addition, the directory structure and module repositories have been significantly improved.
## Source Code Acquisition<a name="section84808293211"></a>
### Acquiring Source Code from an Image Site<a name="section19634542131218"></a>
**Table 1** Sites for acquiring source code
<a name="table37071442171217"></a>
<table><thead align="left"><tr id="row20705154220120"><th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.1"><p id="p67051342151216"><a name="p67051342151216"></a><a name="p67051342151216"></a>Source Code</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.2"><p id="p470519425129"><a name="p470519425129"></a><a name="p470519425129"></a>Version Information</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.3"><p id="p8705194271212"><a name="p8705194271212"></a><a name="p8705194271212"></a>Site</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.4"><p id="p1270594241219"><a name="p1270594241219"></a><a name="p1270594241219"></a>SHA-256 Verification Code</p>
</th>
</tr>
</thead>
<tbody><tr id="row470516428125"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1870564214123"><a name="p1870564214123"></a><a name="p1870564214123"></a>Full code base</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p270504214125"><a name="p270504214125"></a><a name="p270504214125"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p1170554201212"><a name="p1170554201212"></a><a name="p1170554201212"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p97051842101210"><a name="p97051842101210"></a><a name="p97051842101210"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 verification code</a></p>
</td>
</tr>
<tr id="row11706164211210"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p77051425121"><a name="p77051425121"></a><a name="p77051425121"></a>Hi3861 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p16705154215126"><a name="p16705154215126"></a><a name="p16705154215126"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p19705194241214"><a name="p19705194241214"></a><a name="p19705194241214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/wifiiot-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p1570554271214"><a name="p1570554271214"></a><a name="p1570554271214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 verification code</a></p>
</td>
</tr>
<tr id="row5706142101219"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p10706542191212"><a name="p10706542191212"></a><a name="p10706542191212"></a>Hi3518 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p10706842121215"><a name="p10706842121215"></a><a name="p10706842121215"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p670610421126"><a name="p670610421126"></a><a name="p670610421126"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3518ev300-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p47060422121"><a name="p47060422121"></a><a name="p47060422121"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3518ev300-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 verification code</a></p>
</td>
</tr>
<tr id="row167061942121218"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p17706442161215"><a name="p17706442161215"></a><a name="p17706442161215"></a>Hi3516 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p170674212126"><a name="p170674212126"></a><a name="p170674212126"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p47061428127"><a name="p47061428127"></a><a name="p47061428127"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3516dv300-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p107061642151219"><a name="p107061642151219"></a><a name="p107061642151219"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3516dv300-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 verification code</a></p>
</td>
</tr>
<tr id="row7706342101215"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1070654251210"><a name="p1070654251210"></a><a name="p1070654251210"></a>RELEASE-NOTES</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p47061142101217"><a name="p47061142101217"></a><a name="p47061142101217"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p97068428123"><a name="p97068428123"></a><a name="p97068428123"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/OpenHarmony_Release_Notes_zh_cn.zip" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p9706642151212"><a name="p9706642151212"></a><a name="p9706642151212"></a>-</p>
</td>
</tr>
</tbody>
</table>
### Acquiring Source Code Using the repo Command<a name="section7180193542317"></a>
The download command is as follows:
```
repo init -u [https://gitee.com/openharmony/manifest.git](https://gitee.com/openharmony/manifest.git) -b OpenHarmony_1.0.1_release --no-repo-verify
repo sync -c
```
## Kernel<a name="section11256141314463"></a>
### New Features<a name="section1834713384464"></a>
......@@ -163,7 +241,7 @@ OpenHarmony 1.0.1 supports more subsystems, including the AI, power management,
### New Features<a name="section35351941175420"></a>
- HUKS provides the SHA-256, RSA-3072, RSA-2048, AES-128, and ECC security algorithms and APIs, as well as key management and storage.
- The lightweight HiChain is available for managing and authenticating device groups, and ensuring the communication security based on the Intelligent Soft Bus. It does not require device login using an account. It also provides APIs for system services and applications.
- The lightweight HiChain is available for managing and authenticating device groups without requiring login to devices using the same account, and for ensuring the communication security based on the Intelligent Soft Bus. It also provides APIs for system services and applications.
- A unified permission management system has been added to manage permissions for lightweight devices.
## AI<a name="section11847124175419"></a>
......
# OpenHarmony 1.0 \(2020-09-10\)<a name="EN-US_TOPIC_0000001079132978"></a>
OpenHarmony 1.0 is the initial release for this product.
- [Overview](#section249611124916)
- [Source Code Acquisition](#section127301717165113)
- [Acquiring Source Code from an Image Site](#section157648475298)
- [Acquiring Source Code Using the repo Tool](#section49746186307)
## Overview<a name="section249611124916"></a>
This is the initial release for this product.
## Source Code Acquisition<a name="section127301717165113"></a>
### Acquiring Source Code from an Image Site<a name="section157648475298"></a>
**Table 1** Sites for acquiring source code
<a name="table91984129177"></a>
<table><thead align="left"><tr id="row51981312101713"><th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.1"><p id="p16618172471719"><a name="p16618172471719"></a><a name="p16618172471719"></a>Source Code</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.2"><p id="p46181224161718"><a name="p46181224161718"></a><a name="p46181224161718"></a>Version Information</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.3"><p id="p1461814241177"><a name="p1461814241177"></a><a name="p1461814241177"></a>Site</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.4"><p id="p12618192481716"><a name="p12618192481716"></a><a name="p12618192481716"></a>SHA-256 Verification Code</p>
</th>
</tr>
</thead>
<tbody><tr id="row174961746125013"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p697315226515"><a name="p697315226515"></a><a name="p697315226515"></a>Full code base</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p1997312229519"><a name="p1997312229519"></a><a name="p1997312229519"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p1797320223518"><a name="p1797320223518"></a><a name="p1797320223518"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p6973102210516"><a name="p6973102210516"></a><a name="p6973102210516"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row1049714618507"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p14973722165114"><a name="p14973722165114"></a><a name="p14973722165114"></a>Hi3861 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p1361982418176"><a name="p1361982418176"></a><a name="p1361982418176"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p797314223515"><a name="p797314223515"></a><a name="p797314223515"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/wifiiot-1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p5973422115112"><a name="p5973422115112"></a><a name="p5973422115112"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/wifiiot-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row7498114620508"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1097311229513"><a name="p1097311229513"></a><a name="p1097311229513"></a>Hi3518 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p0619122471719"><a name="p0619122471719"></a><a name="p0619122471719"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p19973222165111"><a name="p19973222165111"></a><a name="p19973222165111"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3518ev300-1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p10973722105113"><a name="p10973722105113"></a><a name="p10973722105113"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3518ev300-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row19498194619507"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p8973202285119"><a name="p8973202285119"></a><a name="p8973202285119"></a>Hi3516 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p10619182441718"><a name="p10619182441718"></a><a name="p10619182441718"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p497442295116"><a name="p497442295116"></a><a name="p497442295116"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3516dv300-1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p1997442295110"><a name="p1997442295110"></a><a name="p1997442295110"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3516dv300-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row14989469503"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p997482215517"><a name="p997482215517"></a><a name="p997482215517"></a>RELEASE-NOTES</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p176191824181712"><a name="p176191824181712"></a><a name="p176191824181712"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p697413223518"><a name="p697413223518"></a><a name="p697413223518"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/RELEASE-NOTES.txt" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p15974222165114"><a name="p15974222165114"></a><a name="p15974222165114"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
### Acquiring Source Code Using the repo Tool<a name="section49746186307"></a>
Method 1 \(recommended\): Use the **repo** tool to download the source code.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
```
Method 2: Run the **git clone** command to clone a single code repository.
Go to the [code repository homepage](https://gitee.com/openharmony), select the code repository to be cloned, and run the following command:
```
git clone https://gitee.com/openharmony/manifest.git -b master
```
# OpenHarmony Release Notes
- [OpenHarmony 1.0.1 \(2021-03-15\)](OpenHarmony-1-0-1.md)
- [OpenHarmony 1.0 \(2020-09-10\)](OpenHarmony-1-0.md)
- [OpenHarmony 1.1.0 LTS \(2021-04-01\)](openharmony-1-1-0-lts.md)
- [OpenHarmony 1.0.1 \(2021-03-15\)](openharmony-1-0-1.md)
- [OpenHarmony 1.0 \(2020-09-10\)](openharmony-1-0.md)
# OpenHarmony 1.1.0 LTS \(2021-04-01\)<a name="EN-US_TOPIC_0000001095652840"></a>
- [Overview](#section1846294912228)
- [Source Code Acquisition](#section84808293211)
- [Acquiring Source Code from Image Sites](#section19634542131218)
- [Acquiring Source Code Using the repo Tool](#section7180193542317)
- [Rectified Issues](#section11935243172612)
## Overview<a name="section1846294912228"></a>
This is the first LTS version of OpenHarmony. This version fixes some bugs in OpenHarmony 1.0.1.
## Source Code Acquisition<a name="section84808293211"></a>
### Acquiring Source Code from Image Sites<a name="section19634542131218"></a>
**Table 1** Sites for acquiring source code
<a name="table37071442171217"></a>
<table><thead align="left"><tr id="row20705154220120"><th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.1"><p id="p67051342151216"><a name="p67051342151216"></a><a name="p67051342151216"></a>Source Code</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.2"><p id="p470519425129"><a name="p470519425129"></a><a name="p470519425129"></a>Version Information</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.3"><p id="p8705194271212"><a name="p8705194271212"></a><a name="p8705194271212"></a>Site</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.4"><p id="p1270594241219"><a name="p1270594241219"></a><a name="p1270594241219"></a>SHA-256 Verification Code</p>
</th>
</tr>
</thead>
<tbody><tr id="row470516428125"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1870564214123"><a name="p1870564214123"></a><a name="p1870564214123"></a>Full code base</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p270504214125"><a name="p270504214125"></a><a name="p270504214125"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p1170554201212"><a name="p1170554201212"></a><a name="p1170554201212"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/code-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p97051842101210"><a name="p97051842101210"></a><a name="p97051842101210"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/code-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row11706164211210"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p77051425121"><a name="p77051425121"></a><a name="p77051425121"></a>Hi3861 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p16705154215126"><a name="p16705154215126"></a><a name="p16705154215126"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p19705194241214"><a name="p19705194241214"></a><a name="p19705194241214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/wifiiot-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p1570554271214"><a name="p1570554271214"></a><a name="p1570554271214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/code-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row5706142101219"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p10706542191212"><a name="p10706542191212"></a><a name="p10706542191212"></a>Hi3518 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p10706842121215"><a name="p10706842121215"></a><a name="p10706842121215"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p670610421126"><a name="p670610421126"></a><a name="p670610421126"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3518ev300-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p47060422121"><a name="p47060422121"></a><a name="p47060422121"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3518ev300-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row167061942121218"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p17706442161215"><a name="p17706442161215"></a><a name="p17706442161215"></a>Hi3516 solution (binary)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p170674212126"><a name="p170674212126"></a><a name="p170674212126"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p47061428127"><a name="p47061428127"></a><a name="p47061428127"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3516dv300-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p107061642151219"><a name="p107061642151219"></a><a name="p107061642151219"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3516dv300-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA-256 verification code</a></p>
</td>
</tr>
<tr id="row7706342101215"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1070654251210"><a name="p1070654251210"></a><a name="p1070654251210"></a>RELEASE-NOTES</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p47061142101217"><a name="p47061142101217"></a><a name="p47061142101217"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p97068428123"><a name="p97068428123"></a><a name="p97068428123"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/OpenHarmony_Release_Notes_zh_cn.zip" target="_blank" rel="noopener noreferrer">Site</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p9706642151212"><a name="p9706642151212"></a><a name="p9706642151212"></a>N/A</p>
</td>
</tr>
</tbody>
</table>
### Acquiring Source Code Using the repo Tool<a name="section7180193542317"></a>
Run the following commands to download the source code:
```
repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony_release_v1.1.0 --no-repo-verify
repo sync -c
```
## Rectified Issues<a name="section11935243172612"></a>
The following table lists the issues that have been resolved in this version.
**Table 2** Resolved issues
<a name="table1934113413913"></a>
<table><thead align="left"><tr id="row4341334203914"><th class="cellrowborder" valign="top" width="22.650000000000002%" id="mcps1.2.3.1.1"><p id="p711564410397"><a name="p711564410397"></a><a name="p711564410397"></a>Issue</p>
</th>
<th class="cellrowborder" valign="top" width="77.35%" id="mcps1.2.3.1.2"><p id="p411564416397"><a name="p411564416397"></a><a name="p411564416397"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row934223410393"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p133271454113911"><a name="p133271454113911"></a><a name="p133271454113911"></a><a href="https://gitee.com/openharmony/multimedia_camera_lite/issues/I3EALU" target="_blank" rel="noopener noreferrer">I3EALU</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p1132775483917"><a name="p1132775483917"></a><a name="p1132775483917"></a>[Multimedia] When the cameraActs cases are executed, the camera configuration file cannot be found, and the initialization fails.</p>
</td>
</tr>
<tr id="row0342133417396"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p153278540395"><a name="p153278540395"></a><a name="p153278540395"></a><a href="https://gitee.com/openharmony/drivers_adapter_khdf_liteos/issues/I3D71U" target="_blank" rel="noopener noreferrer">I3D71U</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p93271254153915"><a name="p93271254153915"></a><a name="p93271254153915"></a>[Driver] When the system is reset repeatedly and started successfully by hmac_main_init, there is a high possibility that the system is suspended.</p>
</td>
</tr>
<tr id="row8342934173920"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p7328145410392"><a name="p7328145410392"></a><a name="p7328145410392"></a><a href="https://gitee.com/openharmony/community/issues/I3EGUX" target="_blank" rel="noopener noreferrer">I3EGUX</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p9328654193918"><a name="p9328654193918"></a><a name="p9328654193918"></a>[Reliability issue] When the system is reset repeatedly, and the KIdle process crashes once, the system is suspended and cannot be started.</p>
</td>
</tr>
<tr id="row034213453916"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p132875473912"><a name="p132875473912"></a><a name="p132875473912"></a><a href="https://gitee.com/openharmony/community/issues/I3DHIL" target="_blank" rel="noopener noreferrer">I3DHIL</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p17328105420391"><a name="p17328105420391"></a><a name="p17328105420391"></a>[System issue] The remaining space of the open-source Hi3518 development board is insufficient. As a result, a large number of ACTS test cases fail.</p>
</td>
</tr>
</tbody>
</table>
......@@ -208,9 +208,9 @@ OpenHarmony的Docker镜像托管在[HuaweiCloud SWR](https://console.huaweicloud
## 获取设备开发工具(HUAWEI DevEco Device Tool)<a name="zh-cn_topic_0000001055701144_section2452141120244"></a>
HUAWEI DevEco Device Tool是HarmonyOS面向智能设备开发者提供的一站式集成开发环境,支持HarmonyOS的组件按需定制,支持代码编辑、编译、烧录、调试等功能,支持C/C++语言,以插件的形式部署在Visual Studio Code上。具体可参见[获取工具](https://device.harmonyos.com/cn/ide)[工具使用指南](https://device.harmonyos.com/cn/docs/ide/user-guides/service_introduction-0000001050166905)**。**
HUAWEI DevEco Device Tool是OpenHarmony面向智能设备开发者提供的一站式集成开发环境,支持OpenHarmony的组件按需定制,支持代码编辑、编译、烧录、调试等功能,支持C/C++语言,以插件的形式部署在Visual Studio Code上。具体可参见[获取工具](https://device.harmonyos.com/cn/ide)[工具使用指南](https://device.harmonyos.com/cn/docs/ide/user-guides/service_introduction-0000001050166905)**。**
## 获取应用开发工具(HUAWEI DevEco Studio)<a name="zh-cn_topic_0000001055701144_section0904101019258"></a>
HUAWEI DevEco Studio(以下简称DevEco Studio)是面向华为终端全场景多设备的一站式集成开发环境(IDE),为开发者提供工程模板创建、开发、编译、调试、发布等E2E的HarmonyOS应用开发服务。通过使用DevEco Studio,开发者可以更高效的开发具备HarmonyOS分布式能力的应用,进而提升创新效率。具体可参见[获取工具](https://developer.harmonyos.com/cn/develop/deveco-studio)[工具使用指南](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/tools_overview-0000001053582387)
HUAWEI DevEco Studio(以下简称DevEco Studio)是面向华为终端全场景多设备的一站式集成开发环境(IDE),为开发者提供工程模板创建、开发、编译、调试、发布等E2E的OpenHarmony应用开发服务。通过使用DevEco Studio,开发者可以更高效的开发具备OpenHarmony分布式能力的应用,进而提升创新效率。具体可参见[获取工具](https://developer.harmonyos.com/cn/develop/deveco-studio)[工具使用指南](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/tools_overview-0000001053582387)
......@@ -24,7 +24,7 @@ HAL层主要功能是实现轻OpenHarmony与芯片的解耦,以下模块描述
**IOT外设子系统HAL层接口说明**:
需要芯片适配相关接口的实现,对芯片设备外设接口依赖请参考[wifiiot的HAL头文件](https://gitee.com/openharmony/iothardware_hals_wifiiot_lite/tree/master)
需要芯片适配相关接口的实现,对芯片设备外设接口依赖请参考[IOT外设子系统的HAL头文件](https://gitee.com/openharmony/iothardware_peripheral/tree/master/interfaces/kits)
## WLAN服务<a name="section1331917210911"></a>
......@@ -70,5 +70,5 @@ vendor/hisi/hi3861/hi3861_adapter/hals/communication/wifi_lite/wifiservice/
└── wifi_hotspot.c
```
需要芯片适配相关接口的实现,对芯片设备外设接口依赖请参考[WLAN服务的头文件](https://gitee.com/openharmony/communication_interfaces_kits_wifi_lite/tree/master/wifiservice)
需要芯片适配相关接口的实现,对芯片设备外设接口依赖请参考[WLAN服务的头文件](https://gitee.com/openharmony/communication_wifi_lite/tree/master/interfaces/wifiservice)
......@@ -5,7 +5,7 @@
## 编译构建流程<a name="section1111311235313"></a>
编译构建系统是一个基于gn和ninja组件化构建系统,支持按组件配置、裁剪和拼装,按需构建出定制化的产品。编译构建流程如下:
编译构建系统是一个基于gn和ninja组件化构建系统,支持按组件配置、裁剪和拼装,按需构建出定制化的产品。编译构建流程如下:
**图 1** 编译构建流程<a name="fig23781931124913"></a>
![](figures/编译构建流程.png "编译构建流程")
......@@ -15,7 +15,7 @@
>![](public_sys-resources/icon-note.gif) **说明:**
>编译类型debug选项涉及到XTS的测试用例是否参与编译;release选项会移除最后编译生成文件的符号表、调试信息等
- 读取产品配置:读取解决方案厂商的产品配置文件vendor/x\_company/x\_product.json文件,主要包括开发板、内核类型、内核版本和配置的组件。
- 读取产品配置:读取解决方案厂商的产品配置文件vendor/my\_company/my\_product.json文件,主要包括开发板、内核类型、内核版本和配置的组件。
- gn生成ninja文件:根据产品的配置解析结果,按对应的编译工具链将所选组件加入编译,配置全局的编译选项。
- 执行ninja启动编译:组件逐个编译和链接。
......@@ -25,7 +25,7 @@ gn语法和基础知识请参见官方[快速入门](https://gn.googlesource.com
首先,创建开发板目录,以芯片厂商realtek的“rtl8720“开发板为例,需创建device/realtek/rtl8720目录。编译相关的适配步骤如下:
1. 编译工具链和编译选项配置
1. 编译工具链和编译选项配置
构建系统默认使用ohos-clang编译工具链,也支持芯片厂商按开发板自定义配置。开发板编译配置文件编译相关的变量如下:
......@@ -43,14 +43,14 @@ gn语法和基础知识请参见官方[快速入门](https://gn.googlesource.com
编译构建会按产品的选择的开发板,加载对应的config.gni,该文件中变量对系统组件全局可见。
以芯片厂商realtek的“rtl8720“开发板为例,device/realtek/rtl8720/liteos\_m/config.gni如下:
以芯片厂商realtek的“rtl8720“开发板为例,device/realtek/rtl8720/liteos\_m/config.gni的内容如下:
```
# Kernel type, e.g. "linux", "liteos_a", "liteos_m".
kernel_type = "liteos_m"
# Kernel version.
kernel_version = ""
kernel_version = "3.0.0"
# Board CPU type, e.g. "cortex-a7", "riscv32".
board_cpu = "real-m300"
......@@ -80,20 +80,59 @@ gn语法和基础知识请参见官方[快速入门](https://gn.googlesource.com
board_ld_flags = []
```
2. 开发板编译脚本
2. 开发板编译脚本
新增的开发板,对应目录下需要新增BUILD.gn文件作为开发板编译的总入口。以芯片厂商realtek的rtl8720开发板为例,对应的device/realtek/rtl8720/BUILD.gn为:
```
group("rlt8720") {
group("rtl8720") {
...
}
```
3. 编译调试
3. 编译调试开发板。
1. 任意目录执行hb set按提示设置源码路径和要编译的产品。
2. 在开发板目录下执行hb build, 即可启动开发板的编译。
4. 编译调试产品
将开发板和组件信息写入产品配置文件,该配置文件字段说明如下:
- product\_name:产品名称,支持自定义,建议与vendor下的三级目录名称一致。
- ohos\_version:OpenHarmony版本号,应与实际下载的版本一致。
- device\_company:芯片解决方案厂商名称,建议与device的二级目录名称一致。
- board:开发板名称,建议与device的三级级目录名称一致。
- kernel\_type:内核类型,应与开发板支持的内核类型匹配。
- kernel\_version:内核版本号,应与开发板支持的内核版本匹配。
- subsystem:产品选择的子系统,应为OS支持的子系统,OS支持的子系统请见build/lite/components目录下的各子系统描述文件。
- components:产品选择的某个子系统下的组件,应为某个子系统支持的组件,子系统支持的组件请见build/lite/components/子系统.json文件。
- features:产品配置的某个组件的特性,组件支持的特性请见build/lite/components/子系统.json中对应组件的features字段。
以基于“rtl8720“开发板的wifiiot模组为例,vendor/my\_company/wifiiot/config.json如下:
```
{
"product_name": "wifiiot", # 产品名称
"ohos_version": "OpenHarmony 1.0", # 使用的OS版本
"device_company": "realtek", # 芯片解决方案厂商名称
"board": "rtl8720", # 开发板名称
"kernel_type": "liteos_m", # 选择的内核类型
"kernel_version": "3.0.0", # 选择的内核版本
"subsystems": [
{
"subsystem": "kernel", # 选择的子系统
"components": [
{ "component": "liteos_m", "features":[] } # 选择的组件和组件特性
]
},
...
{
更多子系统和组件
}
]
}
```
......@@ -6,6 +6,8 @@
- [软件要求](#section965634210501)
- [安装Linux编译环境](#section182916865219)
- [将Linux shell改为bash](#section1715027152617)
- [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section45512412251)
- [安装文件打包工具](#section8352161417450)
- [安装hc-gen](#section2075110583451)
- [安装Java 虚拟机环境](#section101989994613)
......@@ -39,31 +41,45 @@ Hi3516开发板对Linux服务器通用环境配置需要的工具及其获取途
**表 1** Linux服务器开发工具及获取途径
<a name="table6299192712513"></a>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="22.152215221522155%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>开发工具</p>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="25.112511251125113%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>开发工具</p>
</th>
<th class="cellrowborder" valign="top" width="18.09180918091809%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
<th class="cellrowborder" valign="top" width="15.13151315131513%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
</th>
<th class="cellrowborder" valign="top" width="59.75597559755976%" id="mcps1.2.4.1.3"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>获取途径</p>
</th>
</tr>
</thead>
<tbody><tr id="row76242594498"><td class="cellrowborder" valign="top" width="22.152215221522155%" headers="mcps1.2.4.1.1 "><p id="p1682494111548"><a name="p1682494111548"></a><a name="p1682494111548"></a>dosfstools、mtools、mtd-utils</p>
<tbody><tr id="row167343191518"><td class="cellrowborder" valign="top" width="25.112511251125113%" headers="mcps1.2.4.1.1 "><p id="p467443191517"><a name="p467443191517"></a><a name="p467443191517"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="18.09180918091809%" headers="mcps1.2.4.1.2 "><p id="p1362445934918"><a name="p1362445934918"></a><a name="p1362445934918"></a>文件打包工具</p>
<td class="cellrowborder" valign="top" width="15.13151315131513%" headers="mcps1.2.4.1.2 "><p id="p0674153114151"><a name="p0674153114151"></a><a name="p0674153114151"></a>命令行处理工具</p>
</td>
<td class="cellrowborder" valign="top" width="59.75597559755976%" headers="mcps1.2.4.1.3 "><p id="p1262475944916"><a name="p1262475944916"></a><a name="p1262475944916"></a>通过apt-get install安装</p>
<td class="cellrowborder" valign="top" width="59.75597559755976%" headers="mcps1.2.4.1.3 "><p id="p116746312151"><a name="p116746312151"></a><a name="p116746312151"></a>系统配置</p>
</td>
</tr>
<tr id="row18516509507"><td class="cellrowborder" valign="top" width="22.152215221522155%" headers="mcps1.2.4.1.1 "><p id="p14521650135017"><a name="p14521650135017"></a><a name="p14521650135017"></a>hc-gen</p>
<tr id="row14885193315201"><td class="cellrowborder" valign="top" width="25.112511251125113%" headers="mcps1.2.4.1.1 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>编译基础软件包(仅ubuntu 20+需要)</p>
</td>
<td class="cellrowborder" valign="top" width="18.09180918091809%" headers="mcps1.2.4.1.2 "><p id="p125255010501"><a name="p125255010501"></a><a name="p125255010501"></a>驱动配置编译工具</p>
<td class="cellrowborder" valign="top" width="15.13151315131513%" headers="mcps1.2.4.1.2 "><p id="p258814561424"><a name="p258814561424"></a><a name="p258814561424"></a>编译依赖的基础软件包</p>
</td>
<td class="cellrowborder" valign="top" width="59.75597559755976%" headers="mcps1.2.4.1.3 "><p id="p1749611716181"><a name="p1749611716181"></a><a name="p1749611716181"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row52253812238"><td class="cellrowborder" valign="top" width="25.112511251125113%" headers="mcps1.2.4.1.1 "><p id="p28007392236"><a name="p28007392236"></a><a name="p28007392236"></a>dosfstools、mtools、mtd-utils</p>
</td>
<td class="cellrowborder" valign="top" width="15.13151315131513%" headers="mcps1.2.4.1.2 "><p id="p98008390232"><a name="p98008390232"></a><a name="p98008390232"></a>文件打包工具</p>
</td>
<td class="cellrowborder" valign="top" width="59.75597559755976%" headers="mcps1.2.4.1.3 "><p id="p280018394233"><a name="p280018394233"></a><a name="p280018394233"></a>通过apt-get install安装</p>
</td>
</tr>
<tr id="row18516509507"><td class="cellrowborder" valign="top" width="25.112511251125113%" headers="mcps1.2.4.1.1 "><p id="p14521650135017"><a name="p14521650135017"></a><a name="p14521650135017"></a>hc-gen</p>
</td>
<td class="cellrowborder" valign="top" width="15.13151315131513%" headers="mcps1.2.4.1.2 "><p id="p125255010501"><a name="p125255010501"></a><a name="p125255010501"></a>驱动配置编译工具</p>
</td>
<td class="cellrowborder" valign="top" width="59.75597559755976%" headers="mcps1.2.4.1.3 "><p id="p145061517114519"><a name="p145061517114519"></a><a name="p145061517114519"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar</a></p>
</td>
</tr>
<tr id="row29204072315"><td class="cellrowborder" valign="top" width="22.152215221522155%" headers="mcps1.2.4.1.1 "><p id="p5921190162318"><a name="p5921190162318"></a><a name="p5921190162318"></a>Java 虚拟机环境</p>
<tr id="row29204072315"><td class="cellrowborder" valign="top" width="25.112511251125113%" headers="mcps1.2.4.1.1 "><p id="p5921190162318"><a name="p5921190162318"></a><a name="p5921190162318"></a>Java 虚拟机环境</p>
</td>
<td class="cellrowborder" valign="top" width="18.09180918091809%" headers="mcps1.2.4.1.2 "><p id="p17921110152311"><a name="p17921110152311"></a><a name="p17921110152311"></a>编译、调试和运行Java程序</p>
<td class="cellrowborder" valign="top" width="15.13151315131513%" headers="mcps1.2.4.1.2 "><p id="p17921110152311"><a name="p17921110152311"></a><a name="p17921110152311"></a>编译、调试和运行Java程序</p>
</td>
<td class="cellrowborder" valign="top" width="59.75597559755976%" headers="mcps1.2.4.1.3 "><p id="p16921805237"><a name="p16921805237"></a><a name="p16921805237"></a>通过apt-get install安装</p>
</td>
......@@ -77,6 +93,37 @@ Hi3516开发板对Linux服务器通用环境配置需要的工具及其获取途
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装LLVM、hc-gen编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装LLVM、hc-gen编译工具。安装LLVM、hc-gen编译工具时,请确保编译工具的环境变量路径唯一。
### 将Linux shell改为bash<a name="section1715027152617"></a>
查看shell是否为bash,在终端运行如下命令
```
ls -l /bin/sh
```
如果显示为“/bin/sh -\> bash”则为正常,否则请按以下方式修改:
**方法一**:在终端运行如下命令,然后选择 no。
```
sudo dpkg-reconfigure dash
```
**方法二**:先删除sh,再创建软链接。
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### 安装编译依赖基础软件(仅Ubuntu 20+需要)<a name="section45512412251"></a>
执行以下命令进行安装:
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### 安装文件打包工具<a name="section8352161417450"></a>
1. 打开Linux编译服务器终端。
......
# Hi3518搭建环境<a name="ZH-CN_TOPIC_0000001054022306"></a>
- [前提条件](#section2074878255)
- [Hi3518环境搭建](#section1724111409282)
- [硬件要求](#section487353718276)
- [软件要求](#section17315193935817)
- [安装Linux编译环境](#section8831868501)
- [将Linux shell改为bash](#section1715027152617)
- [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section45512412251)
- [安装文件打包工具](#section480195453419)
- [安装hc-gen](#section351420104218)
## 前提条件<a name="section2074878255"></a>
Hi3518环境搭建前,请先完成[搭建系统基础环境](搭建系统基础环境.md)
## Hi3518环境搭建<a name="section1724111409282"></a>
### 硬件要求<a name="section487353718276"></a>
- Hi3518EV300 IoT Camera开发板
- USB转串口线、网线(Windows工作台通过USB转串口线、网线与开发板连接)
各硬件连接关系如下图所示。
**图 1** 硬件连线图<a name="fig8211468392"></a>
![](figures/硬件连线图.png "硬件连线图")
### 软件要求<a name="section17315193935817"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>本节描述安装包方式搭建编译环境的操作步骤。如果是Docker方式安装编译环境,请跳过此章节以及下述安装Linux编译环境章节。
Hi3518开发板对Linux服务器通用环境配置需要的工具及其获取途径如下表所示。
**表 1** Linux服务器开发工具及获取途径
<a name="table15485545145811"></a>
<table><thead align="left"><tr id="row1748610451588"><th class="cellrowborder" valign="top" width="23.332333233323332%" id="mcps1.2.4.1.1"><p id="p13486154545816"><a name="p13486154545816"></a><a name="p13486154545816"></a>开发工具</p>
</th>
<th class="cellrowborder" valign="top" width="14.65146514651465%" id="mcps1.2.4.1.2"><p id="p44867452589"><a name="p44867452589"></a><a name="p44867452589"></a>用途</p>
</th>
<th class="cellrowborder" valign="top" width="62.016201620162015%" id="mcps1.2.4.1.3"><p id="p1748619458583"><a name="p1748619458583"></a><a name="p1748619458583"></a>获取途径</p>
</th>
</tr>
</thead>
<tbody><tr id="row18630134151917"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p1563113417199"><a name="p1563113417199"></a><a name="p1563113417199"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p463193418190"><a name="p463193418190"></a><a name="p463193418190"></a>命令行处理工具</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p1063118344191"><a name="p1063118344191"></a><a name="p1063118344191"></a>系统配置</p>
</td>
</tr>
<tr id="row7598468212"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p659815642111"><a name="p659815642111"></a><a name="p659815642111"></a>编译基础软件包(仅ubuntu 20+需要)</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>编译依赖的基础软件包</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p125983652118"><a name="p125983652118"></a><a name="p125983652118"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row08231641105420"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p1682494111548"><a name="p1682494111548"></a><a name="p1682494111548"></a>dosfstools、mtools、mtd-utils</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p1362445934918"><a name="p1362445934918"></a><a name="p1362445934918"></a>文件打包工具</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p1262475944916"><a name="p1262475944916"></a><a name="p1262475944916"></a>通过apt-get install安装</p>
</td>
</tr>
<tr id="row1548710453586"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p15487114585814"><a name="p15487114585814"></a><a name="p15487114585814"></a>hc-gen</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p148719452588"><a name="p148719452588"></a><a name="p148719452588"></a>驱动配置编译工具</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p1487164565819"><a name="p1487164565819"></a><a name="p1487164565819"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar</a></p>
</td>
</tr>
</tbody>
</table>
## 安装Linux编译环境<a name="section8831868501"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gn、ninja、LLVM、hc-gen编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装LLVM、hc-gen编译工具。安装LLVM、hc-gen编译工具时,请确保编译工具的环境变量路径唯一。
### 将Linux shell改为bash<a name="section1715027152617"></a>
查看shell是否为bash,在终端运行如下命令
```
ls -l /bin/sh
```
如果显示为“/bin/sh -\> bash”则为正常,否则请按以下方式修改:
**方法一**:在终端运行如下命令,然后选择 no。
```
sudo dpkg-reconfigure dash
```
**方法二**:先删除sh,再创建软链接。
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### 安装编译依赖基础软件(仅Ubuntu 20+需要)<a name="section45512412251"></a>
执行以下命令进行安装:
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### 安装文件打包工具<a name="section480195453419"></a>
1. 打开Linux编译服务器终端。
2. 运行如下命令,安装dosfstools。
```
sudo apt-get install dosfstools
```
3. 运行如下命令,安装mtools。
```
sudo apt-get install mtools
```
4. 运行如下命令,安装mtd-utils。
```
sudo apt-get install mtd-utils
```
### 安装hc-gen<a name="section351420104218"></a>
1. 打开Linux编译服务器终端。
2. [下载hc-gen工具](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar)
3. 解压hc-gen安装包到Linux服务器\~/hc-gen路径下。
```
tar -xvf hc-gen-0.65-linux.tar -C ~/
```
4. 设置环境变量。
```
vim ~/.bashrc
```
将以下命令拷贝到.bashrc文件的最后一行,保存并退出。
```
export PATH=~/hc-gen:$PATH
```
5. 生效环境变量。
```
source ~/.bashrc
```
......@@ -3,19 +3,21 @@
- [前提条件](#section2074878255)
- [Hi3861环境特有要求](#section466851916410)
- [安装Linux编译环境](#section497484245614)
- [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section45512412251)
- [安装Scons](#section13515123015279)
- [安装python模块](#section88701892341)
- [安装gcc\_riscv32(WLAN模组类编译工具链)](#section1842910288284)
>![](public_sys-resources/icon-notice.gif) **须知:**
>本节描述安装包方式搭建编译环境的操作步骤。如果是Docker方式安装编译环境,无需安装Linux服务器相关的SCons3.0.4+和build-essential工具,仅需安装Windows工作台软件。
## 前提条件<a name="section2074878255"></a>
Hi3861环境搭建前,请先完成[搭建系统基础环境](搭建系统基础环境.md)
## Hi3861环境特有要求<a name="section466851916410"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>本节描述安装包方式搭建编译环境的操作步骤。如果是Docker方式安装编译环境,无需安装[表1](#table6299192712513)中的Linux服务器相关工具,仅需安装Windows工作台软件。
Hi3861开发板对环境配置的特有要求如下表所示。
**表 1** Hi3861开发板对环境配置的特有要求
......@@ -23,37 +25,55 @@ Hi3861开发板对环境配置的特有要求如下表所示。
<a name="table6299192712513"></a>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="17.54%" id="mcps1.2.5.1.1"><p id="p162491657102110"><a name="p162491657102110"></a><a name="p162491657102110"></a>平台类型</p>
</th>
<th class="cellrowborder" valign="top" width="19.89%" id="mcps1.2.5.1.2"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>开发工具</p>
<th class="cellrowborder" valign="top" width="23.62%" id="mcps1.2.5.1.2"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>开发工具</p>
</th>
<th class="cellrowborder" valign="top" width="26.279999999999998%" id="mcps1.2.5.1.3"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
<th class="cellrowborder" valign="top" width="22.55%" id="mcps1.2.5.1.3"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
</th>
<th class="cellrowborder" valign="top" width="36.29%" id="mcps1.2.5.1.4"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>获取途径</p>
</th>
</tr>
</thead>
<tbody><tr id="row1397335913612"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p3711468218"><a name="p3711468218"></a><a name="p3711468218"></a>Linux服务器</p>
<tbody><tr id="row935218593572"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p105554418586"><a name="p105554418586"></a><a name="p105554418586"></a>Linux服务器</p>
</td>
<td class="cellrowborder" valign="top" width="23.62%" headers="mcps1.2.5.1.2 "><p id="p45551740589"><a name="p45551740589"></a><a name="p45551740589"></a>编译基础软件包(仅ubuntu 20+需要)</p>
</td>
<td class="cellrowborder" valign="top" width="22.55%" headers="mcps1.2.5.1.3 "><p id="p655594115814"><a name="p655594115814"></a><a name="p655594115814"></a>编译依赖的基础软件包</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p165558415589"><a name="p165558415589"></a><a name="p165558415589"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row1397335913612"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p3711468218"><a name="p3711468218"></a><a name="p3711468218"></a>Linux服务器</p>
</td>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p097355911620"><a name="p097355911620"></a><a name="p097355911620"></a>SCons3.0.4+</p>
<td class="cellrowborder" valign="top" width="23.62%" headers="mcps1.2.5.1.2 "><p id="p097355911620"><a name="p097355911620"></a><a name="p097355911620"></a>SCons3.0.4+</p>
</td>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p1973195917619"><a name="p1973195917619"></a><a name="p1973195917619"></a>编译构建工具</p>
<td class="cellrowborder" valign="top" width="22.55%" headers="mcps1.2.5.1.3 "><p id="p1973195917619"><a name="p1973195917619"></a><a name="p1973195917619"></a>编译构建工具</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p1722663441514"><a name="p1722663441514"></a><a name="p1722663441514"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row1463517494402"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>Linux服务器</p>
<tr id="row1968013216717"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p2681632977"><a name="p2681632977"></a><a name="p2681632977"></a>Linux服务器</p>
</td>
<td class="cellrowborder" valign="top" width="23.62%" headers="mcps1.2.5.1.2 "><p id="p1991501391312"><a name="p1991501391312"></a><a name="p1991501391312"></a>python模块:setuptools、kconfiglib、pycryptodome、six、ecdsa</p>
</td>
<td class="cellrowborder" valign="top" width="22.55%" headers="mcps1.2.5.1.3 "><p id="p968120325715"><a name="p968120325715"></a><a name="p968120325715"></a>编译构建工具</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p268116326711"><a name="p268116326711"></a><a name="p268116326711"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row020914491313"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p20209749103116"><a name="p20209749103116"></a><a name="p20209749103116"></a>Linux服务器</p>
</td>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p258814561424"><a name="p258814561424"></a><a name="p258814561424"></a>build-essential</p>
<td class="cellrowborder" valign="top" width="23.62%" headers="mcps1.2.5.1.2 "><p id="p7209104910317"><a name="p7209104910317"></a><a name="p7209104910317"></a>gcc riscv32</p>
</td>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p1749611716181"><a name="p1749611716181"></a><a name="p1749611716181"></a>编译依赖的基础软件包</p>
<td class="cellrowborder" valign="top" width="22.55%" headers="mcps1.2.5.1.3 "><p id="p102093498311"><a name="p102093498311"></a><a name="p102093498311"></a>编译构建工具</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p8635174916403"><a name="p8635174916403"></a><a name="p8635174916403"></a>通过互联网获取</p>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p321054953116"><a name="p321054953116"></a><a name="p321054953116"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row1596703610215"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p071946112113"><a name="p071946112113"></a><a name="p071946112113"></a>Windows工作台</p>
</td>
<td class="cellrowborder" valign="top" width="19.89%" headers="mcps1.2.5.1.2 "><p id="p1044974291416"><a name="p1044974291416"></a><a name="p1044974291416"></a>CH341SER.EXE</p>
<td class="cellrowborder" valign="top" width="23.62%" headers="mcps1.2.5.1.2 "><p id="p1044974291416"><a name="p1044974291416"></a><a name="p1044974291416"></a>CH341SER.EXE</p>
</td>
<td class="cellrowborder" valign="top" width="26.279999999999998%" headers="mcps1.2.5.1.3 "><p id="p94491342131413"><a name="p94491342131413"></a><a name="p94491342131413"></a>USB转串口驱动</p>
<td class="cellrowborder" valign="top" width="22.55%" headers="mcps1.2.5.1.3 "><p id="p94491342131413"><a name="p94491342131413"></a><a name="p94491342131413"></a>USB转串口驱动</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p6449184214148"><a name="p6449184214148"></a><a name="p6449184214148"></a><a href="http://www.wch.cn/search?q=ch340g&amp;t=downloads" target="_blank" rel="noopener noreferrer">http://www.wch.cn/search?q=ch340g&amp;t=downloads</a></p>
</td>
......@@ -67,39 +87,129 @@ Hi3861开发板对环境配置的特有要求如下表所示。
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gcc\_riscv32编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装gcc\_riscv32编译工具。安装gcc\_riscv32编译工具时,请确保编译工具的环境变量路径唯一。
### 安装编译依赖基础软件(仅Ubuntu 20+需要)<a name="section45512412251"></a>
执行以下命令进行安装:
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### 安装Scons<a name="section13515123015279"></a>
1. 打开Linux编译服务器终端。
2. 运行如下命令,安装SCons安装包。
```
sudo apt-get install scons -y
python3 -m pip install scons
```
3. 运行如下命令,查看是否安装成功。如果安装成功,查询结果下图所示。
```
scons -v
```
如果软件源中无法找到安装包,请按以下步骤处理:
**图 1** SCons安装成功界面,版本要求3.0.4以上<a name="fig235815252492"></a>
![](figures/SCons安装成功界面-版本要求3-0-4以上.png "SCons安装成功界面-版本要求3-0-4以上")
1. 下载源码包(下载路径:“ [https://scons.org/pages/download.html](https://scons.org/pages/download.html) ”,具体版本以SCons的当前生产版本为准,要求SCons版本为3.0.4以上)。
2. 解压源码包到任意目录(以scons-3.1.2为例)。
### 安装python模块<a name="section88701892341"></a>
1. 运行如下命令,安装python模块setuptools。
```
pip3 install setuptools
```
2. 安装GUI menuconfig工具(Kconfiglib),建议安装Kconfiglib 13.2.0+版本,任选如下一种方式。
- **命令行方式:**
```
tar -xvf scons-3.1.2.tar.gz
sudo pip3 install kconfiglib
```
3. 安装源码包:进入解压目录,运行如下命令:
- **安装包方式:**
1. 下载.whl文件(例如:kconfiglib-13.2.0-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/kconfiglib\#files](https://pypi.org/project/kconfiglib#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
3. 安装pycryptodome,任选如下一种方式。
安装升级文件签名依赖的Python组件包,包括:pycryptodome、six、ecdsa。安装ecdsa依赖six,请先安装six,再安装ecdsa。
- **命令行方式:**
```
sudo python3 setup.py install
sudo pip3 install pycryptodome
```
- **安装包方式:**
1. 下载.whl文件(例如:pycryptodome-3.9.9-cp38-cp38-manylinux1\_x86\_64.whl)。
3. 运行如下命令,查看是否安装成功。如果安装成功,查询结果下图所示。
下载路径:“[https://pypi.org/project/pycryptodome/\#files](https://pypi.org/project/pycryptodome/#files)”。
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
4. 安装six,任选如下一种方式。
- **命令行方式:**
```
sudo pip3 install six --upgrade --ignore-installed six
```
- **安装包方式:**
1. 下载.whl文件(例如:six-1.12.0-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install six-1.12.0-py2.py3-none-any.whl
```
5. 安装ecdsa,任选如下一种方式。
- **命令行方式:**
```
sudo pip3 install ecdsa
```
- **安装包方式:**
1. 下载.whl文件(例如:ecdsa-0.14.1-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/ecdsa/\#files](https://pypi.org/project/ecdsa/#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
```
scons -v
```
**图 1** SCons安装成功界面<a name="fig235815252492"></a>
![](figures/SCons安装成功界面.png "SCons安装成功界面")
### 安装gcc\_riscv32(WLAN模组类编译工具链)<a name="section1842910288284"></a>
......@@ -181,7 +291,7 @@ Hi3861开发板对环境配置的特有要求如下表所示。
14. 编译newlib。
```
mkdir build_newlib && cd build_newlib && ../riscv-newlib/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --bindir=/opt/gcc_riscv32/bin --libexecdir=/opt/gcc_riscv32 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd ..
mkdir build_newlib && cd build_newlib && ../riscv-newlib/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" \CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --bindir=/opt/gcc_riscv32/bin --libexecdir=/opt/gcc_riscv32 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd ..
```
15. 编译gcc。
......
......@@ -9,16 +9,18 @@
- [安装Linux编译环境(方法一:Docker方式)](#section107932281315)
- [安装Linux编译环境(方法二:安装包方式)](#section497484245614)
- [连接Linux服务器](#section723115618340)
- [将Linux shell改为bash](#section1715027152617)
- [安装Python环境](#section11255767343)
- [安装和配置Python](#section11255767343)
- [安装gn](#section9262166183410)
- [安装ninja](#section02645617348)
- [安装LLVM](#section149564754)
- [安装hb](#section6201103143120)
- [获取源码](#section1545225464016)
- [获取OpenHarmony源码](#section1545225464016)
- [常见问题](#section19253140111619)
- [hb安装过程中出现乱码、段错误](#section347685141717)
- [hb 安装过程中提示"cannot import 'sysconfig' from 'distutils'"](#section1996804118553)
- [hb 安装过程中提示"module 'platform' has no attribute 'linux\_distribution'"](#section6992181918582)
- [Linux编译服务器终端输入不识别的命令时提示“ImportError: No module named apt\_pkg”](#section7854153010120)
在搭建各个开发板环境前,需要完成OpenHarmony系统基础环境搭建。系统基础环境主要是指OpenHarmony的编译环境和开发环境。系统基础环境搭建分为如下几种方式,请根据实际软硬件情况以及个人喜好选择以下任一方式。
......@@ -130,54 +132,47 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示
**表 3** Linux服务器开发工具及获取途径
<a name="table6299192712513"></a>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="25.562556255625562%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>开发工具</p>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="13.35133513351335%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>开发工具</p>
</th>
<th class="cellrowborder" valign="top" width="20.7020702070207%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
<th class="cellrowborder" valign="top" width="19.72197219721972%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
</th>
<th class="cellrowborder" valign="top" width="53.73537353735374%" id="mcps1.2.4.1.3"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>获取途径</p>
<th class="cellrowborder" valign="top" width="66.92669266926693%" id="mcps1.2.4.1.3"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>获取途径</p>
</th>
</tr>
</thead>
<tbody><tr id="row430016273514"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p330015271158"><a name="p330015271158"></a><a name="p330015271158"></a>Python3.7+</p>
<tbody><tr id="row430016273514"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p330015271158"><a name="p330015271158"></a><a name="p330015271158"></a>Python3.7+</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p43003270510"><a name="p43003270510"></a><a name="p43003270510"></a>编译构建工具</p>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p43003270510"><a name="p43003270510"></a><a name="p43003270510"></a>编译构建工具</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p18254155164617"><a name="p18254155164617"></a><a name="p18254155164617"></a><a href="https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz" target="_blank" rel="noopener noreferrer">https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz</a></p>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p34760459518"><a name="p34760459518"></a><a name="p34760459518"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row42668197206"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p426711912014"><a name="p426711912014"></a><a name="p426711912014"></a>bash</p>
<tr id="row1711946154018"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p15588165684216"><a name="p15588165684216"></a><a name="p15588165684216"></a>gn</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p14267131962014"><a name="p14267131962014"></a><a name="p14267131962014"></a>命令处理器</p>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p4588135634213"><a name="p4588135634213"></a><a name="p4588135634213"></a>产生ninja编译脚本</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p14267101962014"><a name="p14267101962014"></a><a name="p14267101962014"></a>通过互联网获取</p>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p14131813191712"><a name="p14131813191712"></a><a name="p14131813191712"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz</a></p>
</td>
</tr>
<tr id="row1711946154018"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p15588165684216"><a name="p15588165684216"></a><a name="p15588165684216"></a>gn</p>
<tr id="row16990164213404"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p1858825613428"><a name="p1858825613428"></a><a name="p1858825613428"></a>ninja</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p4588135634213"><a name="p4588135634213"></a><a name="p4588135634213"></a>产生ninja编译脚本</p>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p15844174611816"><a name="p15844174611816"></a><a name="p15844174611816"></a>执行ninja编译脚本</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p14131813191712"><a name="p14131813191712"></a><a name="p14131813191712"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz</a></p>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p1923373393515"><a name="p1923373393515"></a><a name="p1923373393515"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar</a></p>
</td>
</tr>
<tr id="row16990164213404"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p1858825613428"><a name="p1858825613428"></a><a name="p1858825613428"></a>ninja</p>
<tr id="row7531362055"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p15217227174016"><a name="p15217227174016"></a><a name="p15217227174016"></a>LLVM</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p15844174611816"><a name="p15844174611816"></a><a name="p15844174611816"></a>执行ninja编译脚本</p>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p122171727184019"><a name="p122171727184019"></a><a name="p122171727184019"></a>编译工具链</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p1923373393515"><a name="p1923373393515"></a><a name="p1923373393515"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar</a></p>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p871055810226"><a name="p871055810226"></a><a name="p871055810226"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar</a></p>
</td>
</tr>
<tr id="row7531362055"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p15217227174016"><a name="p15217227174016"></a><a name="p15217227174016"></a>LLVM</p>
<tr id="row1644079184919"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p744115914493"><a name="p744115914493"></a><a name="p744115914493"></a>hb</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p122171727184019"><a name="p122171727184019"></a><a name="p122171727184019"></a>编译工具链</p>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p1244114913492"><a name="p1244114913492"></a><a name="p1244114913492"></a>编译构建命令行工具</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p871055810226"><a name="p871055810226"></a><a name="p871055810226"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar</a></p>
</td>
</tr>
<tr id="row1644079184919"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p744115914493"><a name="p744115914493"></a><a name="p744115914493"></a>hb</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p1244114913492"><a name="p1244114913492"></a><a name="p1244114913492"></a>编译构建命令行工具</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p1244120916499"><a name="p1244120916499"></a><a name="p1244120916499"></a>HarmonyOS源码build_lite仓</p>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p1463918124619"><a name="p1463918124619"></a><a name="p1463918124619"></a>通过互联网获取</p>
</td>
</tr>
</tbody>
......@@ -218,30 +213,7 @@ Linux编译环境可以通过Docker方式快速安装,具体请参见[Docker
![](figures/登录成功界面.png "登录成功界面")
### 将Linux shell改为bash<a name="section1715027152617"></a>
查看shell是否为bash,在终端运行如下命令
```
ls -l /bin/sh
```
如果显示为“/bin/sh -\> bash”则为正常,否则请按以下方式修改:
**方法一**:在终端运行如下命令,然后选择 no。
```
sudo dpkg-reconfigure dash
```
**方法二**:先删除sh,再创建软链接。
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### 安装Python环境<a name="section11255767343"></a>
### 安装和配置Python<a name="section11255767343"></a>
1. 打开Linux编译服务器终端。
2. 输入如下命令,查看python版本号,需使用python3.7以上版本。
......@@ -265,40 +237,33 @@ sudo ln -s /bin/bash /bin/sh
sudo apt-get install python3.8
```
- 如果Ubuntu版本为16,请以下载包的方式安装python
- 如果Ubuntu版本为16。
1. python安装环境依赖\(gcc, g++, make, zlib, libffi\)请运行如下命令:
a. 安装依赖包
```
sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
sudo apt update && sudo apt install software-properties-common
```
1. 获取[python3.8.5安装包](https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz),将其放至linux服务器中,运行如下命令 :
b. 添加deadsnakes PPA 源,然后按回车键确认安装。
```
tar -xvzf Python-3.8.5.tgz && cd Python-3.8.5 && sudo ./configure && sudo make && sudo make install
sudo add-apt-repository ppa:deadsnakes/ppa
```
c. 安装python3.8
```
sudo apt upgrade && sudo apt install python3.8
```
3. 确定python安装好后,将python路径链接到"/usr/bin/python"。
输入如下命令,查看python是否正确软链接到python3.8。
```
python --version
```
如果回显不是python 3.8.5,则运行如下命令,查看python3.8所在目录:
```
which python3.8
```
将以下命令中的 "python3.8-path" 替换为 "which python3.8" 命令执行后的回显路径
3. 设置python和python3软链接为python3.8。
```
cd /usr/bin && sudo rm python && sudo rm python3 && sudo ln -s python3.8-path python && sudo ln -s python3.8-path python3 && python3 --version
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
```
4. 安装并升级Python包管理工具(pip3),任选如下一种方式。
......@@ -317,104 +282,6 @@ sudo ln -s /bin/bash /bin/sh
```
5. 运行如下命令,安装python模块setuptools。
```
pip3 install setuptools
```
6. 安装GUI menuconfig工具(Kconfiglib),建议安装Kconfiglib 13.2.0+版本,任选如下一种方式。
- **命令行方式:**
```
sudo pip3 install kconfiglib
```
- **安装包方式:**
1. 下载.whl文件(例如:kconfiglib-13.2.0-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/kconfiglib\#files](https://pypi.org/project/kconfiglib#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
7. <a name="li195884268616"></a>安装pycryptodome,任选如下一种方式。
>![](public_sys-resources/icon-notice.gif) **须知:**
>此[步骤7](#li195884268616)\~[步骤9](#li125926111510)仅Hi3861开发板需要安装,Hi3516、Hi3518开发板无需安装。
安装升级文件签名依赖的Python组件包,包括:pycryptodome、six、ecdsa。安装ecdsa依赖six,请先安装six,再安装ecdsa。
- **命令行方式:**
```
sudo pip3 install pycryptodome
```
- **安装包方式:**
1. 下载.whl文件(例如:pycryptodome-3.9.9-cp38-cp38-manylinux1\_x86\_64.whl)。
下载路径:“[https://pypi.org/project/pycryptodome/\#files](https://pypi.org/project/pycryptodome/#files)”。
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
8. 安装six,任选如下一种方式。
- **命令行方式:**
```
sudo pip3 install six --upgrade --ignore-installed six
```
- **安装包方式:**
1. 下载.whl文件(例如:six-1.12.0-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install six-1.12.0-py2.py3-none-any.whl
```
9. <a name="li125926111510"></a>安装ecdsa,任选如下一种方式。
- **命令行方式:**
```
sudo pip3 install ecdsa
```
- **安装包方式:**
1. 下载.whl文件(例如:ecdsa-0.14.1-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/ecdsa/\#files](https://pypi.org/project/ecdsa/#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
### 安装gn<a name="section9262166183410"></a>
......@@ -513,15 +380,15 @@ sudo ln -s /bin/bash /bin/sh
**前提条件**
- 请先安装Python 3.7.4及以上,请见[安装Python环境](#section11255767343)步骤1\~4
- 请先安装Python 3.7.4及以上,请见[安装和配置Python](#section11255767343)
- 下载源码,请见[源码获取](../get-code/源码获取.md)
**安装方法**
1. 在源码根目录下执行:
1. 运行如下命令安装hb
```
python3 -m pip install --user build/lite
python3 -m pip install --user ohos-build
```
2. 设置环境变量
......@@ -542,7 +409,7 @@ sudo ln -s /bin/bash /bin/sh
source ~/.bashrc
```
3. 执行hb -h有相关帮助信息,有打印信息即表示安装成功:
3. 执行"hb -h",有打印以下信息即表示安装成功:
```
usage: hb
......@@ -580,7 +447,7 @@ python3 -m pip uninstall ohos-build
- **现象描述**
执行“python3 -m pip install --user build/lite”出现乱码、段错误(segmentation fault)。
执行“python3 -m pip install --user ohos-build”出现乱码、段错误(segmentation fault)。
- **可能原因**
......@@ -596,3 +463,65 @@ python3 -m pip uninstall ohos-build
```
### hb 安装过程中提示"cannot import 'sysconfig' from 'distutils'"<a name="section1996804118553"></a>
- **现象描述**
执行“python3 -m pip install --user ohos-build”提示"cannot import 'sysconfig' from 'distutils'"
- **可能原因**
缺少distutils模块。
- **解决办法**
执行如下命令安装。
```
sudo apt-get install python3.8-distutils
```
### hb 安装过程中提示"module 'platform' has no attribute 'linux\_distribution'"<a name="section6992181918582"></a>
- **现象描述**
执行“python3 -m pip install --user ohos-build”提示"module 'platform' has no attribute 'linux\_distribution'"
- **可能原因**
python3 pip安装兼容性问题。
- **解决办法**
执行如下命令重新安装pip。
```
sudo apt remove python3-pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
```
### Linux编译服务器终端输入不识别的命令时提示“ImportError: No module named apt\_pkg”<a name="section7854153010120"></a>
- **现象描述**
Linux编译服务器终端输入不识别的命令时,提示"ImportError: No module named apt\_pkg"
- **可能原因**
python3 apt安装兼容性问题。
- **解决办法**
执行如下命令重新安装python3-apt。
```
sudo apt-get remove python3-apt
sduo apt-get install python3-apt
```
......@@ -7,7 +7,7 @@ bootstrap服务启动组件实现了服务的自动初始化,即服务的初
zInit段的添加可参考已有的Hi3861平台的链接脚本,文件路径为vendor/hisi/hi3861/hi3861/build/link/link.ld.S。
用于实现服务的自动初始化的宏定义接口请参见启动恢复子系统的[API接口文档](https://gitee.com/openharmony/docs/blob/master/api/api-SmartVision-Devices/OHOS-Init.md)
用于实现服务的自动初始化的宏定义接口请参见启动恢复子系统的[API接口文档](https://device.harmonyos.com/cn/docs/develop/apiref/init-0000001054598113)
## 接口说明<a name="section1633115419401"></a>
......
......@@ -142,7 +142,7 @@
-signAlg:签名算法,当前固定为SHA256withECDSA
-keystore:公私钥对,使用签名公私钥对,位于开源库security\_services\_app\_verify仓中OpenHarmonyCer目录下,[OpenHarmony.jks](https://gitee.com/openharmony/security_services_app_verify/blob/master/OpenHarmonyCer/OpenHarmony.jks)。默认密码为123456 ,用户可采用工具\(例如keytool\)更改默认密码
-keystore:公私钥对,使用签名公私钥对,位于开源库security\_services\_app\_verify仓中OpenHarmonyCer目录下,[OpenHarmony.jks](https://gitee.com/openharmony/security_appverify/blob/master/interfaces/innerkits/appverify_lite/OpenHarmonyCer/OpenHarmony.jks)。默认密码为123456 ,用户可采用工具\(例如keytool\)更改默认密码
-keystorepasswd:公私钥对密码,默认签名公私钥对密码为123456
......@@ -150,7 +150,7 @@
-profile:描述文件,应用的描述文件位于对应源代码目录中
-certpath:使用签名证书,位于开源库security\_services\_app\_verify仓中OpenHarmonyCer目录下,[OpenHarmony.cer](https://gitee.com/openharmony/security_services_app_verify/blob/master/OpenHarmonyCer/OpenHarmony.cer)
-certpath:使用签名证书,位于开源库security\_services\_app\_verify仓中OpenHarmonyCer目录下,[OpenHarmony.cer](https://gitee.com/openharmony/security_appverify/blob/master/interfaces/innerkits/appverify_lite/OpenHarmonyCer/OpenHarmony.cer)
-profileSigned:签名块中是否包含描述文件\(profile\)。固定为1(包含)
......
......@@ -67,7 +67,7 @@
当前用户对riscv编译器路径下的文件访问权限不够。
-**解决办法:**
1. 查询hcc\_riscv32所在目录。
1. 查询gcc\_riscv32所在目录。
```
which riscv32-unknown-elf-gcc
......
......@@ -15,7 +15,6 @@ build/lite # 编译构建主目录
│ ├── kernel # 内核的编译配置参数
│ └── subsystem # 子系统模板
├── ndk # NDK相关编译脚本与配置参数
├── product # 产品全量配置表,包括:配置单元、子系统列表、编译器等。
└── toolchain # 编译工具链相关,包括:编译器路径、编译选项、链接选项等。
```
......
......@@ -102,17 +102,16 @@
build a specified product with
{product_name}@{company}, eg: ipcamera@hisilcon
-f, --full full code compilation
-n, --ndk compile ndk
```
- hb build后无参数,会按照设置好的代码路径、产品进行编译,编译选项使用与之前保持一致。
- hb build后无参数,会按照设置好的代码路径、产品进行编译,编译选项使用与之前保持一致。-f 选项将删除当前产品所有编译产品,等同于hb clean + hb build.
- hb build \{component\_name\}:基于设置好的产品对应的单板、内核,单独编译组件(e.g.:hb build kv\_store\)。
- hb build -p ipcamera@hisilicon:免set编译产品,该命令可以跳过set步骤,直接编译产品。
- 在device/device\_company/board下单独执行hb build会进入内核选择界面,选择完成后会根据当前路径的单板、选择的内核编译出仅包含内核、驱动的镜像。
4. **hb clean**
清除out目录对应产品的编译产物,仅剩下args.gn、build.log。清除指定路径可输入路径参数:hb clean xxx/out/xxx,否则将清除hb set的产品对应out路径。
清除out目录对应产品的编译产物,仅保留args.gn、build.log。清除指定路径可输入路径参数:hb clean xxx/out/xxx,否则将清除hb set的产品对应out路径。
```
......
# OpenHarmony 1.0.1(2021-03-15)<a name="ZH-CN_TOPIC_0000001125880475"></a>
- [版本概述](#section1677664815431)
- [版本源码获取](#section84808293211)
- [通过镜像站点获取](#section19634542131218)
- [通过repo下载](#section7180193542317)
- [内核](#section11256141314463)
- [新增特性](#section1834713384464)
- [修改特性](#section6894155811483)
......@@ -59,6 +63,80 @@
OpenHarmony1.0.1扩充组件能力,新增AI子系统、电源管理子系统、泛Sensor子系统、升级子系统。OpenHarmony有了统一AI引擎框架。liteos-m内核完成三方可移植性重构。驱动子系统完善了WIFI、Sensor、Input、Display的驱动模型。图形子系统针对UI能力及JS框架性能和内存得到优化。同时对目录结构及组件仓做了大幅优化。
## 版本源码获取<a name="section84808293211"></a>
### 通过镜像站点获取<a name="section19634542131218"></a>
**表 1** 源码获取路径
<a name="table37071442171217"></a>
<table><thead align="left"><tr id="row20705154220120"><th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.1"><p id="p67051342151216"><a name="p67051342151216"></a><a name="p67051342151216"></a>版本源码</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.2"><p id="p470519425129"><a name="p470519425129"></a><a name="p470519425129"></a>版本信息</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.3"><p id="p8705194271212"><a name="p8705194271212"></a><a name="p8705194271212"></a>下载站点</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.4"><p id="p1270594241219"><a name="p1270594241219"></a><a name="p1270594241219"></a>SHA256校验码</p>
</th>
</tr>
</thead>
<tbody><tr id="row470516428125"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1870564214123"><a name="p1870564214123"></a><a name="p1870564214123"></a>全量代码</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p270504214125"><a name="p270504214125"></a><a name="p270504214125"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p1170554201212"><a name="p1170554201212"></a><a name="p1170554201212"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p97051842101210"><a name="p97051842101210"></a><a name="p97051842101210"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row11706164211210"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p77051425121"><a name="p77051425121"></a><a name="p77051425121"></a>Hi3861解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p16705154215126"><a name="p16705154215126"></a><a name="p16705154215126"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p19705194241214"><a name="p19705194241214"></a><a name="p19705194241214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/wifiiot-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p1570554271214"><a name="p1570554271214"></a><a name="p1570554271214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row5706142101219"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p10706542191212"><a name="p10706542191212"></a><a name="p10706542191212"></a>Hi3518解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p10706842121215"><a name="p10706842121215"></a><a name="p10706842121215"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p670610421126"><a name="p670610421126"></a><a name="p670610421126"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3518ev300-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p47060422121"><a name="p47060422121"></a><a name="p47060422121"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3518ev300-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row167061942121218"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p17706442161215"><a name="p17706442161215"></a><a name="p17706442161215"></a>Hi3516解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p170674212126"><a name="p170674212126"></a><a name="p170674212126"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p47061428127"><a name="p47061428127"></a><a name="p47061428127"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3516dv300-1.0.1.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p107061642151219"><a name="p107061642151219"></a><a name="p107061642151219"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/ipcamera_hi3516dv300-1.0.1.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row7706342101215"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1070654251210"><a name="p1070654251210"></a><a name="p1070654251210"></a>RELEASE-NOTES</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p47061142101217"><a name="p47061142101217"></a><a name="p47061142101217"></a>1.0.1</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p97068428123"><a name="p97068428123"></a><a name="p97068428123"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0.1/OpenHarmony_Release_Notes_zh_cn.zip" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p9706642151212"><a name="p9706642151212"></a><a name="p9706642151212"></a>-</p>
</td>
</tr>
</tbody>
</table>
### 通过repo下载<a name="section7180193542317"></a>
下载命令如下:
```
repo init -u [https://gitee.com/openharmony/manifest.git](https://gitee.com/openharmony/manifest.git) -b OpenHarmony_1.0.1_release --no-repo-verify
repo sync -c
```
## 内核<a name="section11256141314463"></a>
### 新增特性<a name="section1834713384464"></a>
......
# OpenHarmony 1.0(2020-09-10)<a name="ZH-CN_TOPIC_0000001079132978"></a>
- [版本概述](#section249611124916)
- [版本源码获取](#section127301717165113)
- [通过镜像站点获取](#section157648475298)
- [通过repo命令获取](#section49746186307)
## 版本概述<a name="section249611124916"></a>
首次发布OpenHarmony 1.0。
## 版本源码获取<a name="section127301717165113"></a>
### 通过镜像站点获取<a name="section157648475298"></a>
**表 1** 源码获取路径
<a name="table91984129177"></a>
<table><thead align="left"><tr id="row51981312101713"><th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.1"><p id="p16618172471719"><a name="p16618172471719"></a><a name="p16618172471719"></a>版本源码</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.2"><p id="p46181224161718"><a name="p46181224161718"></a><a name="p46181224161718"></a>版本信息</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.3"><p id="p1461814241177"><a name="p1461814241177"></a><a name="p1461814241177"></a>下载站点</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.4"><p id="p12618192481716"><a name="p12618192481716"></a><a name="p12618192481716"></a>SHA256校验码</p>
</th>
</tr>
</thead>
<tbody><tr id="row174961746125013"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p697315226515"><a name="p697315226515"></a><a name="p697315226515"></a>全量代码</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p1997312229519"><a name="p1997312229519"></a><a name="p1997312229519"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p1797320223518"><a name="p1797320223518"></a><a name="p1797320223518"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p6973102210516"><a name="p6973102210516"></a><a name="p6973102210516"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/code-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row1049714618507"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p14973722165114"><a name="p14973722165114"></a><a name="p14973722165114"></a>Hi3861解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p1361982418176"><a name="p1361982418176"></a><a name="p1361982418176"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p797314223515"><a name="p797314223515"></a><a name="p797314223515"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/wifiiot-1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p5973422115112"><a name="p5973422115112"></a><a name="p5973422115112"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/wifiiot-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row7498114620508"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1097311229513"><a name="p1097311229513"></a><a name="p1097311229513"></a>Hi3518解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p0619122471719"><a name="p0619122471719"></a><a name="p0619122471719"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p19973222165111"><a name="p19973222165111"></a><a name="p19973222165111"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3518ev300-1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p10973722105113"><a name="p10973722105113"></a><a name="p10973722105113"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3518ev300-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row19498194619507"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p8973202285119"><a name="p8973202285119"></a><a name="p8973202285119"></a>Hi3516解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p10619182441718"><a name="p10619182441718"></a><a name="p10619182441718"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p497442295116"><a name="p497442295116"></a><a name="p497442295116"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3516dv300-1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p1997442295110"><a name="p1997442295110"></a><a name="p1997442295110"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/ipcamera_hi3516dv300-1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row14989469503"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p997482215517"><a name="p997482215517"></a><a name="p997482215517"></a>RELEASE-NOTES</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p176191824181712"><a name="p176191824181712"></a><a name="p176191824181712"></a>1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p697413223518"><a name="p697413223518"></a><a name="p697413223518"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.0/RELEASE-NOTES.txt" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p15974222165114"><a name="p15974222165114"></a><a name="p15974222165114"></a>-</p>
</td>
</tr>
</tbody>
</table>
### 通过repo命令获取<a name="section49746186307"></a>
方式一(推荐):通过repo下载
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
```
方式二:通过git clone单个代码仓库
进入[代码仓库主页](https://gitee.com/openharmony),选择需要克隆的代码仓库,执行命令,如:
```
git clone https://gitee.com/openharmony/manifest.git -b master
```
# OpenHarmony 1.1.0 LTS(2021-04-01)<a name="ZH-CN_TOPIC_0000001095652840"></a>
- [版本概述](#section1846294912228)
- [版本源码获取](#section84808293211)
- [通过镜像站点获取](#section19634542131218)
- [通过repo下载](#section7180193542317)
- [针对OpenHarmony 1.0.1版本解决的缺陷列表:](#section11935243172612)
## 版本概述<a name="section1846294912228"></a>
首次发布LTS版本OpenHarmony 1.1.0,本版本在1.0.1版本的基础上修复了部分缺陷。
## 版本源码获取<a name="section84808293211"></a>
### 通过镜像站点获取<a name="section19634542131218"></a>
**表 1** 源码获取路径
<a name="table37071442171217"></a>
<table><thead align="left"><tr id="row20705154220120"><th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.1"><p id="p67051342151216"><a name="p67051342151216"></a><a name="p67051342151216"></a>版本源码</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.2"><p id="p470519425129"><a name="p470519425129"></a><a name="p470519425129"></a>版本信息</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.3"><p id="p8705194271212"><a name="p8705194271212"></a><a name="p8705194271212"></a>下载站点</p>
</th>
<th class="cellrowborder" valign="top" width="25%" id="mcps1.2.5.1.4"><p id="p1270594241219"><a name="p1270594241219"></a><a name="p1270594241219"></a>SHA256校验码</p>
</th>
</tr>
</thead>
<tbody><tr id="row470516428125"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1870564214123"><a name="p1870564214123"></a><a name="p1870564214123"></a>全量代码</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p270504214125"><a name="p270504214125"></a><a name="p270504214125"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p1170554201212"><a name="p1170554201212"></a><a name="p1170554201212"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/code-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p97051842101210"><a name="p97051842101210"></a><a name="p97051842101210"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/code-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row11706164211210"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p77051425121"><a name="p77051425121"></a><a name="p77051425121"></a>Hi3861解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p16705154215126"><a name="p16705154215126"></a><a name="p16705154215126"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p19705194241214"><a name="p19705194241214"></a><a name="p19705194241214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/wifiiot-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p1570554271214"><a name="p1570554271214"></a><a name="p1570554271214"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/code-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row5706142101219"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p10706542191212"><a name="p10706542191212"></a><a name="p10706542191212"></a>Hi3518解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p10706842121215"><a name="p10706842121215"></a><a name="p10706842121215"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p670610421126"><a name="p670610421126"></a><a name="p670610421126"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3518ev300-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p47060422121"><a name="p47060422121"></a><a name="p47060422121"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3518ev300-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row167061942121218"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p17706442161215"><a name="p17706442161215"></a><a name="p17706442161215"></a>Hi3516解决方案(二进制)</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p170674212126"><a name="p170674212126"></a><a name="p170674212126"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p47061428127"><a name="p47061428127"></a><a name="p47061428127"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3516dv300-1.1.0.tar.gz" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p107061642151219"><a name="p107061642151219"></a><a name="p107061642151219"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/ipcamera_hi3516dv300-1.1.0.tar.gz.sha256" target="_blank" rel="noopener noreferrer">SHA256 校验码</a></p>
</td>
</tr>
<tr id="row7706342101215"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.1 "><p id="p1070654251210"><a name="p1070654251210"></a><a name="p1070654251210"></a>RELEASE-NOTES</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.2 "><p id="p47061142101217"><a name="p47061142101217"></a><a name="p47061142101217"></a>1.1.0</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.3 "><p id="p97068428123"><a name="p97068428123"></a><a name="p97068428123"></a><a href="https://repo.huaweicloud.com/harmonyos/os/1.1.0/OpenHarmony_Release_Notes_zh_cn.zip" target="_blank" rel="noopener noreferrer">站点</a></p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.2.5.1.4 "><p id="p9706642151212"><a name="p9706642151212"></a><a name="p9706642151212"></a>-</p>
</td>
</tr>
</tbody>
</table>
### 通过repo下载<a name="section7180193542317"></a>
下载命令如下:
```
repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony_release_v1.1.0 --no-repo-verify
repo sync -c
```
## 针对OpenHarmony 1.0.1版本解决的缺陷列表:<a name="section11935243172612"></a>
已修复问题请参见[表2](#table1934113413913)
**表 2** 修复问题列表
<a name="table1934113413913"></a>
<table><thead align="left"><tr id="row4341334203914"><th class="cellrowborder" valign="top" width="22.650000000000002%" id="mcps1.2.3.1.1"><p id="p711564410397"><a name="p711564410397"></a><a name="p711564410397"></a>ISSUE</p>
</th>
<th class="cellrowborder" valign="top" width="77.35%" id="mcps1.2.3.1.2"><p id="p411564416397"><a name="p411564416397"></a><a name="p411564416397"></a>问题描述</p>
</th>
</tr>
</thead>
<tbody><tr id="row934223410393"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p133271454113911"><a name="p133271454113911"></a><a name="p133271454113911"></a><a href="https://gitee.com/openharmony/multimedia_camera_lite/issues/I3EALU" target="_blank" rel="noopener noreferrer">I3EALU</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p1132775483917"><a name="p1132775483917"></a><a name="p1132775483917"></a>【多媒体】cameraActs 用例执行时,找不到相机配置文件,初始失败的问题</p>
</td>
</tr>
<tr id="row0342133417396"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p153278540395"><a name="p153278540395"></a><a name="p153278540395"></a><a href="https://gitee.com/openharmony/drivers_adapter_khdf_liteos/issues/I3D71U" target="_blank" rel="noopener noreferrer">I3D71U</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p93271254153915"><a name="p93271254153915"></a><a name="p93271254153915"></a>【驱动】反复reset,启动到hmac_main_init SUCCESSULLY后,高概率出现系统挂死问题</p>
</td>
</tr>
<tr id="row8342934173920"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p7328145410392"><a name="p7328145410392"></a><a name="p7328145410392"></a><a href="https://gitee.com/openharmony/community/issues/I3EGUX" target="_blank" rel="noopener noreferrer">I3EGUX</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p9328654193918"><a name="p9328654193918"></a><a name="p9328654193918"></a>【可靠性问题】反复reset,出现一次KIdle进程crash,系统挂死无法启动</p>
</td>
</tr>
<tr id="row034213453916"><td class="cellrowborder" valign="top" width="22.650000000000002%" headers="mcps1.2.3.1.1 "><p id="p132875473912"><a name="p132875473912"></a><a name="p132875473912"></a><a href="https://gitee.com/openharmony/community/issues/I3DHIL" target="_blank" rel="noopener noreferrer">I3DHIL</a></p>
</td>
<td class="cellrowborder" valign="top" width="77.35%" headers="mcps1.2.3.1.2 "><p id="p17328105420391"><a name="p17328105420391"></a><a name="p17328105420391"></a>【系统问题】HI3518开源板剩余空间不足,导致ACTS用例大量失败</p>
</td>
</tr>
</tbody>
</table>
# OpenHarmony Release Notes
- [OpenHarmony 1.1.0 LTS(2021-04-01)](OpenHarmony-1-1-0-LTS.md)
- [OpenHarmony 1.0.1(2021-03-15)](OpenHarmony-1-0-1.md)
- [OpenHarmony 1.0(2020-09-10)](OpenHarmony-1-0.md)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册