[文章]NanoPi M1 Plus 移植 Openharmony 之建立自己的开发仓库

阅读量0
0
4


1、前言
因为之前快速移植的时候,除了boot.img用自己编译的,其他img多用树莓派3B的img就能正常点亮,所以为了能快速成功移植选用树莓派3B作为参考。目前已经可以编译通过,可以显示画面,并支持触摸驱动,其他功能还很不完善。
2、 manifest base 的选择

树莓派3B的代码下载可以参考以下官方链接:
树莓派3B快速上手 OpenHarmony:https://gitee.com/openharmony-si ... 1%E5%9B%BA%E4%BB%B6
或者原作者xfan1024的Gitee 仓库 https://gitee.com/xfan1024/oh-rpi3b

树莓派移植的主要仓库在:https://gitee.com/xfan1024/
我的编译环境之前用的 repo init 指令如下:
  1. repo init -u https://gitee.com/xfan1024/oh-rpi3b.git -m oh-rpi3b.xml -b openharmony-3.0 --no-repo-verify
复制代码

repo 参数说明如下:
-u URL,指定manifest位置
-m 选择仓库中的manifest文件,缺省为default.xml
-b 指定revision, 如一个特定的manifest分支.
从以上可以看出我用的树莓派3B对应的mainfest仓库为 https://gitee.com/xfan1024/oh-rpi3b.git 这个仓库的openharmony-3.0分支的oh-rpi3b.xml
如果参考openharmony官方网站的则是
  1. repo init -u https://gitee.com/openharmony-sig/manifest.git -m devboard_rpi3b.xml -b master --no-repo-verify
复制代码


对应的mainfest仓库为 https://gitee.com/openharmony-sig/manifest.git 这个仓库的master 分支的devboard_rpi3b.xml文件
这两个仓库版目前版本上差异不大只是vendor/rpi3这个仓库一个用sig下的一个是用xfan1024下的
3、参考树莓派3B新增NanoPi M1 Plus 的仓库

3.1、克隆树莓派3B仓库到自己的Gitee下
从oh-rpi3b.xml 中可以知道针对树莓派3B的主要差异如下:
   
  1. <!--StartFragment--><blockquote>  <remote name="xfan1024" fetch="." review="https://gitee.com/xfan1024/"/>
复制代码
可以先将这几个仓库从 https://gitee.com/xfan1024/ 克隆到自己的gitee下,我这边新建了一个OHOS_nanopi_m1_plus组织,然后将以上6个仓库克隆过来。
OHOS_nanopi_m1_plus组织地址:https://gitee.com/ohos_nanopi_m1_plus
修改oh-rpi3b.xml中以下内容:
将remote name="xfan1024"替换为remote name="ohos_nanopi_m1_plus"
将fetch="." 替换fetch="https://gitee.com/ohos_nanopi_m1_plus"
将review="https://gitee.com/xfan1024/"/替换为review="https://gitee.com/ohos_nanopi_m1_plus/"
将全部的remote="xfan1024"替换为remote="ohos_nanopi_m1_plus"
相关修改如下

  1. <blockquote><span style="font-size: 14px;">  <remote name="ohos_nanopi_m1_plus" fetch="https://gitee.com/ohos_nanopi_m1_plus" review="https://gitee.com/ohos_nanopi_m1_plus/"/></span>
复制代码
   将修改后的完整oh-rpi3b.xml重命名为任意你想要的名字如devboard_nanopim1plus_tag.xml,并在自己的gitee/或组织下建立一个manifest的仓库,把这个文件上传,将repo ini 指令中的url和manifest换成你自己的地址和文件,这样子你就可以通过以下指令下载到可以编译树莓派3B的仓库。
  1. <blockquote><span style="font-size: 14px;">repo init -u https://gitee.com/ohos_nanopi_m1_plus/manifest.git -m devboard_nanopim1plus_tagr.xml -b master --no-repo-verify</span>
