diff --git a/en/device-dev/get-code/acquiring-tools.md b/en/device-dev/get-code/acquiring-tools.md index 6a7c87fcabef3c330ea5f38a8d0919531fe59ea7..79c1e11a9e5a0fe37177bc850a4810eeb5614aca 100644 --- a/en/device-dev/get-code/acquiring-tools.md +++ b/en/device-dev/get-code/acquiring-tools.md @@ -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 +### Setting Up the Docker Environment for Mini-System Devices \(reference memory ≥ 128 KB\) and Small-System Devices \(reference memory ≥ 1 MB\) **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\) - -**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\) -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\) -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). diff --git a/en/device-dev/get-code/figures/en-us_image_0000001086461836.png b/en/device-dev/get-code/figures/en-us_image_0000001086461836.png new file mode 100644 index 0000000000000000000000000000000000000000..3a24b14afa5429a10663c8eb131b0712819cbd30 Binary files /dev/null and b/en/device-dev/get-code/figures/en-us_image_0000001086461836.png differ diff --git a/en/device-dev/get-code/figures/en-us_image_0000001086781056.png b/en/device-dev/get-code/figures/en-us_image_0000001086781056.png new file mode 100644 index 0000000000000000000000000000000000000000..65723fc68df95d9d4ceca1b6d3ff316e72bd9a84 Binary files /dev/null and b/en/device-dev/get-code/figures/en-us_image_0000001086781056.png differ diff --git a/en/device-dev/get-code/figures/en-us_image_0000001133359093.png b/en/device-dev/get-code/figures/en-us_image_0000001133359093.png new file mode 100644 index 0000000000000000000000000000000000000000..dcf65897e486f38eb7dfadf8cb87b981d41b7df3 Binary files /dev/null and b/en/device-dev/get-code/figures/en-us_image_0000001133359093.png differ diff --git a/en/device-dev/get-code/source-code-acquisition.md b/en/device-dev/get-code/source-code-acquisition.md index e1d768dad665326965fb34a5a3a56e34edf37bdf..3acc4f92d0bb19426dde801ae32cc53ba94f4148 100644 --- a/en/device-dev/get-code/source-code-acquisition.md +++ b/en/device-dev/get-code/source-code-acquisition.md @@ -5,12 +5,9 @@ - [Method 1: Acquiring Source Code from Image Sites](#section1186691118430) - [Method 2: Acquiring Source Code from the Bundle-specific HPM](#section463013147412) - [When to Use](#section123926431441) +- [Prerequisites](#section42627508156) - [How to Use](#section1781916234118) -- [Method 3: Acquiring Source Code with a hpm-cli Tool](#section9459261856) -- [When to Use](#section1854923620139) -- [Preparations](#section4451113551114) -- [Operations](#section1445143510117) -- [Method 4: Acquiring Source Code from a Code Repository](#section537312010229) +- [Method 3: Acquiring Source Code from a Code Repository](#section537312010229) - [When to Use](#section1492115412228) - [Preparations](#section1076962313239) - [Operations](#section17162735266) @@ -31,71 +28,127 @@ Access code repositories at [https://openharmony.gitee.com](https://openharmony This document describes how to acquire OpenHarmony source code and provides its directory structure. The OpenHarmony code is open to you as [bundles](../bundles/overview.md), which can be obtained in any of the following ways: -- **Method 1 \(recommended\)**: Download compressed files from an image site. -- **Method 2**: Visit the HarmonyOS Package Manager \([HPM](https://hpm.harmonyos.com/#/en/home)\) platform, search for your desired solution, select or exclude bundles from the solution, and download it. -- **Method 3**: Use an hpm-cli tool available on the [HPM](https://hpm.harmonyos.com/#/en/home) platform, and run related HPM commands to download your desired code. -- **Method 4**: Use the **repo** or **git** tool to download your desired code from the code repository. +- **Method 1**: Download the compressed file of a distribution from an image site. To obtain the source code of an earlier version, you are also advised to use this method. +- **Method 2**: Obtain the source code from the HarmonyOS Package Manager \(HPM\). Visit the [HPM](https://hpm.harmonyos.com/#/en/home) website, search for your desired open-source distribution, and download the bundle list \(or customize bundles and download the bundle list\). Then use **hpm-cli** to download and install the bundles and compilation toolchain on your local PC. +- **Method 3**: Use the **repo** or **git** tool to download your desired code from the code repository. ## Method 1: Acquiring Source Code from Image Sites -You can download the source code or the corresponding solutions from the image library at the sites listed below. +To ensure the download performance, you are advised to download the source code or the corresponding solution from the image library of the respective site listed in the table below. -**Table 1** Acquiring source code from image sites +>![](public_sys-resources/icon-note.gif) **NOTE:** +>- The table below provides only the sites for downloading the source code of the latest OpenHarmony Master and LTS versions. For details about how to obtain the source code of other versions, see the [Release Notes](https://gitee.com/openharmony/docs/tree/master/en/release-notes). +>- Currently, Master 1.0 is no longer maintained. You are advised to use the LTS version. - - - - - +**Table 1** Sites for acquiring source code from image sites + + +

Content

-

Version Information

-

Site

-

SHA-256 Verification Code

