How to Compile Ozone-GBM for Linux (Testing)

How to Compile Ozone-GBM for Linux

This has to be done on an x86 system otherwise no goma_ctl.py therefore no .src folder will be created and game over.

  • Run from console DRM and GBM buffers (build for platform DRM)
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
sudo apt install gedit -y
gedit .bashrc #add this if at home directory
export PATH="${HOME}/depot_tools:$PATH"
sudo reboot #shutdown linux and open again
cd ~/depot_tools
./fetch --nohooks --no-history chromium
./src/build/install-build-deps.sh
#Set the CPU Target
gedit gclient #add these lines
target_os = ["chromeos"]
target_cpu = ["arm64"]

#Reset Depot_Tools for Cross-compilers
gclient sync
gclient runhooks

#Prepares files for Ninja Build
gn args src/out/ --arch='arm64' --args='dcheck_always_on=true enable_nacl=false has_native_accessibility=false is_chrome_branded=false is_debug=false is_official_build=false ozone_auto_platforms=false ozone_platform="gbm" ozone_platform_gbm=true use_evdev_gestures=false use_glib=false use_gtk=false use_ozone=true use_pulseaudio=false use_system_minigbm=false use_vc4_minigbm=true use_xkbcommon=false'

#gn args src/out/ --arch='arm64'
#gn args src/out/ --arch='arm64' --args='ozone_auto_platforms=false ozone_platform_wayland=true'

#Building with ozone_demo for a quicker test.
ninja -C src/out/ -j$(nproc) ozone_demo
šŸ–±ļøOr Manually gedit args.gn:šŸ–±ļø
cd src/out/
gedit args.gn # src/out/args.gn
# Set build arguments here. See `gn help buildargs`.

use_ozone = true
target_os = "chromeos"
target_cpu = "arm64"
#cc_wrapper = "ccache"
enable_nacl = false
has_native_accessibility = false
is_chrome_branded = false
ozone_auto_platforms = false
ozone_platform = "gbm"
ozone_platform_gbm = true
#target_sysroot = "//build/linux/debian_bullseye_arm64-sysroot"
use_evdev_gestures = false
use_pulseaudio = false
use_vc4_minigbm = true
use_system_minigbm = false
use_glib = false
use_gtk = false
ozone_platform = "drm"
ozone_platform_drm = true
is_debug = false
is_official_build = false
use_xkbcommon = true
dcheck_always_on = true

#save it

Now you will wished u had 64GBā€™s of ram and threadrippers to become a Speedy Gonzalesā€¦ plenty of targets to achieve under a full build.

#Full Build
#ninja -C src/out/ -j$(nproc) chrome

From here on I have no clue the right process to follow :confused:

But I assume we need to compile the output files into .tar.gz
To then extract them on the system and boot it.
There is obviously the matters of google users apiā€™s which is another process but for this for now I will keep it ā€˜guest userā€™.


#now files to a .tar.gz to be extracted in system and run with:
./chrome --ozone-platform=drm --force-system-compositor-mode --login-profile=user --user-data-dir=/home/area/.config/google-chrome-gbm --use-gl=egl --in-process-gpu --crosh-command=/bin/bash

Building MiniGBM (i dont even know what this is exacly but whatever)

ninja -C out/OzoneChromeOS chrome
sudo apt install libdrm-dev
ln -s libminigbm.so.1.0.0 libminigbm.so

Official ChromeOS startup flags:

/opt/google/chrome/chrome --enable-native-gpu-memory-buffers --enable-webgl-image-chromium --enable-features=Pepper3DImageChromium,UmaStorageDimensions,QuickUnlockFingerprint,AutoNightLight,AllowAmbientEQ,ArcAdbSideloading,Crostini,CrostiniGpuSupport,PluginVm,Borealis,SmartDim,EnableNeuralPalmDetectionFilter,OnDeviceSpeechRecognition --gpu-sandbox-failures-fatal=yes --gpu-sandbox-start-early --video-capture-use-gpu-memory-buffer --enable-logging --log-level=1 --use-cras --enable-wayland-server --user-data-dir=/home/chronos --disable-mojo-broker --ash-use-cros-mojo-service-manager --cros-healthd-uses-service-manager --login-profile=user --has-chromeos-keyboard --enable-touchview --enable-dim-shelf --form-factor=CHROMEBOOK --guest-wallpaper-large=/usr/share/chromeos-assets/wallpaper/guest_large.jpg --guest-wallpaper-small=/usr/share/chromeos-assets/wallpaper/guest_small.jpg --child-wallpaper-large=/usr/share/chromeos-assets/wallpaper/child_large.jpg --child-wallpaper-small=/usr/share/chromeos-assets/wallpaper/child_small.jpg --default-wallpaper-large=/usr/share/chromeos-assets/wallpaper/kohaku_large.jpg --default-wallpaper-small=/usr/share/chromeos-assets/wallpaper/kohaku_small.jpg --default-wallpaper-is-oem --device-help-content-id=kohaku --has-internal-stylus --fingerprint-sensor-location=keyboard-top-right --ozone-nnpalm-properties={"model":"alpha","radius-polynomial":"0.1010944, 3.51837568","touch-compatible":"true"} --arc-availability=officially-supported --enable-arcvm --enable-houdini --enable-houdini64 --enterprise-enrollment-initial-modulus=15 --enterprise-enrollment-modulus-limit=19 --enable-crashpad --ml_service=enabled --ondevice_handwriting=use_rootfs --ondevice_document_scanner=use_rootfs --feature-management-level=0 --feature-management-max-level=1 --login-manager --feature-flags=["borealis-enabled@1","borealis-linux-mode@1","crostini-multi-container@1"] --first-exec-after-boot --enable-features=AllowAmbientEQ,ArcAdbSideloading,AutoNightLight,Borealis,Crostini,CrostiniGpuSupport,EnableNeuralPalmDetectionFilter,OnDeviceSpeechRecognition,Pepper3DImageChromium,PluginVm,QuickUnlockFingerprint,SmartDim,UmaStorageDimensions --flag-switches-begin --enable-features=AllowAmbientEQ,ArcAdbSideloading,AutoNightLight,Borealis,Crostini,CrostiniGpuSupport,EnableNeuralPalmDetectionFilter,OnDeviceSpeechRecognition,Pepper3DImageChromium,PluginVm,QuickUnlockFingerprint,SmartDim,UmaStorageDimensions,BorealisLinuxMode,BorealisPermitted,CrostiniMultiContainer --flag-switches-end --origin-trial-disabled-features=WebGPU

Following this complex guide: https://dev.to/yaegashi/howto-building-chromium-on-ozone-gbm-for-rpi4-568e

ChromiumOS UI for Linux without DE soā€¦ you can try this on any debian armbian ubuntu cli kde etcā€¦

Credits to Daniel aka AreaScout for these files.
Souce: https://forum.odroid.com/viewtopic.php?f=179&t=43170

For my experiment I used Radxa Rock 5B on this image

# Assign this to your user (your_user)
usermod -aG usermod -aG sudo,adm,audio,operator,input,video,render,tty,staff,games,users,plugdev,netdev,disk your_user
su - your_user
wget https://area.mdrjr.net/images/Chromium_Linux/chromium-OzoneChromeOS.tar.gz
tar xvf chromium-OzoneChromeOS.tar.gz
cd chromium-OzoneChromeOS
sudo apt install aptitude -y
sudo aptitude install libnss3 libnspr4 libdbus-1-3 libexpat1 libxcb1 libxkbcommon0 libasound2 fontconfig-config libgbm1 libgl1 libegl1-mesa libgles2-mesa -y
./chrome --ozone-platform=drm --force-system-compositor-mode --login-profile=user --user-data-dir=/home/area/.config/google-chrome-gbm --use-gl=egl --in-process-gpu --crosh-command=/bin/bash

#adds google play store but doesnt work šŸ‘†
--arc-availability=officially-supported

Add Secure Shell and Crosh terminal plugin to it and youā€™re sorted.

How Ozone was compiled: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/ozone_overview.md
If you want to build it for your own you have to build it on a i386 (x86_64) machine, the build system only supports this arch, it will download cross compilers:

#To build a compiler you will need this 
use_ozone = true
target_os = "chromeos"
target_cpu = "arm64"
use_system_minigbm = false
use_glib = false
use_gtk = false
ozone_platform = "drm"
ozone_platform_drm = true
is_debug = false
is_official_build = false
use_xkbcommon = true
dcheck_always_on = true

and yesā€¦ its quite uselessā€¦ butā€¦ we can explore it before giving up.
To get a better versionā€¦ maybe this guide: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/ozone_overview.md
Building it
https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/linux/ozone_drm.md

Important: https://github.com/joone/meta-crosswalk

Works: https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md