复制代码



3.2、客制化NanoPi M1 Plus
首先我们列一个表格,填入信息如下
productdevicevendorsocvendor
含义嵌入式产品名SOC名产品制造商SOC制造商
名字nanopim1plusallwinnerh3friendlyarmallwinner
3.2.1、 建立NanoPi M1 Plus的 kernel 仓库

NanoPi M1 Plus的kernel 移植可以参考之前发的帖子 https://bbs.elecfans.com/forum.php?mod=viewthread&tid=2232704&page=1#pid8663169
目前我移植使用的config是ohos_sunxi_defconfig可以比对sunxi_defconfig来查看差异部分,多开的config如下
  1. CONFIG_DRM_FBDEV_OVERALLOC=100#修改显示问题,具体原因还不清楚
  2. CONFIG_HID_MULTITOUCH=y#修改支持触摸
  3. CONFIG_HILOG=y#以下ohos 特性移植
  4. CONFIG_HI_LOG_BUFFER_SIZE=2048
  5. CONFIG_HIEVENT=y
  6. CONFIG_DRIVERS_HDF=y
  7. CONFIG_HDF_SUPPORT_LEVEL=2
  8. CONFIG_DRIVERS_HDF_PLATFORM=y
  9. CONFIG_DRIVERS_HDF_PLATFORM_MIPI_DSI=y
  10. CONFIG_DRIVERS_HDF_PLATFORM_GPIO=y
  11. CONFIG_DRIVERS_HDF_PLATFORM_I2C=y
  12. CONFIG_DRIVERS_HDF_PLATFORM_UART=y
  13. CONFIG_DRIVERS_HDF_TEST=y
  14. CONFIG_AUDIT=y#以下SECURITY相关
  15. CONFIG_HAVE_ARCH_AUDITSYSCALL=y
  16. CONFIG_AUDITSYSCALL=y
  17. CONFIG_AUDIT_WATCH=y
  18. CONFIG_AUDIT_TREE=y
  19. CONFIG_NETWORK_SECMARK=y
  20. CONFIG_ANDROID=y
  21. CONFIG_ANDROID_BINDER_IPC=y
  22. CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
  23. CONFIG_ANDROID_BINDER_IPC_32BIT=y
  24. CONFIG_NFS_V4_SECURITY_LABEL=y
  25. CONFIG_SECURITY=y
  26. CONFIG_LSM_MMAP_MIN_ADDR=32768
  27. CONFIG_SECURITY_NETWORK=y
  28. CONFIG_SECURITY_SELINUX=y
  29. CONFIG_SECURITY_SELINUX_BOOTPARAM=y
  30. CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1
  31. CONFIG_SECURITY_SELINUX_DEVELOP=y
  32. CONFIG_SECURITY_SELINUX_AVC_STATS=y
  33. CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
  34. CONFIG_INTEGRITY=y
  35. CONFIG_INTEGRITY_AUDIT=y
复制代码


移植后的仓库已上传 https://gitee.com/ohos_nanopi_m1_plus/oh-nanopi-m1-plus-kernel
上传好后将devboard_nanopim1plus_tagr.xml中
  1. <project name="oh-rpi3b-vendor" path="vendor/rpi3" remote="xfan1024" revision="f6da250bb8cdd166f6ff2ddb061c60aa3aa70b09" upstream="master" dest-branch="master"/>   
复制代码


修改为
  1. <project name="oh-nanopi-m1-plus-kernel" path="kernel/linux-nanopim1plus" remote="ohos_nanopi_m1_plus" revision="master" upstream="master" dest-branch="master"/>   
复制代码

这样子就将kernel 的仓库替换好了。
3.2.2、 建立NanoPi M1 Plus的 vendor 仓库