-
+ + + - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -105,59 +158,13 @@ You can download the source code or the corresponding solutions from the image l ## When to Use -If OpenHarmony is new to you, sample solutions are helpful to your development. The [HPM](https://hpm.harmonyos.com/#/en/home) platform provides a recommended solution. You can add or exclude bundles to quickly customize your system. - -## How to Use - -1. Search for a proper solution. - 1. Access the [HPM](https://hpm.harmonyos.com/#/en/home) page, and click the **Solution** tab, as shown in the following figure. - 2. Enter a keyword \("camera" as an example\) in the search box. All matched solutions are found. - 3. Specify filter criteria, such as the bundle type \(example: **Board support** and **Kernel support**\), to further filter the solutions. - 4. Click the solution you need to view its details. - - **Figure 1** HPM page - - - ![](figures/en-us_image_0000001054919529.png) +If OpenHarmony is new to you, sample solutions are helpful to your development. You can obtain an open-source distribution from the [HPM](https://hpm.harmonyos.com/#/en/home) platform, or customize a distribution by adding or deleting bundles of an open-source distribution. +Then use **hpm-cli** to download and install the bundles and compilation toolchain on your local PC. -2. Customize the solution. - - 1. Read the information under **Readme** to learn about the solution \(application scenarios, features, usage, and customization\), as shown in the following figure. - 2. Click **Download** to download the solution to your local PC. - 3. Click **Log in to custom** to customize the bundles for the solution. - - **Figure 2** Solution example - +## Prerequisites - ![](figures/en-us_image_0000001054719501.png) - -3. Customize bundles. - 1. Access the **Custom solution** page, as shown in the following figure. - 2. Set the toggle switch next to a specific optional bundle to exclude it from the solution, or click **Add bundle** to add new bundles. - 3. Enter the basic information about your project, including the bundle name, version, and description, on the right pane. - 4. Click **Download**. The system then generates the OpenHarmony code structure file \(for example, **name.zip**\) and saves it to your local PC. - - The downloaded compressed package does not contain the original file of source code. You can import the package to the IDE, decompress it, and run the **hpm install** command to download all required bundles. - - The downloaded bundles are stored in the **ohos\_bundles** folder in the project directory. - - **Figure 3** Customizing bundles - - - ![](figures/en-us_image_0000001055679464.png) - - - - -## Method 3: Acquiring Source Code with a hpm-cli Tool - -## When to Use - -- You have obtained bundle-specific source code from the HPM website, and want to independently upgrade one or more bundles in the source code. -- You are familiar with OpenHarmony development and **hpm-cli** tools. - -## Preparations - -You need to install the **Node.js** and hpm-cli tool as follows: +You must install **Node.js** and HPM on your local PC. The installation procedure is as follows: 1. Install **Node.js**. @@ -186,35 +193,50 @@ You need to install the **Node.js** and hpm-cli tool as follows: ``` -## Operations +## How to Use -Add the bundle \(**@ohos/demo** as an example\) to your project as follows: +1. Search for distributions. + 1. Access the [HPM](https://hpm.harmonyos.com/#/en/home) page, and click the **Distribution** tab, as shown in the following figure. + 2. Enter a keyword \("camera" as an example\) in the search box. All matched distributions are found. + 3. Specify filter criteria, such as the bundle type \(example: **Board support** and **Kernel support**\), to further filter the distributions. + 4. Locate your desired distribution and click it to view details. -1. Go to the development directory and run the following command to create a development project using the default template: + **Figure 1** HPM page + - ``` - hpm init -t default - ``` + ![](figures/en-us_image_0000001086781056.png) -2. Run the following command to install the bundle \(**@ohos/demo** as an example\): - ``` - hpm install @ohos/demo - ``` +2. Learn more about the distribution. -3. Verify that the **hpm-cli** tool automatically downloads all dependent bundles from the server. If the download is successful, the message "Install successfully!" is displayed. + 1. Read carefully the information about the distribution to learn its application scenarios, features, bundles, usage, and customization methods, as shown in the following figure. + 2. Click **Download** to download the distribution to your local PC. + 3. Click **Custom** to add or delete bundles of the distribution. - ``` - $ hpm install @ohos/demo - Requesting: https://url.foo.bar/hpm/registry/api/bundles/@ohos/demo - downloading @ohos/demo - Requesting: https://lfcontentcenterdev....../bMAlLrYISLqdUTFFFCdgzA.tgz - extract D:\demo\ohos_bundles\@ohos\demo\@ohos-demo-1.0.7.tgz - Install successfully! - ``` + **Figure 2** Example distribution + + + ![](figures/en-us_image_0000001086461836.png) + +3. Customize bundles. + 1. Access the **Custom solution** page, as shown in the following figure. + 2. Set the toggle switch next to a specific optional bundle to delete it from the distribution, or click **Add bundle** to add new bundles. + 3. Enter the basic information about your project, including the bundle name, version, and description, on the right pane. + 4. Click **Download**. The system then generates the OpenHarmony code structure file \(for example, **my\_cust\_dist.zip**\) and saves it to your local PC. + + **Figure 3** Customizing bundles + + + ![](figures/en-us_image_0000001133359093.png) -## Method 4: Acquiring Source Code from a Code Repository +4. Download and install bundles. + 1. Decompress the downloaded file using the CLI tool CMD \(shell in Linux\). + 2. In the generated directory, run the **hpm install** command. + 3. The downloaded bundles are stored in the **ohos\_bundles** folder under the project directory. \(The source code of some bundles will be copied to a specified directory after the bundles are installed.\) + + +## Method 3: Acquiring Source Code from a Code Repository ## When to Use @@ -232,7 +254,7 @@ Add the bundle \(**@ohos/demo** as an example\) to your project as follows: ## Preparations 1. Register your account with gitee. -2. Register an SSH public key. +2. Register an SSH public key. For details, visit [https://gitee.com/help/articles/4181](https://gitee.com/help/articles/4181). 3. Install the git client and configure basic information. ``` @@ -252,20 +274,40 @@ Add the bundle \(**@ohos/demo** as an example\) to your project as follows: ## Operations -Method 1 \(recommended\): Use the **repo** tool to download source code. +>![](public_sys-resources/icon-note.gif) **NOTE:** +>You can obtain the latest features from the master code, and develop commercial functionalities based on the release code. + +- **Obtaining OpenHarmony master code** + + Method 1 \(recommended\): Use the **repo** tool to download the master code. -``` -repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify -repo sync -c -``` + ``` + 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 + ``` + + +- **Obtaining OpenHarmony\_1.0.1\_release code** + + Use the **repo** tool to download the release code. + + ``` + 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 + ``` -Method 2: Run the **git clone** command to clone a single code repository. +- Obtaining the source code of other OpenHarmony releases -Go to https://gitee.com/openharmony, select the code repository to be cloned, and run the following command: + For details about how to obtain the source code of other releases, see the [Release Notes](https://gitee.com/openharmony/docs/blob/master/en/release-notes/OpenHarmony-Release-Notes.md). -``` -git clone https://gitee.com/openharmony/manifest.git -b master -``` ## Source Code Directories diff --git a/en/device-dev/porting/compilation-and-building-subsystem.md b/en/device-dev/porting/compilation-and-building-subsystem.md index bbbcc04ed7a9b8c51ef43f09844911e1801f71f7..efdf3dd03bf6b3d7eb81298dbedb63f40a35d5a1 100644 --- a/en/device-dev/porting/compilation-and-building-subsystem.md +++ b/en/device-dev/porting/compilation-and-building-subsystem.md @@ -5,7 +5,7 @@ ## Building Process -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 ![](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 + } + ] + } + ``` + diff --git a/en/device-dev/porting/implementation-of-apis-at-the-hal.md b/en/device-dev/porting/implementation-of-apis-at-the-hal.md index 60cfafd40d8313fe033896b73a5591e24ec246ef..810161f4a5ab3f865d5d9d97adb140e0b46a1883 100644 --- a/en/device-dev/porting/implementation-of-apis-at-the-hal.md +++ b/en/device-dev/porting/implementation-of-apis-at-the-hal.md @@ -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 @@ -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 @@ -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). diff --git a/en/device-dev/quick-start/basic-os-environment-setup.md b/en/device-dev/quick-start/basic-os-environment-setup.md index e571772b4e2711cf36a88563e3c3cd413a39cd21..d6e60d49369e13cca22926513dfaa8745691cf46 100644 --- a/en/device-dev/quick-start/basic-os-environment-setup.md +++ b/en/device-dev/quick-start/basic-os-environment-setup.md @@ -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 - - - - - - @@ -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 - -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 +### Installing and Configuring Python 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. 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. 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 @@ -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 -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 @@ -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? + +- **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? + +- **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? + +- **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 + ``` + + diff --git a/en/device-dev/quick-start/figures/2021-01-27_170334-0.png b/en/device-dev/quick-start/figures/2021-01-27_170334-0.png index 87cb2f11978845b4fcbeda047fa6e464f9c1b658..1e7dd2cdb515e871a1c5d34b3332b097bc02351b 100644 Binary files a/en/device-dev/quick-start/figures/2021-01-27_170334-0.png and b/en/device-dev/quick-start/figures/2021-01-27_170334-0.png differ diff --git a/en/device-dev/quick-start/figures/2021-01-27_170334-1.png b/en/device-dev/quick-start/figures/2021-01-27_170334-1.png index 5b573a4ddfe89fe25cb1b567736823244fdb9e97..87cb2f11978845b4fcbeda047fa6e464f9c1b658 100644 Binary files a/en/device-dev/quick-start/figures/2021-01-27_170334-1.png and b/en/device-dev/quick-start/figures/2021-01-27_170334-1.png differ diff --git a/en/device-dev/quick-start/figures/2021-01-27_170334-2.png b/en/device-dev/quick-start/figures/2021-01-27_170334-2.png new file mode 100644 index 0000000000000000000000000000000000000000..5b573a4ddfe89fe25cb1b567736823244fdb9e97 Binary files /dev/null and b/en/device-dev/quick-start/figures/2021-01-27_170334-2.png differ diff --git a/en/device-dev/quick-start/figures/2021-01-27_170334-5.png b/en/device-dev/quick-start/figures/2021-01-27_170334-5.png index 5b573a4ddfe89fe25cb1b567736823244fdb9e97..b17002227e6effa92e5ced9ed418476e7fd70098 100644 Binary files a/en/device-dev/quick-start/figures/2021-01-27_170334-5.png and b/en/device-dev/quick-start/figures/2021-01-27_170334-5.png differ diff --git a/en/device-dev/quick-start/figures/2021-01-27_170334.png b/en/device-dev/quick-start/figures/2021-01-27_170334.png index 1e7dd2cdb515e871a1c5d34b3332b097bc02351b..5b573a4ddfe89fe25cb1b567736823244fdb9e97 100644 Binary files a/en/device-dev/quick-start/figures/2021-01-27_170334.png and b/en/device-dev/quick-start/figures/2021-01-27_170334.png differ diff --git a/en/device-dev/quick-start/figures/2021-01-28_112953-4.png b/en/device-dev/quick-start/figures/2021-01-28_112953-4.png new file mode 100644 index 0000000000000000000000000000000000000000..a3a92549a345ad7ebb1d0142a50d2c41c4ede9f4 Binary files /dev/null and b/en/device-dev/quick-start/figures/2021-01-28_112953-4.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001073388838.png b/en/device-dev/quick-start/figures/en-us_image_0000001073388838.png new file mode 100644 index 0000000000000000000000000000000000000000..43496f076a463ec6fbf320b358a32505284ff40f Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001073388838.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001074285712.png b/en/device-dev/quick-start/figures/en-us_image_0000001074285712.png new file mode 100644 index 0000000000000000000000000000000000000000..e6b632288105421a07bd4f8d542293deb0d35fd2 Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001074285712.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001074445364.png b/en/device-dev/quick-start/figures/en-us_image_0000001074445364.png new file mode 100644 index 0000000000000000000000000000000000000000..3628f3f4778012a577d4ee28c703669eb5533594 Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001074445364.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001078244328.png b/en/device-dev/quick-start/figures/en-us_image_0000001078244328.png new file mode 100644 index 0000000000000000000000000000000000000000..ee96ae5fee13abd79cfcea30b18539e4824a7716 Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001078244328.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001078313582.png b/en/device-dev/quick-start/figures/en-us_image_0000001078313582.png new file mode 100644 index 0000000000000000000000000000000000000000..d09a7cc3c72dff150d1a06ab4a7fcaebb7de3265 Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001078313582.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001078404538.png b/en/device-dev/quick-start/figures/en-us_image_0000001078404538.png new file mode 100644 index 0000000000000000000000000000000000000000..d5c8aa48799deb909d7cd047a984cc52db2dd01a Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001078404538.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001120802173.png b/en/device-dev/quick-start/figures/en-us_image_0000001120802173.png new file mode 100644 index 0000000000000000000000000000000000000000..5576e74b99dc2ae0ea635d3f684b560b93fce516 Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001120802173.png differ diff --git a/en/device-dev/quick-start/figures/en-us_image_0000001120802383.png b/en/device-dev/quick-start/figures/en-us_image_0000001120802383.png new file mode 100644 index 0000000000000000000000000000000000000000..4921a82341b8828a6117343b77f7c92b0d99a2c6 Binary files /dev/null and b/en/device-dev/quick-start/figures/en-us_image_0000001120802383.png differ diff --git a/en/device-dev/quick-start/figures/settings-3.png b/en/device-dev/quick-start/figures/settings-3.png new file mode 100644 index 0000000000000000000000000000000000000000..be9e1743f8664bd064e3b0c556f31ca5cc963464 Binary files /dev/null and b/en/device-dev/quick-start/figures/settings-3.png differ diff --git a/en/device-dev/quick-start/figures/successful-installation-(scons-version-requirement-3-0-4-or-later).png b/en/device-dev/quick-start/figures/successful-installation-(scons-version-requirement-3-0-4-or-later).png new file mode 100644 index 0000000000000000000000000000000000000000..e66ca6ffae9aec5f4f5b97ceccf2e37792e95f18 Binary files /dev/null and b/en/device-dev/quick-start/figures/successful-installation-(scons-version-requirement-3-0-4-or-later).png differ diff --git a/en/device-dev/quick-start/figures/successful-system-startup-and-program-execution-7.png b/en/device-dev/quick-start/figures/successful-system-startup-and-program-execution-7.png new file mode 100644 index 0000000000000000000000000000000000000000..6a85551cd30c8c0576c138d86dc66ddf73dccb44 Binary files /dev/null and b/en/device-dev/quick-start/figures/successful-system-startup-and-program-execution-7.png differ diff --git a/en/device-dev/quick-start/figures/successful-system-startup-and-program-execution.png b/en/device-dev/quick-start/figures/successful-system-startup-and-program-execution.png index 37610cceb8665b58e7d312801c29771e623553b2..6a85551cd30c8c0576c138d86dc66ddf73dccb44 100644 Binary files a/en/device-dev/quick-start/figures/successful-system-startup-and-program-execution.png and b/en/device-dev/quick-start/figures/successful-system-startup-and-program-execution.png differ diff --git a/en/device-dev/quick-start/setting-up-the-hi3516-development-environment.md b/en/device-dev/quick-start/setting-up-the-hi3516-development-environment.md index 9c41ed4b07f3336d04b45977a94105867c7306d0..4cab78954efb36f8d7fdc499be3d8d5f96ff0475 100644 --- a/en/device-dev/quick-start/setting-up-the-hi3516-development-environment.md +++ b/en/device-dev/quick-start/setting-up-the-hi3516-development-environment.md @@ -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 - - - + + + + + + + + - + + + + + + + + @@ -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 + +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+\) + +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 1. Start a Linux server. diff --git a/en/device-dev/quick-start/setting-up-the-hi3861-development-environment.md b/en/device-dev/quick-start/setting-up-the-hi3861-development-environment.md index 6c60492072e9cb5238a49fb193af946b9df286b4..11a88450cbffea8dc38f1230b4d278a2c6add611 100644 --- a/en/device-dev/quick-start/setting-up-the-hi3861-development-environment.md +++ b/en/device-dev/quick-start/setting-up-the-hi3861-development-environment.md @@ -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 You must complete the settings in [Basic OS Environment Setup](basic-os-environment-setup.md). ## Requirements Specific to the Hi3861 Development Environment +>![](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 - + + + + + @@ -40,13 +51,22 @@ The following table describes the environment configuration requirements specifi - + + + + + - - - - @@ -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+\) + +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 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\) + ![](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 + +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 - ![](figures/successful-installation.png "successful-installation") ### Installing gcc\_riscv32 \(Compilation Toolchain for WLAN Module\) @@ -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**. diff --git a/en/device-dev/subsystems/bootstrap-module.md b/en/device-dev/subsystems/bootstrap-module.md index cef6624fbaf0ccf4c1ada8cefd1174493b99cf47..0c0ad994d77972916c8abd3a9ef50a9528dcce7e 100644 --- a/en/device-dev/subsystems/bootstrap-module.md +++ b/en/device-dev/subsystems/bootstrap-module.md @@ -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 diff --git a/en/device-dev/subsystems/compilation-and-building-faq.md b/en/device-dev/subsystems/compilation-and-building-faq.md index 167b19187ad621e1d28c0af3845c5d6021a60d73..82946b9ce0e0f341a37aadff724d2cc9ed687e3a 100644 --- a/en/device-dev/subsystems/compilation-and-building-faq.md +++ b/en/device-dev/subsystems/compilation-and-building-faq.md @@ -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 diff --git a/en/device-dev/subsystems/compilation-and-building-guidelines.md b/en/device-dev/subsystems/compilation-and-building-guidelines.md index 665cbff376ffbc36e24ebf383d44abdeccecda0a..8d49008b33ab5819387739613948393b3aa4ba77 100644 --- a/en/device-dev/subsystems/compilation-and-building-guidelines.md +++ b/en/device-dev/subsystems/compilation-and-building-guidelines.md @@ -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 ``` diff --git a/en/device-dev/subsystems/compilation-and-building-overview.md b/en/device-dev/subsystems/compilation-and-building-overview.md index 2a3b1c500bda14e0d3ef2168009c15ac820abcfe..8cf7a6a1c1459288b1430f022740ef3a229663dd 100644 --- a/en/device-dev/subsystems/compilation-and-building-overview.md +++ b/en/device-dev/subsystems/compilation-and-building-overview.md @@ -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_. ``` diff --git a/en/device-dev/subsystems/development-guidelines-on-application-signature-verification.md b/en/device-dev/subsystems/development-guidelines-on-application-signature-verification.md index 1ec2cb7681822213b54f24f9919eec5ff923bffb..90603f67722b18049424a73ec46334c2686071ab 100644 --- a/en/device-dev/subsystems/development-guidelines-on-application-signature-verification.md +++ b/en/device-dev/subsystems/development-guidelines-on-application-signature-verification.md @@ -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 @@ -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 @@ -74,62 +81,81 @@ The following table lists the innerkits APIs provided by the signature verificat

