LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
55 stars 6 forks source link

[WIP][administration][chromebook] How to build with Borealis enabled #449

Open LukeShortCloud opened 3 years ago

LukeShortCloud commented 3 years ago

https://chromium.googlesource.com/chromiumos/docs/+/master/developer_guide.md#Creating-a-recovery-image-that-has-been-modified-for-test

LukeShortCloud commented 3 years ago

This use-case for this is to try out a Borealis (Steam) build of Chrome OS. Currently, there are six boards that support it:

https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/chromiumos-overlay/eclass/cros-board.eclass https://chromeunboxed.com/chromebooks-upcoming-development-boards-devices-chrome-os/

Then the Brunch project can be used to turn it into a generic Chrome OS image. They recommended to use 'volteer' for Intel and 'zork' for AMD devices.

Vulkan passthrough support was not added to Chrome OS until version 92. We will likely need to wait for a related stable release of Brunch. The latest version right now is currently 90. https://github.com/sebanc/brunch/releases There is also a brunch-unstable project that contains the latest stable version (currently 91) before being pushed to the official/stable Brunch project. https://github.com/sebanc/brunch-unstable

LukeShortCloud commented 3 years ago

Although it's not recommended (things can break in the OS), it's possible to fully revert back to the base board image after Installation and then turn on Chrome OS updates. I could try that and then switch to the Dev or Canary channel.

LukeShortCloud commented 3 years ago

Looks like there is not a profile for Borealis publicly available (although there are references to its existence in git).

If there was an overlay available, it'd be as simple as this command to start building the chroot:

(cr) (main/(1dd47af...)) <USERNAME>@<HOSTNAME> ~/trunk/src/scripts $ setup_board --board=${BOARD} --variant borealis

There are no publicly available variants/overlays for Volteer. However, there is a mention that it uses the Portage/emerge USE flag of "USE=has-borealis" which is interesting.

https://chromium.googlesource.com/chromiumos/overlays/board-overlays/+/refs/heads/main/overlay-volteer/profiles/base/make.defaults

I also noticed that there are a few Porage/emerge USE flags disabled by default that are probably needed. The next course of action is to determine how to build with these USE flags.

'crosvm_virtio_video',
'crosvm_wl_dmabuf',
'vm_borealis',
'vulkan',

https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/common-mk/platform2.py

LukeShortCloud commented 3 years ago

These two packages provide Borealis integration but it's disabled by default. They require "USE=vm_borealis" flag to be set.

$ sudo grep -rl vm_borealis ./ 2> /dev/null
./src/third_party/chromiumos-overlay/chromeos-base/termina_container_tools/termina_container_tools-0.0.1.ebuild
./src/third_party/chromiumos-overlay/chromeos-base/vm_guest_tools/vm_guest_tools-0.0.2-r1144.ebuild
...
LukeShortCloud commented 3 years ago

I'm currently testing with these flags:

USE="${USE} crosvm_virtio_video crosvm_wl_dmabuf vm_borealis vulkan"

I noticed that the in the ../../chroot/build/volteer/packages/Packages file, that volteer-borealis is listed as IUSE (ignore use). This may be another parameter we have to enable.

IUSE: volteer-borealis volteer-kernelnext volteer-manatee zephyr_ec

Also to note is that Chromium/Chrome OS < 93 does NOT have the Vulkan bits available. ChromiumOS 93 does (currently the main branch).

We should probably try building a generic x86_64 Chromium OS image with Borealis enabled.

LukeShortCloud commented 3 years ago

A generic Chromium OS build probably also needs the "has-borealis" flag.