Movatterモバイル変換


[0]ホーム

URL:


Google Git
Sign in
chromium /chromium /src /refs/heads/main /. /docs /linux /using_a_chroot.md
blob: 8543fe16cde4b0263e3dfcd4e8fb9859e2279c0d [file] [log] [blame] [view]
andybons3322f762015-08-24 21:37:09[diff] [blame]1# Using a chroot
2
Kent Tamura59ffb022018-11-27 05:30:56[diff] [blame]3If you want to run web testsand you're not running Lucid, you'llget errors
nodir06cbaa02015-08-25 17:15:24[diff] [blame]4due to version differencesin libfreetype.To work aroundthis, you canuse a
5chroot.
andybons3322f762015-08-24 21:37:09[diff] [blame]6
nodir06cbaa02015-08-25 17:15:24[diff] [blame]7## Basic Instructions
andybons3322f762015-08-24 21:37:09[diff] [blame]8
nodir06cbaa02015-08-25 17:15:24[diff] [blame]9*Run`build/install-chroot.sh`.On the prompts, choose to install a64-bit
10Lucid chrootand activate all your secondary mount points.
11* sudo edit`/etc/schroot/mount-lucid64bit`and uncomment`/run`and
12`/run/shm`.Verify that your mount points are correctand uncommented:for
13 example,if you have a second hard drive at`/src`, you should have an entry
14 like`/src /src none rw,bind 0 0`.
15*Enter your chrootas rootwith`sudo schroot -c lucid64`.
16Run`build /install-build-deps.sh`,thenexit the rooted chroot.
17*Delete yourout/ directoryif you had a previous non-chrooted build.
18*To enter your chrootas normal user, run`schroot -c lucid64`.
Daniel Bratellf73f0df2018-09-24 13:52:49[diff] [blame]19*Now compileand runDumpRenderTree within chroot.
andybons3322f762015-08-24 21:37:09[diff] [blame]20
nodir06cbaa02015-08-25 17:15:24[diff] [blame]21## Tips and Tricks
andybons3322f762015-08-24 21:37:09[diff] [blame]22
nodir06cbaa02015-08-25 17:15:24[diff] [blame]23### NFS home directories
andybons3322f762015-08-24 21:37:09[diff] [blame]24
nodir06cbaa02015-08-25 17:15:24[diff] [blame]25The chroot install will be installedbydefaultin/home/$USER/chroot.If your
26home directoryis inaccessibleby root(typically because itis mounted on NFS),
27then movethis directory onto yourlocal diskand change the corresponding entry
28in`/etc/schroot/mount-lucid64bit`.
andybons3322f762015-08-24 21:37:09[diff] [blame]29
Takuto Ikuta7478af722024-05-27 07:23:19[diff] [blame]30### Reclient builds
andybons3322f762015-08-24 21:37:09[diff] [blame]31
Takuto Ikuta7478af722024-05-27 07:23:19[diff] [blame]32If youget mysterious compile errors(glibconfig.hor dbus header error), don't
33use reclient for builds inside the chroot.
andybons3322f762015-08-24 21:37:09[diff] [blame]34
nodir06cbaa02015-08-25 17:15:24[diff] [blame]35### Different color prompt
36
37I use the following code in my .zshrc file to change the color of my prompt in
38the chroot.
39
40```shell
andybons3322f762015-08-24 21:37:09[diff] [blame]41# load colors
42autoload colors zsh/terminfo
43if [[ "$terminfo[colors]" -ge 8 ]]; then
44 colors
45fi
46for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
47 eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
48 eval PR_LIGHT_$color='%{$fg[${(L)color}]%}'
49done
50PR_NO_COLOR="%{$terminfo[sgr0]%}"
51
52# set variable identifying the chroot you work in (used in the prompt below)
53if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
54 debian_chroot=$(cat /etc/debian_chroot)
55fi
56
57if [ "xlucid64" = "x$debian_chroot" ]; then
58 PS1="%n@$PR_GREEN% lucid64$PR_NO_COLOR %~ %#"
59else
60 PS1="%n@$PR_RED%m$PR_NO_COLOR %~ %#"
61fi
62```
63
nodir06cbaa02015-08-25 17:15:24[diff] [blame]64### Running X apps
andybons3322f762015-08-24 21:37:09[diff] [blame]65
nodir06cbaa02015-08-25 17:15:24[diff] [blame]66I also have `DISPLAY=:0` in my `$debian_chroot` section so I can run test_shell
Kent Tamura59ffb022018-11-27 05:30:56[diff] [blame]67or web tests without manually setting my display every time. Your display
nodir06cbaa02015-08-25 17:15:24[diff] [blame]68number may vary (`echo $DISPLAY` outside the chroot to see what your display
69number is).
andybons3322f762015-08-24 21:37:09[diff] [blame]70
nodir06cbaa02015-08-25 17:15:24[diff] [blame]71You can also use `Xvfb` if you only want to
Kent Tamura59ffb022018-11-27 05:30:56[diff] [blame]72[run tests headless](web_tests_linux.md#Using-an-embedded-X-server).
andybons3322f762015-08-24 21:37:09[diff] [blame]73
Kent Tamura59ffb022018-11-27 05:30:56[diff] [blame]74### Having web test results open in a browser
andybons3322f762015-08-24 21:37:09[diff] [blame]75
Kent Tamura59ffb022018-11-27 05:30:56[diff] [blame]76After running web tests, you should get a new browser tab or window that
nodir06cbaa02015-08-25 17:15:24[diff] [blame]77opens results.html. If you get an error "Failed to open
78file:///path/to/results.html, check the
79following conditions.
andybons3322f762015-08-24 21:37:09[diff] [blame]80
nodir06cbaa02015-08-25 17:15:24[diff] [blame]811. Make sure `DISPLAY` is set. See the
foolipdf2a8632017-02-15 15:03:16[diff] [blame]82 [Running X apps](#Running-X-apps) section above.
nodir06cbaa02015-08-25 17:15:24[diff] [blame]831. Install `xdg-utils`, which includes `xdg-open`, a utility for finding the
84 right application to open a file or URL with.
851. Install [Chrome](https://www.google.com/intl/en/chrome/browser/).

[8]ページ先頭

©2009-2025 Movatter.jp