官方英文文档如下,本文以大陆网络环境下和r120版本以及编译遇到的问题做了一些补充
构建最后的结果参见:
[WX20240726-171616@2x]
比官方的R120版本(120.0.6099.314)少了一个小的版本号哈哈。
Chromium
120.0.6099.220 (openFyde unlicensed version) (64-bit)
Revision
d8ee74c32e1d4a7f8d3efb9a8a15eca34af9e81d-refs/branch-he…
本文环境:
Ubuntu 22.04 LTS,VMware 17.0,32GB内存和500G硬盘
硬盘假如需要扩容,需要删除nosuid flag,不然chroot环境无法创建成功
术语
描述
(outside)
构建机
(inside)
cros_sdk的chroot环境内
终端网络代理
你懂的代理软件,代理和端口
(outside)
export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7890;export all_proxy=socks5://127.0.0.1:7890
安装包
(outside)
sudo apt-get install git-core gitk git-gui curl lvm2 thin-provisioning-tools \
python-pkg-resources python3-virtualenv python3-oauth2client xz-utils repo\
获取源码
(outside)
# 同时创建r120和openfyde两层目录
mkdir -p r120/openfyde
cd r120
# repo创建仓库
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git --repo-url https://chromium.googlesource.com/external/repo.git -b release-R120-15662.B
git clone https://github.com/openFyde/manifest.git openfyde/manifest -b r120-dev
ln -snfr openfyde/manifest .repo/local_manifests
repo sync
cd openfyde/chromium
gclient sync
在国内同步google和github的仓库经常会出现中断的情况。
比如
error: RPC failed; curl 56 GnuTLS recv error (-9): Error decoding the received TLS packet.
RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 847 bytes of body are still expected
针对这种情况,repo会重试多次,也可以对单个项目进行同步,比如chromium非常庞大,整个仓库有30G,非常非常容易中断,可以凌晨再同步中断概率会小一点。
repo sync openfyde/chromium/src
实在实在最后的办法是在国外的主机上repo sync中断的仓库,比如chromium,同步完后,
将三个目录下的文件打包回来,
r120/openfyde/chromium/src下的所有文件
r120/.repo/projects/openfyde/chromium/src.git下的所有文件
r120/.repo/project-objects/chromium.git下的所有文件
放到对应目录
创建chroot环境
(outside)
cd r120
cros_sdk
假如出现xdg没有xdg_state_home
属性的话
120 fix AttributeError: module 'xdg.BaseDirectory' has no attribute 'xdg_state_home'. Did you mean: 'xdg_data_home'?
升级xdg后pip install --upgrade xdg
后再次运行cros_sdk
即可解决问题
set_board
(inside)
$ setup_board --board=amd64-openfyde_vmware
这里会出现的问题是没有archero,这里很多社区用户都碰到了。
archero目前是内部build。
比如
我在编译orangepi5的镜像过程中发现需要archero库,但是找不到这个库在哪。
编译的分支是r102分支。
错误截图如下:
[图片]
我该如何解决呢?
opened 01:14PM - 16 Feb 24 UTC
Hi, I'm trying to build the board rock5b-openfyde but I get the following error … indicating that the archero overlay is not found during the setup_board step.
```
(cr) (release-R114-15437.B/(fbb4eabf...)) spotvin@gtr7pro ~/chromiumos/src/scripts $ setup_board --board=rock5b-openfyde
08:09:15.423: INFO: Updating chroot.
08:09:15.423: INFO: run: /mnt/host/source/src/scripts/update_chroot --toolchain_boards rock5b-openfyde '--backtrack=10' --usepkg
08:09:15.586 INFO : Updating chroot
08:09:15.595 INFO : Clearing shadow utils lockfiles under /
08:09:15.600 INFO : Updating cross-compilers
08:09:15.603 INFO : Running: sudo -E /mnt/host/source/chromite/bin/cros_setup_toolchains --include-boards=rock5b-openfyde
cros_setup_toolchains: Unhandled exception:
Traceback (most recent call last):
File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 217, in <module>
DoMain()
File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 213, in DoMain
commandline.ScriptWrapperMain(FindTarget)
File "/mnt/host/source/chromite/lib/commandline.py", line 1390, in ScriptWrapperMain
ret = target(argv[1:])
File "/mnt/host/source/chromite/scripts/cros_setup_toolchains.py", line 1565, in main
root=root,
File "/mnt/host/source/chromite/scripts/cros_setup_toolchains.py", line 781, in UpdateToolchains
targets.update(toolchain.GetToolchainsForBoard(board))
File "/mnt/host/source/chromite/lib/toolchain.py", line 96, in GetToolchainsForBoard
buildroot=buildroot,
File "/mnt/host/source/chromite/lib/portage_util.py", line 259, in FindOverlays
overlays = _ListOverlays(board=board, buildroot=buildroot)
File "/mnt/host/source/chromite/lib/portage_util.py", line 236, in _ListOverlays
found_pub = _AddRepo(board, optional=True)
File "/mnt/host/source/chromite/lib/portage_util.py", line 220, in _AddRepo
_AddRepo(master)
File "/mnt/host/source/chromite/lib/portage_util.py", line 215, in _AddRepo
raise MissingOverlayError("%s was not found" % repo)
chromite.lib.portage_util.MissingOverlayError: archero was not found
08:09:15.828: ERROR: Error occurred while updating the chroot. See the logs for more information.
```
opened 10:58AM - 09 Nov 23 UTC
```
cros_setup_toolchains: Unhandled exception:
Traceback (most recent call la… st):
File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 217, in <module>
DoMain()
File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 213, in DoMain
commandline.ScriptWrapperMain(FindTarget)
File "/mnt/host/source/chromite/lib/commandline.py", line 1390, in ScriptWrapperMain
ret = target(argv[1:])
File "/mnt/host/source/chromite/scripts/cros_setup_toolchains.py", line 1565, in main
root=root,
File "/mnt/host/source/chromite/scripts/cros_setup_toolchains.py", line 781, in UpdateToolchains
targets.update(toolchain.GetToolchainsForBoard(board))
File "/mnt/host/source/chromite/lib/toolchain.py", line 96, in GetToolchainsForBoard
buildroot=buildroot,
File "/mnt/host/source/chromite/lib/portage_util.py", line 259, in FindOverlays
overlays = _ListOverlays(board=board, buildroot=buildroot)
File "/mnt/host/source/chromite/lib/portage_util.py", line 236, in _ListOverlays
found_pub = _AddRepo(board, optional=True)
File "/mnt/host/source/chromite/lib/portage_util.py", line 220, in _AddRepo
_AddRepo(master)
File "/mnt/host/source/chromite/lib/portage_util.py", line 215, in _AddRepo
raise MissingOverlayError("%s was not found" % repo)
chromite.lib.portage_util.MissingOverlayError: archero was not found
01:11:39.191: ERROR: Error occurred while updating the chroot. See the logs for more information.
```
r114-dev分支
解决办法在这个帖子里
opened 07:20PM - 20 May 23 UTC
closed 02:43AM - 08 Jun 23 UTC
Hi,
When trying to do the `setup_board` step with a clean fetched repo, the f… ollowing error occur, probably due to the removal of the inaugural-openfyde repo in commit https://github.com/openFyde/manifest/commit/7612a71c9727e81918ebe0afde5281ded4a35172
```
(cr) (release-R108-15183.B/(4f43ce0...)) spotvin@Obelix ~/chromiumos/src/scripts $ setup_board --board=rock5b-openfyde
15:11:05.217: INFO: Updating chroot.
15:11:05.217: INFO: run: /mnt/host/source/src/scripts/update_chroot --toolchain_boards rock5b-openfyde '--backtrack=10' --usepkg
15:11:05.321 INFO : Updating chroot
15:11:05.325 INFO : Clearing shadow utils lockfiles under /
15:11:05.327 INFO : Updating cross-compilers
15:11:05.328 INFO : Running: sudo -E /mnt/host/source/chromite/bin/cros_setup_toolchains --include-boards=rock5b-openfyde
cros_setup_toolchains: Unhandled exception:
Traceback (most recent call last):
File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 217, in <module>
DoMain()
File "/mnt/host/source/chromite/bin/cros_setup_toolchains", line 213, in DoMain
commandline.ScriptWrapperMain(FindTarget)
File "/mnt/host/source/chromite/lib/commandline.py", line 1235, in ScriptWrapperMain
ret = target(argv[1:])
File "/mnt/host/source/chromite/scripts/cros_setup_toolchains.py", line 1551, in main
root=root,
File "/mnt/host/source/chromite/scripts/cros_setup_toolchains.py", line 773, in UpdateToolchains
targets.update(toolchain.GetToolchainsForBoard(board))
File "/mnt/host/source/chromite/lib/toolchain.py", line 95, in GetToolchainsForBoard
buildroot=buildroot,
File "/mnt/host/source/chromite/lib/portage_util.py", line 259, in FindOverlays
overlays = _ListOverlays(board=board, buildroot=buildroot)
File "/mnt/host/source/chromite/lib/portage_util.py", line 236, in _ListOverlays
found_pub = _AddRepo(board, optional=True)
File "/mnt/host/source/chromite/lib/portage_util.py", line 220, in _AddRepo
_AddRepo(master)
File "/mnt/host/source/chromite/lib/portage_util.py", line 220, in _AddRepo
_AddRepo(master)
File "/mnt/host/source/chromite/lib/portage_util.py", line 215, in _AddRepo
raise MissingOverlayError("%s was not found" % repo)
chromite.lib.portage_util.MissingOverlayError: inaugural-openfyde was not found
15:11:05.692: ERROR: Error occurred while updating the chroot. See the logs for more information.
```
在对应overlay的metadata/layout.conf里面去掉archero即可
diff --git a/metadata/layout.conf b/metadata/layout.conf
index 8170e7fbd248..49078249b06d 100644
--- a/metadata/layout.conf
+++ b/metadata/layout.conf
@@ -1,4 +1,4 @@
-masters = portage-stable chromiumos eclass-overlay rock5b-openfyde-base fyde-eclass archero
+masters = portage-stable chromiumos eclass-overlay rock5b-openfyde-base fyde-eclass
profile-formats = portage-2 profile-default-eapi
profile_eapi_when_unspecified = 5-progress
repo-name = rock5b-openfyde
(END)
之前archero不知道能不能用?
开始构建
i7-13700k 24核大概四个小时左右
i7-11800h 8核大概九个小时左右
(inside)
cros build-packages '--board=amd64-openfyde_vmware' --nowithautotest --autosetgov --nouse_any_chrome
ERROR: DLC=termina-dlc is not allowed to be factory installed.
修改chromite/lib/dlc_allowlist.py
dlc白名单,将termina-dlc加入
当遇上libc++abi: terminating due to uncaught exception of type std::bad_alloc: std::bad_alloc
修改vm.max_map_count
的大小
https://stackoverflow.com/questions/38558989/node-js-heap-out-of-memory/59923848#59923848
构建磁盘
(inside)
cros build-image --board=${BOARD} --noenable_rootfs_verification
构建虚拟机镜像
去broadcom下载OVF-TOOL和vddk
在create-ova(在r120/openfyde/overlays/overlay-amd64-openfyde_vmware/
)这个脚本里面修改路径
同时下载qemu-utils包
(outside)
sudo apt install qemu-utils
最后执行即可得到ova镜像文件。
./create-ova ../../../src/build/images/amd64-openfyde_vmware/R120-15662.71.0-d2024_07_26_160727-a1/chromiumos_image.bin result.ova