Vendor 的仓库内容暂时没有做修改,但是为了后续修改方便,我拷贝了一份上传到
https://gitee.com/ohos_nanopi_m1_plus/oh-nanopi-m1-plus-vendor
另外因为我们定义的"产品制造商"是“friendlyarm”所以要放到"vendor/friendlyarm"路径下,修改devboard_nanopim1plus_tagr.xml中
  1. <project name="oh-rpi3b-vendor" path="vendor/rpi3" remote="xfan1024" revision="f6da250bb8cdd166f6ff2ddb061c60aa3aa70b09" upstream="master" dest-branch="master"/>   
复制代码



  1. <project name="oh-nanopi-m1-plus-vendor" path="vendor/friendlyarm" remote="ohos_nanopi_m1_plus" revision="master" upstream="master" dest-branch="master"/>   
复制代码


3.2.3、 建立NanoPi M1 Plus的 device 仓库
device 目录结构是device{SOC制造商}{SOC名} 先拷贝一份devicerpi3为deviceallwinner
修改如下 deviceallwinnerbuildohos.build

  1. {
  2.     "subsystem": "allwinner_products",
  3.     "parts": {
  4.         "allwinner_products": {
  5.             "module_list": [
  6.                 "//device/allwinner/build:products_group"
  7.             ]
  8.         }
  9.     }
  10. }
复制代码
deviceallwinnerbuildBUILD.gn
  1. import("//build/ohos.gni")
  2. device_type = "allwinnerh3"
  3. group("products_group") {
  4.   if (device_type == "allwinnerh3") {
  5.     deps = [
  6.       "//device/allwinner/allwinnerh3:allwinnerh3_group",
  7.     ]
  8.   }
  9. }
复制代码


将deviceallwinnerrpi3改为deviceallwinnerallwinnerh3,并 将目下make_rpi_sdcard_image.py修改为make_nanopim1plus_sdcard_image.py 将build-rpi3.py修改为deviceallwinnerallwinnerh3build-nanopim1plus.py并修改如下:
  1.     cmd = 'bash build.sh --product-name nanopim1plus --ccache --build-target firmware'
  2.         print('please run: python3 ./build-nanopim1plus.py build')
  3.     print('    python3 ./build-nanopim1plus.py build')
  4.     print('    python3 ./build-nanopim1plus.py flash /dev/sdx')
复制代码


将deviceallwinnerallwinnerh3BUILD.gn修改为如下
  1. import("//build/ohos.gni")

  2. print("allwinnerh3_group in")
  3. group("allwinnerh3_group") {
  4.   deps = [
  5.     "kernel:allwinnerh3_modules",
  6.     "hisi_lib:hisi_lib",
  7.     "build:allwinnerh3_prebuilts_files",
  8.     "prebuilts:prebuilts",
  9.   ]
  10. }

  11. action("firmware") {
  12.   deps = [
  13.     "kernel:allwinnerh3_bootimg",
  14.     "//build/core/gn:images",
  15.     "//third_party/firmware-utils:ptgen(${host_toolchain})"
  16.   ]
  17.   script = "make_nanopim1plus_sdcard_image.py"
  18.   outputs = [ "$root_build_dir/packages/phone/images/firmware.img" ]
  19.   args = [
  20.     "--output",
  21.     rebase_path("$root_build_dir/packages/phone/images/firmware.img"),
  22.     #"--userdata",
  23.     #"300M",
  24.     rebase_path("$root_build_dir/packages/phone/images/boot.img"),
  25.     rebase_path("$root_build_dir/packages/phone/images/system.img"),
  26.     rebase_path("$root_build_dir/packages/phone/images/vendor.img"),
  27.     rebase_path("$root_build_dir/packages/phone/images/userdata.img"),
  28.   ]
  29. }
复制代码