LTS Code

+

Version Information

+

Site

+

SHA-256 Verification Code

+

XX full code base

+

Full code base

+

1.1.0

+

Download

+

Download

+

Hi3861 solution (binary)

+

1.1.0

+

Download

+

Download

+

Hi3518 solution (binary)

+

1.1.0

+

Download

+

Download

+

Hi3516 solution (binary)

1.0

+

1.1.0

Site

+

Download

SHA-256 Verification Code

+

Download

Hi3861 solutions (binary)

+

RELEASE-NOTES

1.0

+

1.1.0

Site

+

Download

SHA-256 Verification Code

+

-

Hi3518 solutions (binary)

+

Master Code

1.0

+

Version Information

Site

+

Site

SHA-256 Verification Code

+

SHA-256 Verification Code

Hi3516 solutions (binary)

+

Full code base

1.0

+

1.0 (no longer maintained)

Site

+

Download

SHA-256 Verification Code

+

Download

RELEASE-NOTES

+

Hi3861 solution (binary)

1.0

+

1.0 (no longer maintained)

Site

+

Download

-

+

Download

+

Hi3518 solution (binary)

+

1.0 (no longer maintained)

+

Download

+

Download

+

Hi3516 solution (binary)

+

1.0 (no longer maintained)

+

Download

