blob: 7e48abc86ea947d54fd1ba95e0f4c263443449d9 [file] [log] [blame] [view]
Robert Kroegerd5bec622018-06-06 15:37:531# Running ChromeOS UI on Linux
2Note that this instructions may not work for you. They have been
3verified to work as of 2018/06/06 on standard Google engineering
4workstations as issued to engineerings on the Chrome team. Please
5submit patches describing the steps needed for other machines or distributions.
6
7## Nouveau
8If 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
18Default 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
26At 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
29Checkout chromium as per your usual workflow. See [Get the Code:
30Checkout, Build, & Run
31Chromium](https://www.chromium.org/developers/how-tos/get-the-code).
32Googlers should checkout chromium source code as described here:
33[Building Chromium on a corporate Linux
34workstation](https://companydoc.corp.google.com/company/teams/chrome/linux_build_instructions.md?cl=head)
35
36We want to build on linux on top of Ozone with gbm platform. The
37following instructions builds chromium targets along with minigbm
38that lives in the chromium tree `src/third_party/minigbm`. Currently,
39there is no builder for this configuration so while this worked
40(mostly) when this document was written, some experimentation may
41be necessary.
42
43Set the gn args for your output dir target `out/Nouveau` with:
44
45```
46$ gn args out/Nouveau
47Add the following arguments:
48dcheck_always_on = true
49use_ozone = true
50target_os = "chromeos"
51ozone_platform_gbm = true
52ozone_platform = "gbm"
53use_system_minigbm = false
54target_sysroot = "//build/linux/debian_jessie_amd64-sysroot"
55is_debug = false
56use_goma = true
57use_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
63is_chrome_branded = true
64is_official_build = true
65use_pulseaudio = false
66```
67
68Build 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
87Run 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
93Login to Chrome settings should synchronize.
94
95Install Secure Shell if not already installed from [the web store](https://chrome.google.com/webstore/detail/secure-shell/pnhechapfaindjhompbnflcldabbghjo?hl=en)
96