The OpenHarmony warehouse is organized to specify the system type and download the corresponding code.

Foreword:

When we downloaded the OpenHarmony code in the past, we always needed to download the full package. The amount of code was very large, and now it is more than 30G.
And if we just want to develop lightweight systems, such as Runhe's Hi3861 smart home development kit, we actually don't use that much code. Many of the codes are small systems and standard systems, which are very redundant to download.
Finally, in the near future, the OpenHarmony warehouse has undergone major rectification and can support downloading the corresponding code for specified system types.
Let me show you, I downloaded the master branch of the lightweight system today. The entire folder is only 5G. There are also doc folders and device files that have not been sorted. The repo folder takes up 2.9G. But overall it’s much better than before when I had to download more than 30 gigabytes in one go.
Insert image description here

Warehouse description

Detailed instructions can be found in the official documentation: https://gitee.com/openharmony/manifest

1. Warehouse classification description

In order to support downloading code according to different types, OpenHarmony defines the following categories for each code repository:

Classification Classification description group
Lightweight system warehouse Code repository for lightweight systems ohos:mini
Small system warehouse Code repository for small systems ohos:small
Standard system warehouse Code repository for standard systems ohos:standard
System component warehouse In the standard system's hardware-independent code warehouse, the build products are deployed in the /system directory. ohos:system
Chip component warehouse A warehouse related to chips or hardware in a standard system, and built products are deployed in the /vendor or /chipset directory. ohos:chipset

A warehouse can belong to multiple groups, as shown in the following code. Multiple groups in groups are connected together with ",".

<project name="miscservices_inputmethod" path="base/miscservices/inputmethod" groups="ohos:standard,ohos:system"/>

<project name="ai_engine" path="foundation/ai/engine" groups="ohos:mini,ohos:small,ohos:standard,ohos:system"/>

Each warehouse can be applied to mini, small or standard systems. If it is applicable to standard system, it needs to be clear whether it is of ohos:system type or ohos:chipset type.

Each warehouse needs to join the default default group.

2. Platform warehouse and chip warehouse

OpenHarmony will support more and more chip platforms, and each chip platform will create corresponding warehouses under the device and vendor directories; for distinction, we call such warehouses chip warehouses, and other warehouses called platform warehouses. Platform warehouses and chip warehouses have different life cycles. Chip warehouses may be gradually abandoned as hardware evolves, while platform warehouses have little to do with specific hardware and have a relatively longer life cycle.

Platform warehouses are organized in the manifests/ohos/ohos.xml file, and chip warehouses are organized in the **manifests/chipsets/** directory. The full code warehouse organization format is as follows:

manifest
    ├── default.xml
    │   └── ohos
    │   └── ohos.xml
    └── chipsets
        ├── all.xml
        ├── chipset1.xml
        ├── chipset2.xml
        ├── chipsetN.xml
        ├── chipset1
        │   └── chipset1-detail.xml
        ├── chipset2
        │   └── chipset2-detail.xml
        └── chipsetN
            └── chipsetN-detail.xml
  • default.xml consists of ohos/ohos.xml and chipsets/all.xml, which is a collection of all platform warehouses and chip warehouses; all code warehouses can be downloaded in this way.
  • chipsets/chipsetN/chipsetN-detail.xml is a collection of warehouses introduced by a single chip platform. chipsets/chipsetN.xml is a combination of the ohos/ohos.xml and chipsetN-detail.xml warehouses and is used to download the full amount of the chip platform. warehouse.
  • chipsets/all.xml is the warehouse combination of all chip platforms xxx/xxx-detail.xml, which is used to summarize all chip warehouses.

According to the above classification, various code download methods can be supported:

Systematic classification Code download method Download command illustrate
All systems full code repo init -u URL -b master The full code of OpenHarmony is downloaded by default (compatible with existing download commands).
lightweight system full code repo init -u URL -b master -g ohos:mini Download the full code of the lightweight system.
lightweight system Specify chip code repo init -u URL -b master -m chipsets/chipsetN.xml -g ohos:mini Download the code for the specified chip for the lightweight system.
small system full code repo init -u URL -b master -g ohos:small Download the full code of the small system.
small system Specify chip code repo init -u URL -b master -m chipsets/chipsetN.xml -g ohos:small Download the code for a specific chip in a small system.
Standard system full code repo init -u URL -b master -g ohos:standard Download the full code for the standard system.
Standard system Specify chip code repo init -u URL -b master -m chipsets/chipsetN.xml -g ohos:standard Download the code for the standard system specific chip.
Standard system System component code repo init -u URL -b master -g ohos:system Download code for standard system components.
Standard system Chip component code repo init -u URL -b master -g ohos:chipset Download code for chip components (all chip platforms).
Standard system Specify chip component code repo init -u URL -b master -m chipsets/chipsetN.xml -g ohos:chipset Download the chip component code of the specified chip chipsetN.

3. How to use

For example, if we want to download the master lightweight system, the download command is:

repo init -u URL -b master -g ohos:mini

The URL can be replaced with [email protected]:openharmony/manifest.git,
that is, the download command is as follows:

repo init -u git@gitee.com:openharmony/manifest.git -b master -g ohos:mini

repo sync -c
repo forall -c 'git lfs pull'

If an error is reported during compilation:
Insert image description here
it can be executed

pip install Jinja2

Finally, the compilation passed and the total code size was only 5G.
Insert image description here

Guess you like

Origin blog.csdn.net/aa120515692/article/details/124320223