-[Method 3: Acquiring Source Code from Image Sites](#section1186691118430)
-[Method 3: Acquiring Source Code from Image Sites](#section1186691118430)
-[Method 4: Acquiring Source Code from the GitHub Image Repository](#section23448418360)
-[Source Code Directories](#section1072115612811)
-[Source Code Directories](#section1072115612811)
## About OpenHarmony<a name="section6370143622110"></a>
## About OpenHarmony<a name="section6370143622110"></a>
OpenHarmony is an open-source project launched by the OpenAtom Foundation. The purpose of this project is to build an open, distributed operating system \(OS\) framework for smart IoT devices in the full-scenario, full-connectivity, and full-intelligence era.
OpenHarmony is an open-source project launched by the OpenAtom Foundation. The purpose of this project is to build an open, distributed operating system \(OS\) framework for smart IoT devices in the full-scenario, full-connectivity, and full-intelligence era.
The open-source code repositories are available at [https://openharmony.gitee.com](https://openharmony.gitee.com).
The open-source code repositories are available at [https://openharmony.gitee.com](https://openharmony.gitee.com).
## Overview of Source Code Acquisition<a name="section12763342204"></a>
## Overview of Source Code Acquisition<a name="section12763342204"></a>
This document describes how to acquire OpenHarmony source code and provides its directory structure. The OpenHarmony code is open to you as [bundles](../bundles/bundles-standard-rules.md), which can be obtained in any of the following ways:
This document describes how to acquire OpenHarmony source code and provides its directory structure. The OpenHarmony code is open to you as [bundles](../bundles/bundles-standard-rules.md), which can be obtained in any of the following ways:
-**Method 1**: Acquire the source code from a code repository. You can use the **repo** or **git** tool to download the latest code from the code repository.
-**Method 1**: Acquire the source code from a code repository. You can use the**repo**or**git** tool to download the latest code from the code repository.
-**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 2**: Acquire 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**: Download the compressed file of a distribution from an image site. This method provides a fast download speed, so you can also use this method for obtaining the source code of an earlier version.
-**Method 3**: Download the compressed file of a distribution from a mirror site. This method provides a fast download speed, so you can also use this method for obtaining the source code of an earlier version.
-** Method 4**: Acquire the source code from the GitHub image repository. You can use the **repo**or **git**tool to download the latest code from the code repository.
## Method 1: Acquiring Source Code from a Code Repository<a name="section537312010229"></a>
## Method 1: Acquiring Source Code from a Code Repository<a name="section537312010229"></a>
...
@@ -48,7 +50,7 @@ This document describes how to acquire OpenHarmony source code and provides its
...
@@ -48,7 +50,7 @@ This document describes how to acquire OpenHarmony source code and provides its
1. Register your account with Gitee.
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](http://git-scm.com/book/en/v2) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
3. Install the [git client](http://git-scm.com/book/en/v2) and[git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
```
```
git config --global user.name "yourname"
git config --global user.name "yourname"
...
@@ -56,10 +58,10 @@ This document describes how to acquire OpenHarmony source code and provides its
...
@@ -56,10 +58,10 @@ This document describes how to acquire OpenHarmony source code and provides its
git config --global credential.helper store
git config --global credential.helper store
```
```
4. Run the following commands to install the **repo** tool:
4. Run the following commands to install the **repo** tool:
```
```
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
@@ -74,7 +76,7 @@ This document describes how to acquire OpenHarmony source code and provides its
...
@@ -74,7 +76,7 @@ This document describes how to acquire OpenHarmony source code and provides its
-**Obtaining OpenHarmony master code**
-**Obtaining OpenHarmony master code**
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
@@ -104,28 +106,25 @@ This document describes how to acquire OpenHarmony source code and provides its
...
@@ -104,28 +106,25 @@ This document describes how to acquire OpenHarmony source code and provides its
repo forall -c 'git lfs pull'
repo forall -c 'git lfs pull'
```
```
- Obtaining the source code of other OpenHarmony releases
- For details about how to obtain the source code of other OpenHarmony releases, see the [Release-Notes](../../release-notes/Readme.md).
For details about how to obtain the source code of other OpenHarmony releases, see the [Release-Notes](../../release-notes/Readme.md).
## Method 2: Acquiring Source Code from HPM<a name="section463013147412"></a>
## Method 2: Acquiring Source Code from HPM<a name="section463013147412"></a>
### When to Use<a name="section26661067443"></a>
### When to Use<a name="section26661067443"></a>
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) website, 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.
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) website, 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.
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.
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.
2. Click **Download** to download the distribution to your local PC.
3. Click **Custom** to add or delete bundles of the distribution.
3. Click **Custom** to add or delete bundles of the distribution.
**Figure 2** Example distribution<a name="fig950763112375"></a>
**Figure 2** Example distribution<a name="fig950763112375"></a>
1. Access the **Custom solution** page, as shown in the following figure.
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.
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.
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.
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.
1. Decompress the downloaded file using the CLI tool CMD \(shell in Linux\).
1. Decompress the downloaded file using the CLI tool CMD \(shell in Linux\).
2. In the generated directory, run the **hpm install** command.
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.\)
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 Image Sites<a name="section1186691118430"></a>
## Method 3: Acquiring Source Code from Mirror Sites<a name="section1186691118430"></a>
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.
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.
>- The table below provides only the sites for downloading the latest OpenHarmony master and LTS code. For details about how to obtain the source code of earlier versions, see the [Release-Notes](../../release-notes/Readme.md).
>- The table below provides only the sites for downloading the latest OpenHarmony master and LTS code. For details about how to obtain the source code of earlier versions, see the [Release-Notes](../../release-notes/Readme.md).
>- The Master 1.0 version is no longer maintained.
>- The Master 1.0 version is no longer maintained.
**Table 1** Sites for acquiring source code from image sites
<trid="row17736152318398"><tdclass="cellrowborder"valign="top"width="25%"><pid="p1110983610395"><aname="p1110983610395"></a><aname="p1110983610395"></a>Full code (for mini and small systems)</p>
<trid="row17736152318398"><tdclass="cellrowborder"valign="top"width="25%"><pid="p1110983610395"><aname="p1110983610395"></a><aname="p1110983610395"></a>Full code (for mini and small systems)</p>
...
@@ -237,7 +236,7 @@ To ensure the download performance, you are advised to download the source code
...
@@ -237,7 +236,7 @@ To ensure the download performance, you are advised to download the source code
<trid="row4769431134919"><tdclass="cellrowborder"valign="top"width="25%"><pid="p97691031124913"><aname="p97691031124913"></a><aname="p97691031124913"></a>Full code (for standard systems)</p>
<trid="row4769431134919"><tdclass="cellrowborder"valign="top"width="25%"><pid="p97691031124913"><aname="p97691031124913"></a><aname="p97691031124913"></a>Full code (for standard systems)</p>
...
@@ -300,7 +299,7 @@ To ensure the download performance, you are advised to download the source code
...
@@ -300,7 +299,7 @@ To ensure the download performance, you are advised to download the source code
<tdclass="cellrowborder"valign="top"width="25%"><pid="p7416184953916"><aname="p7416184953916"></a><aname="p7416184953916"></a>1.0 (no longer maintained)</p>
<tdclass="cellrowborder"valign="top"width="25%"><pid="p7416184953916"><aname="p7416184953916"></a><aname="p7416184953916"></a>1.0 (no longer maintained)</p>
</td>
</td>
...
@@ -309,13 +308,13 @@ To ensure the download performance, you are advised to download the source code
...
@@ -309,13 +308,13 @@ To ensure the download performance, you are advised to download the source code
@@ -330,89 +329,182 @@ To ensure the download performance, you are advised to download the source code
...
@@ -330,89 +329,182 @@ To ensure the download performance, you are advised to download the source code
</tbody>
</tbody>
</table>
</table>
## Method 4: Acquiring Source Code from the GitHub Image Repository (at 23:00 UTC Every Day)<a name="section23448418360"></a>
Method 1 \(recommended\): Use the**repo**tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p090352912914"><aname="p090352912914"></a><aname="p090352912914"></a>Application samples, for example, <strongid="b689814231158"><aname="b689814231158"></a><aname="b689814231158"></a>camera</strong></p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p090352912914"><aname="p090352912914"></a><aname="p090352912914"></a>Application samples, for example, <strongid="b689814231158"><aname="b689814231158"></a><aname="b689814231158"></a>camera</strong></p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p790472962914"><aname="p790472962914"></a><aname="p790472962914"></a>Basic software service subsystem set and hardware service subsystem set</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p790472962914"><aname="p790472962914"></a><aname="p790472962914"></a>Basic software service subsystem set and hardware service subsystem set</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p690412296297"><aname="p690412296297"></a><aname="p690412296297"></a>Commonly used development tools</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p690412296297"><aname="p690412296297"></a><aname="p690412296297"></a>Commonly used development tools</p>