Ubuntu 18.04
http://old-releases.ubuntu.com/releases/18.04.4/ubuntu-18.04-desktop-amd64.iso
VirtualBox
第 3 部分引用自树莓派 3B 快速上手 OpenHarmony,根据需要会有部分修改
sudo sed -i 's/cn.archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo apt update
sudo apt install -y binutils git git-lfs gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip m4 wget bc python python3 \
android-tools-fsutils libssl-dev mtools
# 安装repo
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 | sudo tee /usr/local/bin/repo >/dev/null
sudo chmod a+x /usr/local/bin/repo
# 将/bin/sh设置为/bin/bash
sudo ln -sf bash /bin/sh
# 设置git信息
git config --global user.name your_name
git config --global user.email your_email
mkdir ~/ohos
cd ~/ohos
wget https://releases.linaro.org/components/toolchain/binaries/7.5-2019.12/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz
tar -xvf gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar.xz
cd ~/ohos
mkdir openharmony
cd openharmony
# 此处修改了仓库中的一个错误,见提交:97c9baea02ebcbfdd70118bb0d3e36a76d258a85
repo init -u https://gitee.com/lxmuyu/manifest.git -m devboard_rpi3b.xml -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
./build/prebuilts_download.sh
cd ~/ohos/openharmony
python3 projectpatch/patch.py
虚拟机内存至少 4G,否则编译过程中会报内存不足
cd ~/ohos
export PATH="$PATH:$(pwd)/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin"
cd openharmony
python3 build-rpi3.py build
固件位置生成位置 out/ohos-arm-release/packages/phone/images/firmware.img