+

Download

+

RELEASE-NOTES

+

1.0 (no longer maintained)

+

Download

+

-

Executes script compilation.

https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

-

bash

-

Executes commands.

-

Internet

+

Internet

gn

@@ -177,7 +172,7 @@ The following table describes the tools required for setting up the general envi

Compiles the source code.

The build_lite repository in HarmonyOS source code

+

Internet

dosfstools, mtools, and mtd-utils

+

bash

Pack files.

+

Processes CLI commands.

apt-get install

+

System configuration

+

Basic software package for compilation and building (required only for Ubuntu 20+)

+

Provides a basic software package for compilation and building.

+

Internet

+

dosfstools, mtools, and mtd-utils

+

Pack files.

+

apt-get install

hc-gen

@@ -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 + +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+\) + +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 1. Start a Linux server. diff --git a/en/device-dev/quick-start/setting-up-the-hi3518-development-environment.md b/en/device-dev/quick-start/setting-up-the-hi3518-development-environment.md index 05ed2cf755a6c76cb428246f7f8f912d72ec6796..5f24dc4b6d0b8c58c8f10a903d35b9c12bdad73b 100644 --- a/en/device-dev/quick-start/setting-up-the-hi3518-development-environment.md +++ b/en/device-dev/quick-start/setting-up-the-hi3518-development-environment.md @@ -1,11 +1,13 @@ # Setting Up the Hi3518 Development Environment - [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 +## Setting Up the Hi3518 Development Environment ### Hardware Requirements @@ -45,7 +47,21 @@ The following table describes the tools required for setting up the general envi

dosfstools, mtools, and mtd-utils

+

bash

+

Processes CLI commands.

+

System configuration

+

Basic software package for compilation and building (required only for Ubuntu 20+)

+

Provides a basic software package for compilation and building.

+

Internet

+

dosfstools, mtools, and mtd-utils

Pack files.

Linux server

+

Linux server

+

Basic software package for compilation and building (required only for Ubuntu 20+)

+

Provides a basic software package for compilation and building.

+

Internet

+

Linux server

SCons 3.0.4+

Internet

Linux server

+

Linux server

+

Python modules: setuptools, Kconfiglib, PyCryptodome, six, and ecdsa

+

Executes script compilation.

+

Internet

+

Linux server

build-essential

+

gcc riscv32

Provides basic software package for compilation.

+

Executes script compilation.

Internet

+

Internet

Windows workstation

@@ -55,7 +75,7 @@ The following table describes the environment configuration requirements specifi

USB-to-Serial adapter driver

http://www.wch-ic.com/downloads/CH341SER_EXE.html

+

http://www.wch.cn/search?q=ch340g&t=downloads

-## How to Develop +## Development Procedure \(Scenario 1\) -Application signature verification applies to the following scenarios: +### Signature Verification -- 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 + +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 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\) -1. Call the **APPVERI\_SetDebugMode\(true\)** function to enable debugging mode. +### Signature Verification + +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 + The following is the example code \(supplemented based on the example code for scenario 1\): ``` diff --git a/en/device-dev/subsystems/figures/architecture-of-the-bundle-management-framework.png b/en/device-dev/subsystems/figures/architecture-of-the-bundle-management-framework.png index 6f7e3e730e20598be87ce8191b20af9ed33977a8..45c292e5edc13019a7aff3501cbe3efa0a834cc8 100644 Binary files a/en/device-dev/subsystems/figures/architecture-of-the-bundle-management-framework.png and b/en/device-dev/subsystems/figures/architecture-of-the-bundle-management-framework.png differ diff --git "a/en/device-dev/subsystems/figures/\345\233\276\347\211\2071.png" "b/en/device-dev/subsystems/figures/\345\233\276\347\211\2071.png" new file mode 100644 index 0000000000000000000000000000000000000000..4f0696becdda12d63cca3b93fac1a435511280bb Binary files /dev/null and "b/en/device-dev/subsystems/figures/\345\233\276\347\211\2071.png" differ diff --git a/en/release-notes/OpenHarmony-1-0-1.md b/en/release-notes/OpenHarmony-1-0-1.md index 78582f608264298ad38a38bb94a5cb404a220035..77c27f732d32a73218affba841064397430d304b 100644 --- a/en/release-notes/OpenHarmony-1-0-1.md +++ b/en/release-notes/OpenHarmony-1-0-1.md @@ -1,6 +1,10 @@ # OpenHarmony 1.0.1 \(2021-03-15\) - [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 + +### Acquiring Source Code from an Image Site + +**Table 1** Sites for acquiring source code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Source Code

+

Version Information

+

Site

+

SHA-256 Verification Code

+

Full code base

+

1.0.1

+

Site

+

SHA256 verification code

+

Hi3861 solution (binary)

+

1.0.1

+

Site

+

SHA256 verification code

+

Hi3518 solution (binary)

+

1.0.1

+

Site

+

SHA256 verification code

+

Hi3516 solution (binary)

+

1.0.1

+

Site

+

SHA256 verification code

+

RELEASE-NOTES

+

1.0.1

+

Site

+

-

+
+ +### Acquiring Source Code Using the repo Command + +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 ### New Features @@ -163,7 +241,7 @@ OpenHarmony 1.0.1 supports more subsystems, including the AI, power management, ### New Features - 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 diff --git a/en/release-notes/OpenHarmony-1-0.md b/en/release-notes/OpenHarmony-1-0.md index f90326b2d5e74d5364fa895015f12ae3eefb137a..55540cff55fce171d72d0f9d0da1b8d849180700 100644 --- a/en/release-notes/OpenHarmony-1-0.md +++ b/en/release-notes/OpenHarmony-1-0.md @@ -1,4 +1,94 @@ # OpenHarmony 1.0 \(2020-09-10\) -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 + +This is the initial release for this product. + +## Source Code Acquisition + +### Acquiring Source Code from an Image Site + +**Table 1** Sites for acquiring source code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Source Code

+

Version Information

+

Site

+

SHA-256 Verification Code

+

Full code base

+

1.0

+

Site

+

SHA-256 verification code

+

Hi3861 solution (binary)

+

1.0

+

Site

+

SHA-256 verification code

+

Hi3518 solution (binary)

+

1.0

+

Site

+

SHA-256 verification code

+

Hi3516 solution (binary)

+

1.0

+

Site

+

SHA-256 verification code

+

RELEASE-NOTES

+

1.0

+

Site

+

N/A

