Robert Kroeger | d5bec62 | 2018-06-06 15:37:53 | [diff] [blame] | 1 | # Running ChromeOS UI on Linux |
| 2 | Note that this instructions may not work for you. They have been |
| 3 | verified to work as of 2018/06/06 on standard Google engineering |
| 4 | workstations as issued to engineerings on the Chrome team. Please |
| 5 | submit patches describing the steps needed for other machines or distributions. |
| 6 | |
| 7 | ## Nouveau |
| 8 | If you have an NVidia card, you probably have the binary drivers installed. These install a blacklist for the nouveau kernel modules. Best is to remove the nvidia driver and switch to nouveau completely: |
| 9 | |
| 10 | ``` |
| 11 | $ sudo apt-get remove --purge "nvidia*" |
| 12 | $ sudo apt-get install xserver-xorg-input-evdev xserver-xorg-input-mouse xserver-xorg-input-kbd xserver-xorg-input-libinput xserver-xorg-video-nouveau |
| 13 | $ sudo dpkg-reconfigure xserver-xorg |
| 14 | $ # If you are using a Google development machine: |
| 15 | $ sudo goobuntu-config set custom_video_driver custom |
| 16 | ``` |
| 17 | |
| 18 | Default version of nouveau xorg driver is too old for the NV117 chipset in Z840 machines. Install a newer version: |
| 19 | |
| 20 | ``` |
| 21 | $ cd /tmp |
| 22 | $ wget http://http.us.debian.org/debian/pool/main/x/xserver-xorg-video-nouveau/xserver-xorg-video-nouveau_1.0.15-2_amd64.deb |
| 23 | $ sudo apt-get install ./xserver-xorg-video-nouveau_1.0.15-2_amd64.deb |
| 24 | ``` |
| 25 | |
| 26 | At this point you *must reboot.* If you run into issues to load video at boot then disable `load_video` and `gfx_mode` in `/boot/grub/grub.cfg`. |
| 27 | |
| 28 | ## Building Chrome |
| 29 | Checkout chromium as per your usual workflow. See [Get the Code: |
| 30 | Checkout, Build, & Run |
| 31 | Chromium](https://www.chromium.org/developers/how-tos/get-the-code). |
| 32 | Googlers should checkout chromium source code as described here: |
| 33 | [Building Chromium on a corporate Linux |
| 34 | workstation](https://companydoc.corp.google.com/company/teams/chrome/linux_build_instructions.md?cl=head) |
| 35 | |
| 36 | We want to build on linux on top of Ozone with gbm platform. The |
| 37 | following instructions builds chromium targets along with minigbm |
| 38 | that lives in the chromium tree `src/third_party/minigbm`. Currently, |
| 39 | there is no builder for this configuration so while this worked |
| 40 | (mostly) when this document was written, some experimentation may |
| 41 | be necessary. |
| 42 | |
| 43 | Set the gn args for your output dir target `out/Nouveau` with: |
| 44 | |
| 45 | ``` |
| 46 | $ gn args out/Nouveau |
| 47 | Add the following arguments: |
| 48 | dcheck_always_on = true |
| 49 | use_ozone = true |
| 50 | target_os = "chromeos" |
| 51 | ozone_platform_gbm = true |
| 52 | ozone_platform = "gbm" |
| 53 | use_system_minigbm = false |
| 54 | target_sysroot = "//build/linux/debian_jessie_amd64-sysroot" |
| 55 | is_debug = false |
| 56 | use_goma = true |
| 57 | use_xkbcommon = true |
| 58 | #use_evdev_gestures = true |
| 59 | #use_system_libevdev = false |
| 60 | #use_system_gestures = false |
| 61 | |
| 62 | # Non-Googlers should set the next two flags to false |
| 63 | is_chrome_branded = true |
| 64 | is_official_build = true |
| 65 | use_pulseaudio = false |
| 66 | ``` |
| 67 | |
| 68 | Build official release build of chrome: |
| 69 | |
| 70 | ``` |
| 71 | $ ninja -j768 -l24 -C out/Nouveau chrome chrome_sandbox nacl_helper |
| 72 | $ # Give user access to dri, input and audio device nodes: |
| 73 | $ sudo sh -c "echo 'KERNEL==\"event*\", NAME=\"input/%k\", MODE=\"660\", GROUP=\"plugdev\"' > /etc/udev/rules.d/90-input.rules" |
| 74 | $ sudo sh -c "echo 'KERNEL==\"card[0-9]*\", NAME=\"dri/%k\", GROUP=\"video\"' > /etc/udev/rules.d/90-dri.rules" |
| 75 | $ sudo udevadm control --reload |
| 76 | $ sudo udevadm trigger --action=add |
| 77 | $ sudo usermod -a -G plugdev $USER |
| 78 | $ sudo usermod -a -G video $USER |
| 79 | $ sudo usermod -a -G audio $USER |
| 80 | $ newgrp video |
| 81 | $ negrrp plugdev |
| 82 | $ newgrp audio |
| 83 | $ # Stop pulseaudio if running: |
| 84 | $ pactl exit |
| 85 | ``` |
| 86 | |
| 87 | Run chrome: (Set `CHROMIUM_SRC` to the directory containing your Chrome checkout.) |
| 88 | |
| 89 | ``` |
| 90 | $ sudo chvt 8; EGL_PLATFORM=surfaceless $CHROMIUM_SRC/out/Nouveau/chrome --ozone-platform=gbm --force-system-compositor-mode --login-profile=user --user-data-dir=$HOME/.config/google-chrome-gbm --ui-prioritize-in-gpu-process --use-gl=egl --enable-wayland-server --login-manager --ash-constrain-pointer-to-root --default-tile-width=512 --default-tile-height=512 --system-developer-mode --crosh-command=/bin/bash |
| 91 | ``` |
| 92 | |
| 93 | Login to Chrome settings should synchronize. |
| 94 | |
| 95 | Install Secure Shell if not already installed from [the web store](https://chrome.google.com/webstore/detail/secure-shell/pnhechapfaindjhompbnflcldabbghjo?hl=en) |
| 96 | |