4

OpenHarmony编译固件新增支持Ubuntu22.04平台-开源基础软件社区-51CTO.COM

 1 year ago
source link: https://ost.51cto.com/posts/20789
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

现在OpenHarmony master最新分支 可以在Ubuntu22.04上编译了,之前只支持在Ubuntu20.04和18.04上编译。
最近发布的Beta5以及之前的版本还不支持,需要修改源码解除ubuntu22.04平台检测警告,其中的检测包括检测Ubuntu版本和检测依赖.

OpenHarmony编译固件新增支持Ubuntu22.04平台-开源基础软件社区

修改OpenHarmony Beta5源码新增镜像编译支持Ubuntu22.04

  • 目前OpenHarmony Beta5源码在22.04上编译还是会有编译不支持的警告,需要自行修改才能正常编译,希望之后发布的Beta版本都原生支持。(但是master版本已经支持了。Ubuntu22.04是22年上半年发布的,之前不支持自然是因为那时候22.04还没正式发布出来)

  • 源码目录下build/scripts/build_package_list.json文件,在第41行下添加22.04下编译打包用的工具

OpenHarmony编译固件新增支持Ubuntu22.04平台-开源基础软件社区
    "22.04":{
    "dep_package":[
        "bison",
        "ccache",
        "default-jdk",
        "flex",
        "zip",
        "ruby",
        "libssl-dev",
        "libtinfo5",
        "genext2fs",
        "u-boot-tools",
        "mtools",
        "mtd-utils",
        "scons",
        "gcc-arm-none-eabi",
        "gcc-arm-linux-gnueabi"
    ]}
  • 源码目录下build/scripts/tools_checker.py 检查编译工具脚本第83行添加打印22.04[.X]
OpenHarmony编译固件新增支持Ubuntu22.04平台-开源基础软件社区
    :return host_version: Host OS version, currently only `18.04[.X]`, `20.04[.X]` or `22.04[.X]` supported.
  • 源码目录下build/scripts/tools_checker.py 检查编译工具脚本第86行添加22.04
   available_releases = ('18.04', '20.04', '22.04')
  • 修改以上代码OpenHarmony Beta5及其之前的版本就可以正常在Ubuntu22.04上编译了。
安装依赖
./build/build_scripts/env_setup.sh
下载预编译文件
./build/prebuilts_download.sh
编译
./build.sh --product-name rk3568
OpenHarmony编译固件新增支持Ubuntu22.04平台-开源基础软件社区

注意谨慎设置中文,会有奇奇怪怪的问题

OpenHarmony编译固件新增支持Ubuntu22.04平台-开源基础软件社区

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK