RK3568 OH5.1 搭建环境及源码获取
安装编译所需的库和工具集
sudo apt-get update; sudo apt-get install binutils; sudo apt-get install binutils-dev; sudo apt-get install git; sudo apt-get install git-lfs; sudo apt-get install gnupg; sudo apt-get install flex; sudo apt-get install bison; sudo apt-get install gperf; sudo apt-get install build-essential; sudo apt-get install zip; sudo apt-get install curl; sudo apt-get install zlib1g-dev; sudo apt-get install gcc-multilib; sudo apt-get install g++-multilib; sudo apt-get install gcc-arm-linux-gnueabi; sudo apt-get install libc6-dev-i386; sudo apt-get install libc6-dev-amd64; sudo apt-get install lib32ncurses5-dev; sudo apt-get install x11proto-core-dev; sudo apt-get install libx11-dev; sudo apt-get install lib32z1-dev; sudo apt-get install ccache; sudo apt-get install libgl1-mesa-dev; sudo apt-get install libxml2-utils; sudo apt-get install xsltproc; sudo apt-get install unzip; sudo apt-get install m4; sudo apt-get install bc; sudo apt-get install gnutls-bin; sudo apt-get install python3.9; sudo apt-get install python3-pip; sudo apt-get install ruby; sudo apt-get install genext2fs; sudo apt-get install device-tree-compilersudo apt-get install make; sudo apt-get install libffi-dev; sudo apt-get install e2fsprogs; sudo apt-get install pkg-config; sudo apt-get install perl; sudo apt-get install openssl; sudo apt-get install libssl-dev; sudo apt-get install libelf-dev; sudo apt-get install libdwarf-dev; sudo apt-get install u-boot-tools; sudo apt-get install mtd-utils; sudo apt-get install cpio; sudo apt-get install doxygen; sudo apt-get install liblz4-tool; sudo apt-get install openjdk-8-jre; sudo apt-get install gcc; sudo apt-get install g++; sudo apt-get install texinfo; sudo apt-get install dosfstools; sudo apt-get install mtools; sudo apt-get install default-jre; sudo apt-get install default-jdk; sudo apt-get install libncurses5; sudo apt-get install apt-utils; sudo apt-get install wget; sudo apt-get install scons; sudo apt-get install python3.9-distutils; sudo apt-get install tar; sudo apt-get install rsync; sudo apt-get install git-core; sudo apt-get install libxml2-dev; sudo apt-get install lib32z-dev; sudo apt-get install grsync; sudo apt-get install xxd; sudo apt-get install libglib2.0-dev; sudo apt-get install libpixman-1-dev; sudo apt-get install kmod; sudo apt-get install jfsutils; sudo apt-get install reiserfsprogs; sudo apt-get install xfsprogs; sudo apt-get install squashfs-tools; sudo apt-get install pcmciautils; sudo apt-get install quota; sudo apt-get install ppp; sudo apt-get install libtinfo-dev; sudo apt-get install libtinfo5; sudo apt-get install libncurses5-dev; sudo apt-get install libncursesw5; sudo apt-get install libstdc++6; sudo apt-get install gcc-arm-none-eabi; sudo apt-get install vim; sudo apt-get install ssh; sudo apt-get install locales; sudo apt-get install libxinerama-dev; sudo apt-get install libxcursor-dev; sudo apt-get install libxrandr-dev; sudo apt-get install libxi-dev
- 以上安装命令适用于Ubuntu18.04,其他版本请根据安装包名称采用对应的安装命令。其中:
- Python要求安装Python 3.8及以上版本,此处以Python 3.8为例。
- Java要求java8及以上版本,此处以java8为例。
- 若您使用的是Ubuntu20及以上版本,由于gcc-multilib和gcc-arm-linux-gnueabi互斥,请勿安装gcc-arm-linux-gnueabi。
- 执行过程中需要多次点击回车以确认安装所需的库和工具
修改默认shell
OH编译需要用到bash。
执行下列命令查看系统默认shell
ls -l /bin/sh
如果/bin/sh软链接指向bash则不需要修改。
如果不是执行下列命令,然后选择否(NO)
sudo dpkg-reconfigure dash
源码获取
前提条件
- 注册码云gitee帐号。
- 注册码云SSH公钥,请参考码云帮助中心。
- 安装git客户端和git-lfs并配置用户信息。
sudo apt install git git-lfs
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
- 安装码云repo工具,可以执行如下命令。
mkdir oh5.1
cd oh5.1
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > repo
chmod a+x repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
通过repo获取
方式一(推荐)
通过repo + ssh 下载(需注册公钥,请参考码云帮助中心)。
- 从版本分支获取源码。可获取该版本分支的最新源码,包括版本发布后在该分支的合入。
repo init -u git@gitee.com:openharmony/manifest.git -b OpenHarmony-5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
- 从版本发布Tag节点获取源码。可获取与版本发布时完全一致的源码。
repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
方式二
通过repo + https 下载。
- 从版本分支获取源码。可获取该版本分支的最新源码,包括版本发布后在该分支的合入。
repo init -u https://gitee.com/openharmony/manifest -b OpenHarmony-5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
- 从版本发布Tag节点获取源码。可获取与版本发布时完全一致的源码。
repo init -u https://gitee.com/openharmony/manifest -b refs/tags/OpenHarmony-v5.1.0-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
从镜像站点获取
表1 获取源码路径
版本源码 | 版本信息 | 下载站点 | SHA256校验码 | 软件包容量 |
---|---|---|---|---|
全量代码(标准、轻量和小型系统) | 5.1.0 Release | 站点 | SHA256校验码 | 49.1 GB |
Hi3861解决方案(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 28.4 MB |
Hi3516解决方案-LiteOS(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 350.0 MB |
Hi3516解决方案-Linux(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 223.6 MB |
RK3568标准系统解决方案(二进制) | 5.1.0 Release | 站点 | SHA256校验码 | 9.7 GB |
标准系统Public SDK包(Mac) | 5.1.0.107 | 站点 | SHA256校验码 | 1.3 GB |
标准系统Public SDK包(Mac-M1) | 5.1.0.107 | 站点 | SHA256校验码 | 1.2 GB |
标准系统Public SDK包(Windows/Linux) | 5.1.0.107 | 站点 | SHA256校验码 | 3.2 GB |
官方说推荐repo+ssh方式下载源码,我个人推荐站点下载,repo方式下载断断续续,下载源码过程老是出现各种错误啥
用站点方式下载只要复制下载链接然后wget + 链接下载。