+
+ +### Acquiring Source Code Using the repo Tool + +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 +``` diff --git a/en/release-notes/OpenHarmony-Release-Notes.md b/en/release-notes/OpenHarmony-Release-Notes.md index c64a0cd052f7b80d1c9115d0c05fb18e03f08a02..cf1fe45b92c448b76dea5d135f6fec44ebd13ba6 100644 --- a/en/release-notes/OpenHarmony-Release-Notes.md +++ b/en/release-notes/OpenHarmony-Release-Notes.md @@ -1,5 +1,6 @@ # 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) diff --git a/en/release-notes/openharmony-1-1-0-lts.md b/en/release-notes/openharmony-1-1-0-lts.md new file mode 100644 index 0000000000000000000000000000000000000000..3e00a2c64d283ec14fd24b8b8a073b604f56672a --- /dev/null +++ b/en/release-notes/openharmony-1-1-0-lts.md @@ -0,0 +1,123 @@ +# OpenHarmony 1.1.0 LTS \(2021-04-01\) + +- [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 + +This is the first LTS version of OpenHarmony. This version fixes some bugs in OpenHarmony 1.0.1. + +## Source Code Acquisition + +### Acquiring Source Code from Image Sites + +**Table 1** Sites for acquiring source code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Source Code

+

Version Information

+

Site

+

SHA-256 Verification Code

+

Full code base

+

1.1.0

+

Site

+

SHA-256 verification code

+

Hi3861 solution (binary)

+

1.1.0

+

Site

+

SHA-256 verification code

+

Hi3518 solution (binary)

+

1.1.0

+

Site

+

SHA-256 verification code

+

Hi3516 solution (binary)

+

1.1.0

+

Site

+

SHA-256 verification code

+

RELEASE-NOTES

+

1.1.0

+

Site

+

N/A

+
+ +### Acquiring Source Code Using the repo Tool + +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 + +The following table lists the issues that have been resolved in this version. + +**Table 2** Resolved issues + + + + + + + + + + + + + + + + + + + +

Issue

+

Description

+

I3EALU

+

[Multimedia] When the cameraActs cases are executed, the camera configuration file cannot be found, and the initialization fails.

+

I3D71U

+

[Driver] When the system is reset repeatedly and started successfully by hmac_main_init, there is a high possibility that the system is suspended.

+

I3EGUX

+

[Reliability issue] When the system is reset repeatedly, and the KIdle process crashes once, the system is suspended and cannot be started.

+

I3DHIL

+

