# wiki **Repository Path**: oh-mini/wiki ## Basic Information - **Project Name**: wiki - **Description**: 本仓库内的文档用于描述组织内仓库的相关信息、基于组织内仓库的相关项目的产品说明和使用说明等。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: ohla-v502r - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-19 - **Last Updated**: 2025-04-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # README ## 介绍 本仓库内的文档用于描述组织内仓库的相关信息、基于组织内仓库的相关项目的产品说明和使用说明等。 ## 关于manifest仓库 仓库见 [oh-mini/manifest](https://gitee.com/oh-mini/manifest),该仓库入口为 default_ohla_mini.xml 文件,该文件分为如下四部分: ### 默认的远程仓库源:origin ``` ``` 默认从OpenHarmony组织拉取仓库,默认拉取OpenHarmony-v5.0.2-Release标签的基础代码。 如果需要默认拉取其它标签或其它分支的基础代码,修改这里的revision字段的赋值即可。 ### 默认的远程仓库列表:ohos_lite.xml ``` ``` 引入同目录下的ohos_lite.xml文件(替代默认的 ohos/ohos.xml文件),只拉取必要的L0/L1系统所需要的轻量级仓库,不拉取L2系统需要的标准级仓库,可以大大减少拉取的代码量。 ### 示例项目的仓库:hisilicon ``` ``` 默认拉取了 hisilicon 的上述几个示例项目的仓库,可以在拉取代码完成后,尝试编译其中的L0系统(mini => hisilicon/wifiiot_hispark_pegasus)和L1系统(small => hisilicon/ipcamera_hispark_taurus_linux),确保编译能通过。 这部分仓库可以删除。 ### 与本组织相关的仓库:oh-mini ``` ``` 本组织内的新增仓库,如上面的wiki仓库,可以按上述格式添加上去,方便一并拉取; 本组织内替换掉默认的远程仓库时,如下面的 kernel_liteos_m 仓库,可以参考如下的格式进行替换: ``` ``` ## 获取代码 通过执行如下几条命令获取基础代码: ``` repo init -u git@gitee.com:oh-mini/manifest.git -b ohla-v502r -m default_ohla_mini.xml --no-repo-verify repo sync -c -j8 repo forall -c 'git lfs pull' ./build/prebuilts_download.sh ``` 获取上述代码和默认的编译构建工具之后,可以尝试编译示例项目。 ## 编译代码 安装 OpenHarmony 编译工具 ``` python3 -m pip install --user build/hb ``` 验证 hb 安装成功 ``` export PATH=~/.local/bin:$PATH hb help ``` 以编译L0的wifiiot_hispark_pegasus为例,在代码根目录下执行: ``` hb set ``` 选择 mini,再在子菜单下选择 hisilicon/wifiiot_hispark_pegasus。 再执行: ``` hb build ``` 或者执行: ``` ./build.sh --product-name wifiiot_hispark_pegasus --no-prebuilt-sdk ``` 即可编译指定的项目。 ## 编译代码(ls2k300) 以编译L0的ls2k300_mini_dp为例,在代码根目录下执行: ``` hb set ``` 选择 mini,再在子菜单下选择 loongson/ls2k300_mini_dp。 再执行: ``` hb build ``` 或者执行: ``` hb build -f -b debug --gn-args build_xts=True ``` 即可编译指定的项目。 ``` [OHOS INFO] -------------------------------------------- [OHOS INFO] ccache summary: [OHOS INFO] ccache version: 4.5.1 [OHOS INFO] cache hit (direct): 0 [OHOS INFO] cache hit (preprocessed): 13 [OHOS INFO] cache miss: 3 [OHOS INFO] hit rate: 81.25% [OHOS INFO] miss rate: 18.75% [OHOS INFO] Cache size (GB): 4.94 / 100.00 (4.94 %) [OHOS INFO] --------------------------------------------- [OHOS INFO] end hpm command [OHOS INFO] start run hpm command [OHOS INFO] end hpm command [OHOS INFO] start run hpm command [OHOS INFO] unrecognized ninja log format, we need # ninja log v5 [OHOS INFO] [OHOS INFO] end hpm command [OHOS INFO] start run hpm command [OHOS INFO] c targets overlap rate statistics [OHOS INFO] subsystem files NO. percentage builds NO. percentage overlap rate [OHOS INFO] commonlibrary 2 0.3% 2 0.3% 1.00 [OHOS INFO] hiviewdfx 12 1.8% 12 1.8% 1.00 [OHOS INFO] kernel 50 7.4% 50 7.4% 1.00 [OHOS INFO] security 123 18.1% 123 18.1% 1.00 [OHOS INFO] startup 26 3.8% 26 3.8% 1.00 [OHOS INFO] systemabilitymgr 15 2.2% 15 2.2% 1.00 [OHOS INFO] test 51 7.5% 51 7.5% 1.00 [OHOS INFO] thirdparty 394 58.1% 394 58.1% 1.00 [OHOS INFO] xts 51 7.5% 51 7.5% 1.00 [OHOS INFO] [OHOS INFO] c overall build overlap rate: 1.00 [OHOS INFO] [OHOS INFO] [OHOS INFO] end hpm command [OHOS INFO] build success [OHOS INFO] Cost Time: 0:00:07 ``` ## 运行 ``` => tftp 0x9000000001000000 OHOS_Image.bin Speed: 1000, full duplex TFTP timeout (1 ms) too low, set min = 1000 ms Using ethernet@0x16020000 device TFTP from server 192.168.1.2; our IP address is 192.168.1.20 Filename 'OHOS_Image.bin'. Load address: 0x9000000001000000 Loading: ######################## 632.8 KiB/s done Bytes transferred = 339856 (52f90 hex) => go 0x9000000001000000 U0x0000000002ffc063tion at 0x9000000001000000 ... OHOS start entering kernel init... exception init SysTickStart Enable irq 11 ArchStartSchedule intSave: 0xb4 Entering scheduler LsSystemInit hilog will init. hievent will init. hievent init success. [HCtest Service] HCTest Framework inited. ******To Obtain Product Params Start****** Device Type = NULL Security Patch = NULL OsFullName = DisplayVersion = NULL VersionID = DevUdid = NULL manuFacture = NULL productModel = NULL serial = **** brand = NULL productSeries = NULL softwareModel = NULL HardwareModel = NULL BuildRootHash = NULL marketName = NULL SdkApiVersion = 0 firstApiVersion = 0 bootloaderVersion = NULL incrementalVersion = NULL buildType = NULL buildUser = NULL buildHost = NULL buildTime = NULL AbiList = NULL ******To Obtain Product Params End ****** = Welcome to the OpenHarmony System Arch : Loongarch64 SOC : LS2K300 Board : ls2k300_mini_dp Product : ls2k300_swift kernel : liteos_m OS LEVEL : mini >hiview init success. Start to run test suite:SamgrApiTestSuite >Run test suite 1 times [TestStartBootstrapSamgr001:0]../../../test/xts/acts/startup_lite/bootstrap_hal/src/samgr_api_test.c:342:TestStartBootstrapSamgr001:PASS g_coreInit0: 01: 0default: 03: 04: 05: 0../../../test/xts/acts/startup_lite/bootstrap_hal/src/samgr_api_test.c:353:TestStartBootstrapSamgr002:PASS g_sysServiceInit0: 01: 0default: 03: 04: 05: 0../../../test/xts/acts/startup_lite/bootstrap_hal/src/samgr_api_test.c:365:TestStartBootstrapSamgr003:PASS g_sysFeatureInit0: 01: 0default: 03: 04: 05: 0../../../test/xts/acts/startup_lite/bootstrap_hal/src/samgr_api_test.c:377:TestStartBootstrapSamgr004:PASS g_sysExServiceInit0: 01: 0default: 03: 04: 05: 0g_appServiceInit0: 01: 0default: 03: 04: 05: 0../../../test/xts/acts/startup_lite/bootstrap_hal/src/samgr_api_test.c:389:TestStartBootstrapSamgr005:PASS g_sysExFeatureInit0: 01: 0default: 03: 04: 05: 0g_appFeatureInit0: 01: 0default: 03: 04: 05: 0../../../test/xts/acts/startup_lite/bootstrap_hal/src/samgr_api_test.c:403:TestStartBootstrapSamgr006:PASS g_sysRun0: 01: 0default: 03: 04: 05: 0../../../test/xts/acts/startup_lite/bootstrap_hal/src/samgr_api_test.c:417:TestStartBootstrapSamgr007:PASS +-------------------------------------------+ ----------------------- 7 Tests 0 Failures 0 Ignored OK All the test suites finished! ```