How to install Google Chrome
Setting up your build environment
Set up symlinks (optional)
The rest of this document assumes you have created symlinks in your home directory for the OS and browser (only for the latter if you download the source). You can set these up with (note these directories depend on where you set up your repository or if you downloaded the tarball, where you unzipped it):
ln -s /usr/local/chromiumos/chromiumos.git ~/chromiumos ln -s /usr/local/chromium/trunk ~/chromiumYou don’t have to create the symlinks, but it makes paths much easier to reference. Once the symlinks exists, you should see src in each directory — for example, ~/chromiumos/src and ~/chromium/src should exist.
Make your local repository
~/chromiumos/repo:./make_local_repo.sh
sudo rm -rf ~/chromiumos/repo before recalling this script. # Create a karmic.list which pulls from chromeos-deb
cat >karmic.list <<EOF
deb http://build.chromium.org/buildbot/packages chromeos_dev main restricted
deb-src http://build.chromium.org/buildbot/packages chromeos_dev main restricted
EOF
# Install karmic debootstrap
sudo mv karmic.list /etc/apt/sources.list.d/karmic.list
sudo apt-get update
sudo apt-get install -y –force-yes debootstrap
# Remove temporary sources.list entry, so you don’t upgrade anything else
sudo rm /etc/apt/sources.list.d/karmic.list
sudo apt-get update
Create your build environment
Chromium OS builds only in a chroot environment, so that its build output is less dependent on the particular flavor of Linux you have installed (Hardy or Jaunty, for example). Do the following to set up a chroot environment:
./make_chroot.sh./make_chroot.sh --mirror=http://build.chromium.org/buildbot/packages --suite=chromeos_devThat command pulls packages from the Chromium repository. Note that this is slower than a local repository. Also note you can use any of the official Ubuntu mirrors. You’ll need to specify the same --mirror and --suite options to the build_image.sh script below.
Building Chromium
- Building Chromium from source (useful if you’re working on Chromium browser for Chromium OS)
- Downloading Chromium binary (much simpler and faster)
Method 1: Building Chromium from source (optional)
If you chose to download the source code for the browser, you’ll need to build the browser before you complete the rest of the build process:
./build_chrome.sh --chrome_dir ~/chromiumTo build a debug version:
./build_chrome.sh --mode=Debug --chrome_dir ~/chromiumThis builds Chromium, zips up the output, and puts it in the right place for build_platform_packages.sh to pick up.
If using distcc, you can override the number of parallel jobs:
./build_chrome.sh --num_jobs=N --chrome_dir ~/chromiumMethod 2: Downloading Chromium binary (you MUST do this if you didn’t use the step above)
Download the binary and copy it into ~/chromiumos/src/build/x86/local_assets as chrome-chromeos.zip (you have to create this directory). This will give you a recent copy of the browser for use with Chromium OS.
Building Chromium OS
Enter the chroot build environment
./enter_chroot.sh
Making development easier
Enable a local user account
( cd ../platform/pam_google && ./enable_localaccount.sh USERNAME )Set the shared user password
./set_shared_user_password.sh./shared_user_password.txt, so you only need to do this once.Build the packages (note you can use build_all.sh to run all these steps together)
Do this inside the chroot build environment. We build the platform packages and then the kernel. You can substitute a different config or kernel build number if you know what you are doing.
./build_platform_packages.sh
./build_kernel.shBuild the image
Do this inside the chroot build environment.
./build_image.sh
The default output location for images is ~/chromiumos/src/build/images.
The output of build_image.sh will create a unique monotonically increasingly numbered subdir under the output location which contains the master boot record (mbr.image) and the root filesystem image (rootfs.image). Check the output of build_image.sh to find the corresponding directory where your new image has been placed.
Using your image
Check the contents of the image
To check the contents of your image, mount it locally. In this example, SUBDIR is the subdirectory created in the previous step.
cd ~/chromiumos/src/build/images/SUBDIR
sudo mount -o loop rootfs.image rootfs
sudo chroot rootfs
You’re now in the image, and can do things like see how much space is used in the image or what packages were installed:
df
dpkg -l
When done, exit the chroot shell and unmount the image:
exit sudo umount rootfs Copy the image to a USB key
image_to_usb.sh to copy the image to a USB key. Do this outside the chroot environment. (If your USB key seems blank, you’re probably inside the chroot environment.) Make sure you have a 4GB USB key.SUBDIR is the subdirectory created by build_image.sh, and USBKEYDEV is the device for the USB key.
To determine the value for USBKEYDEV, use:
sudo fdisk -lor
dmesgWhat you want is the device for the entire key (for example, /dev/sdb, not /dev/sdb1).
By default, image_to_usb.sh copies from the most recent image you’ve built to /dev/sdb, so you may be able to omit the --from and/or --to options.
Copy image to hard drive (see development hardware)
/usr/sbin/chromeos-installconvert the image for VMWare
Note: The VMWare image may have missing functionality (e.g. no virtual terminal, slow keyboard response, etc) and will be extremely slow. We suggest that developers obtain development hardware.
Then execute these commands:
–to=~/chromiumos/src/build/images/SUBDIR/ide.vmdk
image_to_vmware.sh will convert the most recent image you’ve built to ide.vmdk, so you may be able to omit the --from and/or --to options.
Then execute these commands:
–to=~/chromiumos/src/build/images/SUBDIR/os.vdi
image_to_virtualbox.sh will convert the most recent image you’ve built to os.vdi, so you may be able to omit the --from and/or --to options.Use the dev server to update a test machine
Delete an old chroot build environment
To delete an old chroot build environment, use:
./make_chroot.sh --deleterm -rf, since if there are stale bind mounts, you may end up deleting your source tree.