[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.

+
+ diff --git "a/zh-cn/device-dev/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" "b/zh-cn/device-dev/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" index 7664038edf9187218a02ea39dc6488822d4d3725..7d8e2eab36bb90ff99229dd2694c79a0827a77c7 100644 --- "a/zh-cn/device-dev/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" +++ "b/zh-cn/device-dev/get-code/\346\272\220\347\240\201\350\216\267\345\217\226.md" @@ -28,7 +28,7 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 本文档将介绍如何获取OpenHarmony源码并说明OpenHarmony的源码目录结构。OpenHarmony的代码以[组件](../bundles/概述.md)的形式开放,开发者可以通过如下其中一种方式获取: -- **获取方式1**:从镜像站点下载归档后的发行版压缩文件(推荐) +- **获取方式1**:从镜像站点下载归档后的发行版压缩文件。如果要获取旧版本的源码,也可通过此方式获取(推荐) - **获取方式2**:通过HPM包管理器获取。在[HPM](https://hpm.harmonyos.com)网站,查找满足需求的开源发行版,直接下载(或者定制后下载),再通过hpm-cli命令工具将所需的组件及工具链下载、安装到本地。 - **获取方式3**:从代码仓库获取。通过repo或git工具从代码仓库中下载。 @@ -36,62 +36,119 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 为了获得更好的下载性能,您可以选择从以下站点的镜像库获取源码或者对应的解决方案。 +>![](public_sys-resources/icon-note.gif) **说明:** +>- 本部分只提供**OpenHarmony** Master最新版本和LTS最新版本的源码获取方式, 其他版本源码获取方式请参考版本[Release-Notes](https://gitee.com/openharmony/docs/blob/master/zh-cn/release-notes/OpenHarmony-Release-Notes.md) +>- 当前Master 1.0版本已经不再维护,推荐使用LTS版本。 + **表 1** 源码获取路径 - - - - - + +

下载内容

-

版本信息

-

下载站点

-

SHA256校验码

-
+ + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -141,7 +198,7 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 1. 查找发行版。 1. 打开包管理页面[HPM](https://hpm.harmonyOS.com),设定搜索的对象为“发行版“,如下图所示。 2. 自搜索框输入关键字搜索,如"摄像头"。 - 3. 结果中显示与关键字匹配的发行版,可以进一步根据组件类别等过滤条件\(如:适配的开发板,内核)精确筛选。 + 3. 结果中显示与关键字匹配的发行版,可以进一 步根据组件类别等过滤条件\(如:适配的开发板,内核)精确筛选。 4. 查找合适的发行版,点击查看发行版的详情介绍。 **图 1** 包管理 @@ -197,7 +254,7 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 ## 准备 1. 注册码云gitee账号。 -2. 注册码云SSH公钥,请参考码云帮助中心的公钥管理:[https://gitee.com/help/articles/4191](https://gitee.com/help/articles/4191) +2. 注册码云SSH公钥,请参考码云帮助中心的公钥管理:[https://gitee.com/help/articles/4181](https://gitee.com/help/articles/4181) 3. 安装git客户端并配置用户信息。 ``` @@ -218,33 +275,36 @@ OpenHarmony是HarmonyOS的开源版,由华为捐赠给开放原子开源基金 ## 操作 >![](public_sys-resources/icon-note.gif) **说明:** ->主干代码为码云的开发分支,开发者可通过主干代码获取最新特性。分支代码相对比较稳定,开发者可基于分支代码进行商用功能开发。 +>主干代码为开发分支,开发者可通过主干代码获取最新特性。分支代码相对比较稳定,开发者可基于分支代码进行商用功能开发。 - **OpenHarmony主干代码获取** -方式一(推荐):通过repo下载 + 方式一(推荐):通过repo下载 + + ``` + repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify + repo sync -c + ``` + + 方式二:通过git clone单个代码仓库 -``` -repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify -repo sync -c -``` + 进入[代码仓库主页](https://gitee.com/openharmony),选择需要克隆的代码仓库,执行命令,如: -方式二:通过git clone单个代码仓库 + ``` + git clone https://gitee.com/openharmony/manifest.git -b master + ``` -进入[代码仓库主页](https://gitee.com/openharmony),选择需要克隆的代码仓库,执行命令,如: -``` -git clone https://gitee.com/openharmony/manifest.git -b master -``` +- **OpenHarmony release 分支代码获取** -- **OpenHarmony_1.0.1_release 分支代码获取** + 通过repo下载 -通过repo下载 + ``` + 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 + ``` -``` -repo init -u https://gitee.com/openharmony/manifest.git -b OpenHarmony_1.0.1_release --no-repo-verify -repo sync -c -``` +- **OpenHarmony** 其他版本源码获取方式请参考版本[Release-Notes](https://gitee.com/openharmony/docs/blob/master/zh-cn/release-notes/OpenHarmony-Release-Notes.md)。 ## 源码目录简介 diff --git "a/zh-cn/device-dev/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" "b/zh-cn/device-dev/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" index 25436c9128d26af427d4ee337c62331d8c5e5528..9e1631bbdff32f46410d87cdcbaa6a35e33b592f 100644 --- "a/zh-cn/device-dev/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" +++ "b/zh-cn/device-dev/get-code/\350\216\267\345\217\226\345\267\245\345\205\267.md" @@ -208,9 +208,9 @@ OpenHarmony的Docker镜像托管在[HuaweiCloud SWR](https://console.huaweicloud ## 获取设备开发工具(HUAWEI DevEco Device Tool) -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) -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)。 diff --git "a/zh-cn/device-dev/porting/HAL\345\261\202\345\256\236\347\216\260.md" "b/zh-cn/device-dev/porting/HAL\345\261\202\345\256\236\347\216\260.md" index 97f0188e3a0c300e006c50884ed0b56ad10ff9ea..9f97773be5bcb87c266b0a3ddeb473f74e72edd0 100644 --- "a/zh-cn/device-dev/porting/HAL\345\261\202\345\256\236\347\216\260.md" +++ "b/zh-cn/device-dev/porting/HAL\345\261\202\345\256\236\347\216\260.md" @@ -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服务 @@ -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)。 diff --git "a/zh-cn/device-dev/porting/\347\274\226\350\257\221\347\263\273\347\273\237\344\273\213\347\273\215.md" "b/zh-cn/device-dev/porting/\347\274\226\350\257\221\347\263\273\347\273\237\344\273\213\347\273\215.md" index 8bac05916dda8ce11aeed3a00efb260d125d3938..c261e7a733c6c9e10f925135955101ddc9351c26 100644 --- "a/zh-cn/device-dev/porting/\347\274\226\350\257\221\347\263\273\347\273\237\344\273\213\347\273\215.md" +++ "b/zh-cn/device-dev/porting/\347\274\226\350\257\221\347\263\273\347\273\237\344\273\213\347\273\215.md" @@ -5,7 +5,7 @@ ## 编译构建流程 -编译构建系统是一个基于gn和ninja组件化构建系统,支持按组件配置、裁剪和拼装,按需构建出定制化的产品。编译构建流程如下: +编译构建系统是一个基于gn和ninja的组件化构建系统,支持按组件配置、裁剪和拼装,按需构建出定制化的产品。编译构建流程如下: **图 1** 编译构建流程 ![](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":[] } # 选择的组件和组件特性 + ] + }, + ... + { + 更多子系统和组件 + } + ] + } + ``` + diff --git "a/zh-cn/device-dev/quick-start/Hi3516\346\220\255\345\273\272\347\216\257\345\242\203.md" "b/zh-cn/device-dev/quick-start/Hi3516\346\220\255\345\273\272\347\216\257\345\242\203.md" index d1a2225967e3e50325de2a16b302edc58fd35bb0..574af97c9026e2fcbc855d16b17b5a774f106390 100644 --- "a/zh-cn/device-dev/quick-start/Hi3516\346\220\255\345\273\272\347\216\257\345\242\203.md" +++ "b/zh-cn/device-dev/quick-start/Hi3516\346\220\255\345\273\272\347\216\257\345\242\203.md" @@ -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服务器开发工具及获取途径 -

LTS版本源码

+

版本信息

+

下载站点

+

SHA256校验码

+

全量代码

+

全量代码

1.0.1

+

1.1.0

站点

+

站点

SHA256 校验码

+

SHA256 校验码

Hi3861解决方案(二进制)

+

Hi3861解决方案(二进制)

1.0.1

+

1.1.0

站点

+

站点

SHA256 校验码

+

SHA256 校验码

Hi3518解决方案(二进制)

+

Hi3518解决方案(二进制)

1.0.1

+

1.1.0

站点

+

站点

SHA256 校验码

+

SHA256 校验码

Hi3516解决方案(二进制)

+

Hi3516解决方案(二进制)

1.0.1

+

1.1.0

站点

+

站点

SHA256 校验码

+

SHA256 校验码

RELEASE-NOTES

+

RELEASE-NOTES

1.0.1

+

1.1.0

站点

+

站点

-

+

-

+

Master版本源码

+

版本信息

+

下载站点

+

SHA256校验码

+

全量代码

+

1.0(不再维护)

+

站点

+

SHA256 校验码

+

Hi3861解决方案(二进制)

+

1.0(不再维护)

+

站点

+

SHA256 校验码

+

Hi3518解决方案(二进制)

+

1.0(不再维护)

+

站点

+

SHA256 校验码

+

Hi3516解决方案(二进制)

+

1.0(不再维护)

+

站点

+

SHA256 校验码

+

RELEASE-NOTES

+

1.0(不再维护)

+

站点

+

-

开发工具

+ - - - - - - + + + + + + + + - - @@ -77,6 +93,37 @@ Hi3516开发板对Linux服务器通用环境配置需要的工具及其获取途 >- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装LLVM、hc-gen编译工具。 >- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装LLVM、hc-gen编译工具。安装LLVM、hc-gen编译工具时,请确保编译工具的环境变量路径唯一。 +### 将Linux shell改为bash + +查看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+需要) + +执行以下命令进行安装: + +``` +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 +``` + ### 安装文件打包工具 1. 打开Linux编译服务器终端。 diff --git "a/zh-cn/device-dev/quick-start/Hi3518\346\220\255\345\273\272\347\216\257\345\242\203.md" "b/zh-cn/device-dev/quick-start/Hi3518\346\220\255\345\273\272\347\216\257\345\242\203.md" new file mode 100644 index 0000000000000000000000000000000000000000..8952dea7476fc69572363f2b78e2607798c4fbb9 --- /dev/null +++ "b/zh-cn/device-dev/quick-start/Hi3518\346\220\255\345\273\272\347\216\257\345\242\203.md" @@ -0,0 +1,168 @@ +# Hi3518搭建环境 + +- [前提条件](#section2074878255) +- [Hi3518环境搭建](#section1724111409282) + - [硬件要求](#section487353718276) + - [软件要求](#section17315193935817) + +- [安装Linux编译环境](#section8831868501) + - [将Linux shell改为bash](#section1715027152617) + - [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section45512412251) + - [安装文件打包工具](#section480195453419) + - [安装hc-gen](#section351420104218) + + +## 前提条件 + +Hi3518环境搭建前,请先完成[搭建系统基础环境](搭建系统基础环境.md)。 + +## Hi3518环境搭建 + +### 硬件要求 + +- Hi3518EV300 IoT Camera开发板 +- USB转串口线、网线(Windows工作台通过USB转串口线、网线与开发板连接) + + 各硬件连接关系如下图所示。 + + +**图 1** 硬件连线图 +![](figures/硬件连线图.png "硬件连线图") + +### 软件要求 + +>![](public_sys-resources/icon-notice.gif) **须知:** +>本节描述安装包方式搭建编译环境的操作步骤。如果是Docker方式安装编译环境,请跳过此章节以及下述安装Linux编译环境章节。 + +Hi3518开发板对Linux服务器通用环境配置需要的工具及其获取途径如下表所示。 + +**表 1** Linux服务器开发工具及获取途径 + + +

开发工具

用途

+

用途

获取途径

dosfstools、mtools、mtd-utils

+

bash

文件打包工具

+

命令行处理工具

通过apt-get install安装

+

系统配置

hc-gen

+

编译基础软件包(仅ubuntu 20+需要)

驱动配置编译工具

+

编译依赖的基础软件包

+

通过互联网获取

+

dosfstools、mtools、mtd-utils

+

文件打包工具

+

通过apt-get install安装

+

hc-gen

+

驱动配置编译工具

https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

Java 虚拟机环境

+

Java 虚拟机环境

编译、调试和运行Java程序

+

编译、调试和运行Java程序

通过apt-get install安装

+ + + + + + + + + + + + + + + + + + + + + +

开发工具

+

用途

+

获取途径

+

bash

+

命令行处理工具

+

系统配置

+

编译基础软件包(仅ubuntu 20+需要)

+

编译依赖的基础软件包

+

通过互联网获取

+

dosfstools、mtools、mtd-utils

+

文件打包工具

+

通过apt-get install安装

+

hc-gen

+

驱动配置编译工具

+

https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

+
+ +## 安装Linux编译环境 + +>![](public_sys-resources/icon-notice.gif) **须知:** +>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gn、ninja、LLVM、hc-gen编译工具。 +>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装LLVM、hc-gen编译工具。安装LLVM、hc-gen编译工具时,请确保编译工具的环境变量路径唯一。 + +### 将Linux shell改为bash + +查看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+需要) + +执行以下命令进行安装: + +``` +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 +``` + +### 安装文件打包工具 + +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 + +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 + ``` + + diff --git "a/zh-cn/device-dev/quick-start/Hi3861\346\220\255\345\273\272\347\216\257\345\242\203.md" "b/zh-cn/device-dev/quick-start/Hi3861\346\220\255\345\273\272\347\216\257\345\242\203.md" index b7bbeb9de2c161a3561100e2c6ccc6fc0315fbaf..00475656c8d318d4596d9e5ca0afc40ccbac1481 100644 --- "a/zh-cn/device-dev/quick-start/Hi3861\346\220\255\345\273\272\347\216\257\345\242\203.md" +++ "b/zh-cn/device-dev/quick-start/Hi3861\346\220\255\345\273\272\347\216\257\345\242\203.md" @@ -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工作台软件。 - ## 前提条件 Hi3861环境搭建前,请先完成[搭建系统基础环境](搭建系统基础环境.md)。 ## Hi3861环境特有要求 +>![](public_sys-resources/icon-notice.gif) **须知:** +>本节描述安装包方式搭建编译环境的操作步骤。如果是Docker方式安装编译环境,无需安装[表1](#table6299192712513)中的Linux服务器相关工具,仅需安装Windows工作台软件。 + Hi3861开发板对环境配置的特有要求如下表所示。 **表 1** Hi3861开发板对环境配置的特有要求 @@ -23,37 +25,55 @@ Hi3861开发板对环境配置的特有要求如下表所示。 - - - + + + + + - - - + + + + + - - - - - @@ -67,39 +87,129 @@ Hi3861开发板对环境配置的特有要求如下表所示。 >- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gcc\_riscv32编译工具。 >- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装gcc\_riscv32编译工具。安装gcc\_riscv32编译工具时,请确保编译工具的环境变量路径唯一。 +### 安装编译依赖基础软件(仅Ubuntu 20+需要) + +执行以下命令进行安装: + +``` +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 1. 打开Linux编译服务器终端。 2. 运行如下命令,安装SCons安装包。 ``` - sudo apt-get install scons -y + python3 -m pip install scons + ``` + +3. 运行如下命令,查看是否安装成功。如果安装成功,查询结果下图所示。 + + ``` + scons -v ``` - 如果软件源中无法找到安装包,请按以下步骤处理: + **图 1** SCons安装成功界面,版本要求3.0.4以上 + ![](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模块 + +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安装成功界面 - ![](figures/SCons安装成功界面.png "SCons安装成功界面") ### 安装gcc\_riscv32(WLAN模组类编译工具链) @@ -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。 diff --git "a/zh-cn/device-dev/quick-start/figures/SCons\345\256\211\350\243\205\346\210\220\345\212\237\347\225\214\351\235\242-\347\211\210\346\234\254\350\246\201\346\261\2023-0-4\344\273\245\344\270\212.png" "b/zh-cn/device-dev/quick-start/figures/SCons\345\256\211\350\243\205\346\210\220\345\212\237\347\225\214\351\235\242-\347\211\210\346\234\254\350\246\201\346\261\2023-0-4\344\273\245\344\270\212.png" new file mode 100644 index 0000000000000000000000000000000000000000..e66ca6ffae9aec5f4f5b97ceccf2e37792e95f18 Binary files /dev/null and "b/zh-cn/device-dev/quick-start/figures/SCons\345\256\211\350\243\205\346\210\220\345\212\237\347\225\214\351\235\242-\347\211\210\346\234\254\350\246\201\346\261\2023-0-4\344\273\245\344\270\212.png" differ diff --git "a/zh-cn/device-dev/quick-start/figures/\345\220\257\345\212\250\345\271\266\346\210\220\345\212\237\346\211\247\350\241\214\345\272\224\347\224\250\347\250\213\345\272\217\345\233\276.png" "b/zh-cn/device-dev/quick-start/figures/\345\220\257\345\212\250\345\271\266\346\210\220\345\212\237\346\211\247\350\241\214\345\272\224\347\224\250\347\250\213\345\272\217\345\233\276.png" new file mode 100644 index 0000000000000000000000000000000000000000..6a85551cd30c8c0576c138d86dc66ddf73dccb44 Binary files /dev/null and "b/zh-cn/device-dev/quick-start/figures/\345\220\257\345\212\250\345\271\266\346\210\220\345\212\237\346\211\247\350\241\214\345\272\224\347\224\250\347\250\213\345\272\217\345\233\276.png" differ diff --git "a/zh-cn/device-dev/quick-start/\346\220\255\345\273\272\347\263\273\347\273\237\345\237\272\347\241\200\347\216\257\345\242\203.md" "b/zh-cn/device-dev/quick-start/\346\220\255\345\273\272\347\263\273\347\273\237\345\237\272\347\241\200\347\216\257\345\242\203.md" index 78ba97ff2bc249893da14318e7848828e89c3aec..af4d2e28ee5b11fe30219726e86dd61c926453a7 100644 --- "a/zh-cn/device-dev/quick-start/\346\220\255\345\273\272\347\263\273\347\273\237\345\237\272\347\241\200\347\216\257\345\242\203.md" +++ "b/zh-cn/device-dev/quick-start/\346\220\255\345\273\272\347\263\273\347\273\237\345\237\272\347\241\200\347\216\257\345\242\203.md" @@ -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服务器开发工具及获取途径 -

平台类型

开发工具

+

开发工具

用途

+

用途

获取途径

Linux服务器

+

Linux服务器

+

编译基础软件包(仅ubuntu 20+需要)

+

编译依赖的基础软件包

+

通过互联网获取

+

Linux服务器

SCons3.0.4+

+

SCons3.0.4+

编译构建工具

+

编译构建工具

通过互联网获取

Linux服务器

+

Linux服务器

+

python模块:setuptools、kconfiglib、pycryptodome、six、ecdsa

+

编译构建工具

+

通过互联网获取

+

Linux服务器

build-essential

+

gcc riscv32

编译依赖的基础软件包

+

编译构建工具

通过互联网获取

+

通过互联网获取

Windows工作台

CH341SER.EXE

+

CH341SER.EXE

USB转串口驱动

+

USB转串口驱动

http://www.wch.cn/search?q=ch340g&t=downloads

开发工具

+ - - - - - - - - - - - - - - - - - - - - - @@ -218,30 +213,7 @@ Linux编译环境可以通过Docker方式快速安装,具体请参见[Docker ![](figures/登录成功界面.png "登录成功界面") -### 将Linux shell改为bash - -查看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环境 +### 安装和配置Python 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. 安装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. 安装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 @@ -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'" + +- **现象描述** + + 执行“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'" + +- **现象描述** + +执行“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” + +- **现象描述** + + Linux编译服务器终端输入不识别的命令时,提示"ImportError: No module named apt\_pkg" + + +- **可能原因** + + python3 apt安装兼容性问题。 + +- **解决办法** + + 执行如下命令重新安装python3-apt。 + + ``` + sudo apt-get remove python3-apt + sduo apt-get install python3-apt + ``` + + diff --git "a/zh-cn/device-dev/subsystems/bootstrap\346\234\215\345\212\241\345\220\257\345\212\250\347\273\204\344\273\266.md" "b/zh-cn/device-dev/subsystems/bootstrap\346\234\215\345\212\241\345\220\257\345\212\250\347\273\204\344\273\266.md" index 74a9b380518bec242c8458a0686a4d47ce2f2f49..0f50ea7a38e8d29a7f41922b38deb2017802cd82 100644 --- "a/zh-cn/device-dev/subsystems/bootstrap\346\234\215\345\212\241\345\220\257\345\212\250\347\273\204\344\273\266.md" +++ "b/zh-cn/device-dev/subsystems/bootstrap\346\234\215\345\212\241\345\220\257\345\212\250\347\273\204\344\273\266.md" @@ -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)。 ## 接口说明 diff --git "a/zh-cn/device-dev/subsystems/\345\272\224\347\224\250\351\252\214\347\255\276\345\274\200\345\217\221\346\214\207\345\257\274.md" "b/zh-cn/device-dev/subsystems/\345\272\224\347\224\250\351\252\214\347\255\276\345\274\200\345\217\221\346\214\207\345\257\274.md" index b016af963a765de375b1b16ae25612e11470d67e..d27d394f8bd4ef395f77c04e782a092a7b65caa0 100644 --- "a/zh-cn/device-dev/subsystems/\345\272\224\347\224\250\351\252\214\347\255\276\345\274\200\345\217\221\346\214\207\345\257\274.md" +++ "b/zh-cn/device-dev/subsystems/\345\272\224\347\224\250\351\252\214\347\255\276\345\274\200\345\217\221\346\214\207\345\257\274.md" @@ -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(包含) diff --git "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\270\270\350\247\201\351\227\256\351\242\230.md" "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\270\270\350\247\201\351\227\256\351\242\230.md" index 48f9a93bef6ff8d14a80f2c3954fe39181055fdc..ca00b2428542c6024ff6fa79649c5814646cfd28 100644 --- "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\270\270\350\247\201\351\227\256\351\242\230.md" +++ "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\270\270\350\247\201\351\227\256\351\242\230.md" @@ -67,7 +67,7 @@ 当前用户对riscv编译器路径下的文件访问权限不够。 - ​**解决办法:** - 1. 查询hcc\_riscv32所在目录。 + 1. 查询gcc\_riscv32所在目录。 ``` which riscv32-unknown-elf-gcc diff --git "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\274\200\345\217\221\346\214\207\345\257\274.md" "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\274\200\345\217\221\346\214\207\345\257\274.md" index 3b1f3757ec6a3f1dce0f0f46ed6cda6c1487ac0b..c4db97f437930eac87f4837be5444ed7efbda078 100644 --- "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\274\200\345\217\221\346\214\207\345\257\274.md" +++ "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\345\274\200\345\217\221\346\214\207\345\257\274.md" @@ -15,7 +15,6 @@ build/lite # 编译构建主目录 │ ├── kernel # 内核的编译配置参数 │ └── subsystem # 子系统模板 ├── ndk # NDK相关编译脚本与配置参数 -├── product # 产品全量配置表,包括:配置单元、子系统列表、编译器等。 └── toolchain # 编译工具链相关,包括:编译器路径、编译选项、链接选项等。 ``` diff --git "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\346\246\202\350\277\260.md" "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\346\246\202\350\277\260.md" index 40a636f6f3843dd3b8080acb59a55e2ebfa94a57..ffa38ff484775e21af52e02dd936a0f750761b56 100644 --- "a/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\346\246\202\350\277\260.md" +++ "b/zh-cn/device-dev/subsystems/\347\274\226\350\257\221\346\236\204\345\273\272\346\246\202\350\277\260.md" @@ -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路径。 ``` diff --git a/zh-cn/release-notes/OpenHarmony-1-0-1.md b/zh-cn/release-notes/OpenHarmony-1-0-1.md index 64b353d0cd528a79d311a95b1f53a0b2947478f0..2fd061aa31c810575b9abfeff014db186b4d7115 100644 --- a/zh-cn/release-notes/OpenHarmony-1-0-1.md +++ b/zh-cn/release-notes/OpenHarmony-1-0-1.md @@ -1,6 +1,10 @@ # OpenHarmony 1.0.1(2021-03-15) - [版本概述](#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框架性能和内存得到优化。同时对目录结构及组件仓做了大幅优化。 +## 版本源码获取 + +### 通过镜像站点获取 + +**表 1** 源码获取路径 + + +

开发工具

用途

+

用途

获取途径

+

获取途径

Python3.7+

+

Python3.7+

编译构建工具

+

编译构建工具

https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz

+

通过互联网获取

bash

+

gn

命令处理器

+

产生ninja编译脚本

通过互联网获取

+

https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz

gn

+

ninja

产生ninja编译脚本

+

执行ninja编译脚本

https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz

+

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

ninja

+

LLVM

执行ninja编译脚本

+

编译工具链

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

+

https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar

LLVM

+

hb

编译工具链

+

编译构建命令行工具

https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar

-

hb

-

编译构建命令行工具

-

HarmonyOS源码build_lite仓

+

通过互联网获取

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

版本源码

+

版本信息

+

下载站点

+

SHA256校验码

+

全量代码

+

1.0.1

+

站点

+

SHA256 校验码

+

Hi3861解决方案(二进制)

+

1.0.1

+

站点

+

SHA256 校验码

+

Hi3518解决方案(二进制)

+

1.0.1

+

站点

+

SHA256 校验码

+

Hi3516解决方案(二进制)

+

1.0.1

+

站点

+

SHA256 校验码

+

RELEASE-NOTES

+

1.0.1

+

站点

+

-

+
+ +### 通过repo下载 + +下载命令如下: + +``` +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 +``` + ## 内核 ### 新增特性 diff --git a/zh-cn/release-notes/OpenHarmony-1-0.md b/zh-cn/release-notes/OpenHarmony-1-0.md index 17a0d4544baf0787d49a59cd9e9c2b297d2d6700..1994214ff1e17c22858157bfaa5b67302e6952ad 100644 --- a/zh-cn/release-notes/OpenHarmony-1-0.md +++ b/zh-cn/release-notes/OpenHarmony-1-0.md @@ -1,4 +1,94 @@ # OpenHarmony 1.0(2020-09-10) +- [版本概述](#section249611124916) +- [版本源码获取](#section127301717165113) + - [通过镜像站点获取](#section157648475298) + - [通过repo命令获取](#section49746186307) + + +## 版本概述 + 首次发布OpenHarmony 1.0。 +## 版本源码获取 + +### 通过镜像站点获取 + +**表 1** 源码获取路径 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

版本源码

+

版本信息

+

下载站点

+

SHA256校验码

+

全量代码

+

1.0

+

站点

+

SHA256 校验码

+

Hi3861解决方案(二进制)

+

1.0

+

站点

+

SHA256 校验码

+

Hi3518解决方案(二进制)

+

1.0

+

站点

+

SHA256 校验码

+

Hi3516解决方案(二进制)

+

1.0

+

站点

+

SHA256 校验码

+

RELEASE-NOTES

+

1.0

+

站点

+

-

+
+ +### 通过repo命令获取 + +方式一(推荐):通过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 +``` + diff --git a/zh-cn/release-notes/OpenHarmony-1-1-0-LTS.md b/zh-cn/release-notes/OpenHarmony-1-1-0-LTS.md new file mode 100644 index 0000000000000000000000000000000000000000..05793372f5ef5370714ecf3724468fd181485c0b --- /dev/null +++ b/zh-cn/release-notes/OpenHarmony-1-1-0-LTS.md @@ -0,0 +1,123 @@ +# OpenHarmony 1.1.0 LTS(2021-04-01) + +- [版本概述](#section1846294912228) +- [版本源码获取](#section84808293211) + - [通过镜像站点获取](#section19634542131218) + - [通过repo下载](#section7180193542317) + +- [针对OpenHarmony 1.0.1版本解决的缺陷列表:](#section11935243172612) + +## 版本概述 + +首次发布LTS版本OpenHarmony 1.1.0,本版本在1.0.1版本的基础上修复了部分缺陷。 + +## 版本源码获取 + +### 通过镜像站点获取 + +**表 1** 源码获取路径 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

版本源码

+

版本信息

+

下载站点

+

SHA256校验码

+

全量代码

+

1.1.0

+

站点

+

SHA256 校验码

+

Hi3861解决方案(二进制)

+

1.1.0

+

站点

+

SHA256 校验码

+

Hi3518解决方案(二进制)

+

1.1.0

+

站点

+

SHA256 校验码

+

Hi3516解决方案(二进制)

+

1.1.0

+

站点

+

SHA256 校验码

+

RELEASE-NOTES

+

1.1.0

+

站点

+

-

+
+ +### 通过repo下载 + +下载命令如下: + +``` +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版本解决的缺陷列表: + +已修复问题请参见[表2](#table1934113413913)。 + +**表 2** 修复问题列表 + + + + + + + + + + + + + + + + + + + +

ISSUE

+

问题描述

+

I3EALU

+

【多媒体】cameraActs 用例执行时,找不到相机配置文件,初始失败的问题

+

I3D71U

+

【驱动】反复reset,启动到hmac_main_init SUCCESSULLY后,高概率出现系统挂死问题

+

I3EGUX

+

【可靠性问题】反复reset,出现一次KIdle进程crash,系统挂死无法启动

+

I3DHIL

+

【系统问题】HI3518开源板剩余空间不足,导致ACTS用例大量失败

+
+ diff --git a/zh-cn/release-notes/OpenHarmony-Release-Notes.md b/zh-cn/release-notes/OpenHarmony-Release-Notes.md index 8922217b1669e7409e53ae998a3ea84227487633..ed8f37466f8446bd557cefb1addb8e41dff7ce41 100644 --- a/zh-cn/release-notes/OpenHarmony-Release-Notes.md +++ b/zh-cn/release-notes/OpenHarmony-Release-Notes.md @@ -1,5 +1,6 @@ # 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)