OpenHarmony开发者论坛
标题:
一加6T OpenHarmony 基于开源移植仓库编译成功刷入
[打印本页]
作者:
westinyang
时间:
2023-10-27 09:50
标题:
一加6T OpenHarmony 基于开源移植仓库编译成功刷入
[md]> 关于作者:[I'm westinyang](
https://kaihongpai.feishu.cn/wiki/CqWLwJRadibxztkrIWZcogWxnXd
)
> 演示视频:
https://www.bilibili.com/video/BV12P411Z7HB
# 0 设备和源码信息概述
- OnePlus 6T (fajita)
- OpenHarmony master 分支 2023-03-15
# 1 环境搭建和获取源码
- [官方文档,看这个就OK](
https://docs.openharmony.cn/page ... art-pkg-prepare.md/
)
- 我是用虚拟机跑的Ubuntu18.04,分配的8c16g,官方rk3568首次编译实测耗时85分钟
- 关于环境搭建官方提供了3种,IDE、安装包、Docker,我用的第2种方式
# 2 加入开源移植仓库并同步
> 作者:
https://gitee.com/wathinst
> 组织:
https://gitee.com/ohos_port
`@Wathinst移植的一加6T开源仓库`
- `.repo/manifests/chipsets/all.xml` 追加 `<include name="chipsets/oneplus/fajita.xml" /> `
- 新增 `.repo/manifests/chipsets/oneplus/fajita.xml`
```xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="https://gitee.com/ohos_port/" name="ohos_port" review="https://gitee.com/ohos_port/"/>
<!-- <default remote="ohos_port" revision="master" sync-j="4" /> -->
<project name="device_board_oneplus" path="device/board/oneplus" remote="ohos_port" revision="master"/>
<project name="device_soc_qualcomm" path="device/soc/qualcomm" remote="ohos_port" revision="master"/>
<project name="vendor_oneplus" path="vendor/oneplus" remote="ohos_port" revision="master"/>
</manifest>
```
- 再次同步源码和编译
```shell
repo sync
repo forall -c 'git lfs pull'
./build.sh --product-name fajita
```
- 编译成功输出目录 `~/ohos/out/fajita/packages/phone/images`
# 3 修复编译中出现的代码错误
> master分支问题会多一些,编译期间根据错误日志不断分析修正,直至成功(Release应该没什么问题的)
```shell
# err1,2: 作者已经修正,
https://gitee.com/ohos_port/device_board_oneplus/issues/I6ND82
# err3: third_party/libdrm/tests/util/pattern.c
// void *mem_base = mem; // @errfix 1
# err4,5: foundation/ability/form_fwk/services/src/form_event_util.cpp
HILOG_INFO("%{public}s formId:%{public}lld", __func__, (long long) formRecord.formId); // @errfix 2
HILOG_INFO("%{public}s formId:%{public}lld", __func__, (long long) formRecord.formId); // @errfix 3
```
# 4 OH源码和开源移植的修改记录
fstab调整
```shell
# device/board/oneplus/fajita/cfg/fstab.fajita
# /dev/block/sda18 修改为 /dev/block/sda17,因为一加6T的data分区就在这里,原作者新增分区做双系统,才这么配置的
# fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/sda14 /usr ext4 ro,barrier=1 wait,required
/dev/block/sde44 /vendor ext4 ro,barrier=1 wait,required
/dev/block/sda18 /data ext4 nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc wait,reservedsize=104857600
/dev/block/sda3 /misc none none wait,required
```
DPI修正
```shell
# foundation/window/window_manager/resources/config/BUILD.gn
window_manager_dayu210_resource_config = true # line 16,修改为false
install_enable = false # line 44,display_manager_config下面的最后一个else中的改为true
```
# 5 编译内核和打包boot.img
```shell
sudo apt install abootimg
mkdir ~/oneplus & cd ~/oneplus
git clone
https://gitee.com/ohos_port/linux-sdm845-6.2
cd linux-sdm845-6.2
./make_sdm845.sh
./make_bootimg.sh # 我把boot.img输出目录INSTALL_DIR改为了/home/ubuntu/
```
# 6 刷机指南
- [OnePlus6T OpenHarmony简明刷机指南](
https://ost.51cto.com/posts/21123
)
# 持续关注
- 关于作者:[I'm westinyang](
https://kaihongpai.feishu.cn/wiki/CqWLwJRadibxztkrIWZcogWxnXd
)
- 哔哩哔哩:[个人主页](
https://space.bilibili.com/74433635
)
[/md]
欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/)
Powered by Discuz! X3.5