经过各种尝试,编译最靠谱的还是VMware开ubuntu虚拟机
自己试过wsl、基于windows wsl的Docker,感觉并不好使
ubuntu 18.04.6 换华为源
sudo cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list
sudo sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list
sudo apt-get update
官网教程
需要python3.8以上
在使用安装包方式获取编译工具链部分写了
以上安装命令适用于Ubuntu18.04,其他版本请根据安装包名称采用对应的安装命令。其中Python要求安装Python 3.7及以上版本,此处以Python 3.8为例。
ubuntu装其他版本的python3.x参考链接
我用的
sudo apt install python3.8
然后
sudo ln -s /usr/bin/python3.8 /usr/bin/python
如果遇到ln: failed to create symbolic link
,加一个f选项就行
sudo ln -sf /usr/bin/python3.8 /usr/bin/python
从官网copy的-安装依赖部分
sudo apt-get update && sudo apt-get install 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 lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby
官网教程
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
官网教程
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo #如果没有权限,可下载至其他目录,并将其配置到环境变量中
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
以下命令按顺序执行
repo init -u https://gitee.com/openharmony/manifest.git -b OpenHarmony-3.0-LTS --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
bash build/prebuilts_download.sh
./build.sh --product-name Hi3516DV300 --ccache
参考官网教程
我遇到了下述问题
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt-get install python3-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: ['/home/openharmony/Huawei/DevEco-Device-Tool/core/deveco-venv/bin/python', '-Im', 'ensurepip', '--upgrade', '--default-pip']
直接执行提示不行,参考链接需要执行以下
sudo apt-get install python3.8-venv
编译好的内容在/out/ohos-arm-release/packages/phone/images
底下
这部分参考鸿蒙公众号
我用的Hitools烧录的
setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused androidboot.selinux=permissive skip_initramfs rootdelay=5 init=/init root=/dev/mmcblk0p5 rootfstype=ext4 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),1M(misc),3307M(system),256M(vendor),-(userdata)'
setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800; bootm 0x80000000";
save
reset
过了若干天,终于在板子上看到了3.0LTS的样子!!!