deviceallwinnerallwinnerh3kernelbuild_kernel.py 修改如下
  1. os.environ['CROSS_COMPILE'] = 'arm-linux-'
  2. defconfig = 'ohos_sunxi_defconfig'
  3. kernel_dir = os.path.abspath('../../kernel/linux-nanopim1plus')
  4.     subprocess.run(F'touch .scmversion', shell=True, check=True)
  5.     subprocess.run(F'make {defconfig} ARCH=arm CROSS_COMPILE=arm-linux-', shell=True, check=True)
  6.     subprocess.run(F'make -j{nproc+1} zImage dtbs ARCH=arm CROSS_COMPILE=arm-linux-', shell=True, check=True)
  7.     #for ko in kolist:
  8.     #    shutil.copy(os.path.join(kernel_dir, ko), modules_dir)
  9.     #overlays_dir = 'boot/overlays'
  10.     #os.mkdir(overlays_dir)
  11.         os.path.join(kernel_dir, 'arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dtb'),
  12.     #shutil.copy(
  13.     #    os.path.join(kernel_dir, 'arch/arm/boot/dts/overlays/vc4-kms-v3d.dtbo'),
  14.     #    overlays_dir
  15.     #)
复制代码


接着将所有子目录下的BUILD.gn中rpi3_products改为allwinner_products在将其他的“rpi3_”开头的内容修改为“allwinnerh3_” BUILD.gn还有修改的内容参考如下 deviceallwinnerallwinnerh3kernelBUILD.gn
  1. group("allwinnerh3_modules") {
  2.     print("allwinnerh3_modules in")
  3. #    deps = allwinnerh3_modules_deps
  4. }
复制代码
deviceallwinnerallwinnerh3hisi_libBUILD.gn
  1. GPL_SDK_LIB_DIR = "//device/allwinner/allwinnerh3/hisi_lib/lib"
  2. GPL_SDK_ETC_DIR = "//device/allwinner/allwinnerh3/hisi_lib/etc"
复制代码

   另外将 deviceallwinnerallwinnerh3buildvendoretcfstab.rpi3 修改为fstab.allwinnerh3
并且deviceallwinnerallwinnerh3kernelboot这个目录替换为NanoPi M1 Plus的boot 分区
修改后的仓库上传
https://gitee.com/ohos_nanopi_m1_plus/oh-nanopi-m1-plus-device
最后修改 上传好后将devboard_nanopim1plus_tagr.xml中
  1.   <project name="oh-rpi3b-device" path="device/rpi3" remote="xfan1024" revision="14fd2079bc9286d13ad6793149a71db8f35507c1" upstream="master" dest-branch="master">
  2.     <linkfile src="rpi3/build-rpi3.py" dest="build-rpi3.py"/>
  3.   </project>
复制代码


修改为
  1.   <project name="oh-nanopi-m1-plus-device" path="device/allwinner" remote="ohos_nanopi_m1_plus" revision="master" upstream="master" dest-branch="master">
  2.     <linkfile src="allwinnerh3/build-nanopim1plus.py" dest="build-nanopim1plus.py"/>
  3.   </project>
复制代码


3.2.4、 建立NanoPi M1 Plus的 projectpatch 仓库
这一部分主要修改如下 将projectpatchpatchesbuild001-build-support-rpi3.patch移除并在这个目录下新增如下 0001-PATCH-Support-nanopim1plus.patch,这个patch可以修改后commit再用git format-patch生成 0001-PATCH-Support-nanopim1plus.patch
  1. From a131f7d235ca7cf8acd0506a654bf02fa3294e03 Mon Sep 17 00:00:00 2001
  2. From: soon_l <[email]lxs_vip@126.com[/email]>
  3. Date: Tue, 11 Jan 2022 23:37:38 +0800
  4. Subject: [PATCH] [PATCH] Support nanopim1plus

  5. :Release Notes:
  6. [PATCH] Support nanopim1plus
  7. :Detailed Notes:
  8. - Problem : [PATCH] Support nanopim1plus
  9. - RootCause : [PATCH] Support nanopim1plus
  10. - Solution : [PATCH] Support nanopim1plus
  11. - Author : Soon_L
  12. - Build : ok

  13. :Testing Preformed:
  14. How to Test :
  15. build

  16. Change-Id: I2f09e00e8c5ee27da4b7422fc5bfd0878d10af5d
  17. ---
  18. subsystem_config.json | 6 ++++++
  19. 1 file changed, 6 insertions(+)

  20. diff --git a/subsystem_config.json b/subsystem_config.json
  21. index 4288f49..21447e3 100644
  22. --- a/subsystem_config.json
  23. +++ b/subsystem_config.json
  24. @@ -11,6 +11,12 @@
  25.      "name": "account",
  26.      "dir": "base"
  27.    },
  28. +  "allwinner_products":{
  29. +    "project": "hmf/allwinner_products",
  30. +    "path": "device/allwinner/build",
  31. +    "name": "allwinner_products",
  32. +    "dir": "device/allwinner"
  33. +   },
  34.    "distributeddatamgr": {
  35.      "project": "hmf/distributeddatamgr",
  36.      "path": "foundation/distributeddatamgr",
  37. --
  38. 2.25.1
复制代码


修改projectpatchpatchesdrivers_peripheral001-support-rpi3.patch
  1. +    if ((device_type == "Hi3516DV300") || (device_type == "DAYU") || (device_type == "ohos-arm64") || (device_type == "rpi3")) {   
复制代码


改为
  1. +    if ((device_type == "Hi3516DV300") || (device_type == "DAYU") || (device_type == "ohos-arm64") || (device_type == "nanopim1plus")) {
复制代码

   projectpatchpatchesproductdefine_common下删除0001-support-rpi3.patch,新增 0001-PATCH-Support-nanopim1plus.patch
  1. From a944c7ee0608aa0255b535668e59338ca5f07f06 Mon Sep 17 00:00:00 2001
  2. From: soon_l <[email]lxs_vip@126.com[/email]>
  3. Date: Sun, 16 Jan 2022 21:58:57 +0800
  4. Subject: [PATCH] [PATCH] [PATCH] Support nanopim1plus

  5. :Release Notes:

  6. :Detailed Notes:
  7. - Problem : Support nanopim1plus
  8. - RootCause : Support nanopim1plus
  9. - Solution : Support nanopim1plus
  10. - Author : Soon_L
  11. - Build : ok

  12. :Testing Preformed:
  13. How to Test :
  14. build

  15. Change-Id: Ic2aabbb2b0bff96ad7447225b8f9d82398040319
  16. ---
  17. device/allwinnerh3.json    |  7 ++++
  18. products/nanopim1plus.json | 81 ++++++++++++++++++++++++++++++++++++++
  19. 2 files changed, 88 insertions(+)
  20. create mode 100755 device/allwinnerh3.json
  21. create mode 100755 products/nanopim1plus.json

  22. diff --git a/device/allwinnerh3.json b/device/allwinnerh3.json
  23. new file mode 100755
  24. index 0000000..68dcf27
  25. --- /dev/null
  26. +++ b/device/allwinnerh3.json
  27. @@ -0,0 +1,7 @@
  28. +{
  29. +    "device_name": "allwinnerh3",
  30. +    "device_company": "allwinner",
  31. +    "target_os": "ohos",
  32. +    "target_cpu": "arm",
  33. +    "kernel_version": ""
  34. +}
  35. diff --git a/products/nanopim1plus.json b/products/nanopim1plus.json
  36. new file mode 100755
  37. index 0000000..0f142c1
  38. --- /dev/null
  39. +++ b/products/nanopim1plus.json
  40. @@ -0,0 +1,81 @@
  41. +{
  42. +  "product_name": "nanopim1plus",
  43. +  "product_company": "friendlyarm",
  44. +  "product_device": "allwinnerh3",
  45. +  "version": "2.0",
  46. +  "type": "standard",
  47. +  "parts":{
  48. +    "ace:ace_engine_standard":{},
  49. +    "ace:napi":{},
  50. +    "account:os_account_standard":{},
  51. +    "distributeddatamgr:native_appdatamgr":{},
  52. +    "distributeddatamgr:distributeddatamgr":{},
  53. +    "distributeddatamgr:appdatamgr_jskits":{},
  54. +    "distributeddatamgr:distributedfilejs":{},
  55. +    "distributeddatamgr:e2fsprogs":{},
  56. +    "common:common":{},
  57. +    "security:permission_standard":{},
  58. +    "startup:startup_l2":{},
  59. +    "startup:init":{},
  60. +    "hiviewdfx:hiviewdfx_hilog_native":{},
  61. +    "hiviewdfx:hilog_native":{},
  62. +    "hiviewdfx:hilog_service":{},
  63. +    "hiviewdfx:hisysevent_native":{},
  64. +    "hiviewdfx:hiappevent_js":{},
  65. +    "hiviewdfx:hiview":{},
  66. +    "hiviewdfx:faultloggerd":{},
  67. +    "utils:utils_base":{},
  68. +    "subsystem_examples:subsystem_examples":{},
  69. +    "allwinner_products:allwinner_products":{},
  70. +    "appexecfwk:appexecfwk_standard":{},
  71. +    "aafwk:aafwk_standard":{},
  72. +    "notification:ces_standard":{},
  73. +    "notification:ans_standard":{},
  74. +    "communication:ipc":{},
  75. +    "communication:net_manager":{},
  76. +    "communication:dsoftbus_standard":{},
  77. +    "communication:wifi_standard":{},
  78. +    "communication:wifi_native_js":{},
  79. +    "communication:bluetooth_native_js":{},
  80. +    "distributedschedule:samgr_L2":{},
  81. +    "distributedschedule:safwk":{},
  82. +    "distributedschedule:dmsfwk_standard":{},
  83. +    "hdf:hdf":{},
  84. +    "updater:updater":{},
  85. +    "developtools:bytrace_standard":{},
  86. +    "developtools:dropbear":{},
  87. +    "developtools:profiler":{},
  88. +    "sensors:sensors_miscdevice":{},
  89. +    "graphic:graphic_standard":{},
  90. +    "security:appverify":{},
  91. +    "security:huks_standard":{},
  92. +    "security:deviceauth_standard":{},
  93. +    "security:dataclassification":{},
  94. +    "sensors:sensors_sensor":{},
  95. +    "miscservices:time_native":{},
  96. +    "multimedia:multimedia_histreamer":{},
  97. +    "multimedia:multimedia_media_standard":{},
  98. +    "multimedia:multimedia_audio_standard":{},
  99. +    "multimedia:multimedia_camera_standard":{},
  100. +    "multimedia:multimedia_image_standard":{},
  101. +    "multimedia:multimedia_media_library_standard":{},
  102. +    "multimodalinput:multimodalinput_base":{},
  103. +    "telephony:core_service":{},
  104. +    "telephony:ril_adapter":{},
  105. +    "telephony:data_storage":{},
  106. +    "telephony:state_registry":{},
  107. +    "telephony:cellular_call":{},
  108. +    "telephony:cellular_data":{},
  109. +    "telephony:sms_mms":{},
  110. +    "telephony:call_manager":{},
  111. +    "global:i18n_standard":{},
  112. +    "global:resmgr_standard":{},
  113. +    "powermgr:power_manager_native":{},
  114. +    "powermgr:battery_manager_native":{},
  115. +    "powermgr:display_manager_native":{},
  116. +    "applications:prebuilt_hap":{},
  117. +    "wpa_supplicant-2.9:wpa_supplicant-2.9":{},
  118. +    "xts:phone_tests":{},
  119. +    "distributedhardware:device_manager_base":{}
  120. +  }
  121. +}
  122. --
  123. 2.25.1
复制代码




  修改后projectpatch上传 https://gitee.com/ohos_nanopi_m1_plus/oh-nanopi-m1-plus-projectpatch
上传好后将devboard_nanopim1plus_tagr.xml中
  1. <project name="oh-rpi3b-projectpatch" path="projectpatch" remote="xfan1024" revision="fd9ab7480be43d80e2306a9fae8b38974223ee1a" upstream="master" dest-branch="master"/>   
复制代码


修改为
  1. <project name="oh-nanopi-m1-plus-projectpatch" path="projectpatch" remote="ohos_nanopi_m1_plus" revision="master" upstream="master" dest-branch="master"/>   
复制代码


3.2.4、 建立NanoPi M1 Plus的 toolchain 和 oh-sd-fuse_h3仓库
toolchain 主要放编译kernel的toolchain仓库路径:https://gitee.com/ohos_nanopi_m1_plus/oh-nanopi-m1-plus-toolchain oh-sd-fuse_h3 仓库路径 https://gitee.com/ohos_nanopi_m1_plus/oh-sd-fuse_h3

4 NanoPi M1 Plus 项目编译说明
4.1 NanoPi M1 Plus 移植Openharmony项目源码下载      
  1. mkdir ~/nanopim1plus
复制代码


通过repo获取 方式一(推荐) 通过repo + ssh 下载(需注册公钥,请参考码云帮助中心)。
  1. <font color="#333333" face="微软雅黑"><span style="font-size: 18px;">repo init -u </span></font><a href="mailto:git@gitee.com" target="_blank" style="color: rgb(51, 51, 51); font-family: 微软雅黑; font-size: 18px;">[email]git@gitee.com[/email]</a><font color="#333333" face="微软雅黑"><span style="font-size: 18px;">:ohos_nanopi_m1_plus/manifest.git -m devboard_nanopim1plus_tag.xml -b master --no-repo-verify</span></font>
复制代码


方式二
通过repo + https 下载。
  1. <font color="#333333" face="微软雅黑"><span style="font-size: 18px;">repo init -u </span></font><a href="https://gitee.com/ohos_nanopi_m1_plus/manifest.git" target="_blank" style="color: rgb(51, 51, 51); font-family: 微软雅黑; font-size: 18px;">[url]https://gitee.com/ohos_nanopi_m1_plus/manifest.git</a><font[/url] color="#333333" face="微软雅黑"><span style="font-size: 18px;"> -m devboard_nanopim1plus_tag.xml -b master --no-repo-verify</span></font>
复制代码



4.2 执行prebuilts在源码根目录下执行脚本,安装编译器及二进制工具。
  1.       bash build/prebuilts_download.sh   
复制代码



4.3 打入补丁解压toolchain在源码根目录下执行
  1. python3 projectpatch/patch.py
复制代码


4.4 编译指令
在源码根目录下执行
  1. export PATH="$PATH:$(pwd)/toolchain/4.9.3/bin"
复制代码



4.5 合成SD卡烧录档案
在源码根目录下执行拷贝system.img、vendor.img 、userdata.img、boot.img的动作,然后进入device/allwinner/allwinnerh3/oh-sd-fuse_h3/执行生成烧录档案。
  1. cp -f out/ohos-arm-release/packages/phone/images/system.img device/allwinner/allwinnerh3/oh-sd-fuse_h3/friendlycore-focal_4.14_armhf/
复制代码

   
会在device/allwinner/allwinnerh3/oh-sd-fuse_h3/out生成可以烧录到SD 卡的h3-sd-friendlycore.img
以上NanoPi M1 Plus 移植 Openharmony 之建立自己的开发仓库的分享,祝大家新春愉快!

再次吐槽下论坛发帖功能,求改进支持MD,格式比较乱,感兴趣的可以下载附件阅读。






回帖

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容图片侵权或者其他问题,请联系本站作侵删。 侵权投诉
链接复制成功,分享给好友