Home > Chromium OS > Building Chromium OS

Building Chromium OS

Posted on July 2, 2011 | No Comments

The following is an updated version of my step by step guide to building Chromium OS. My last post regarding this topic which I removed recently was written when the source was first released to the public. Since then steps have changed and more options were added. I based this post off the instructions supplied by the Chromium OS web site. It is basically a condenced version of their instructions which can be found at http://www.chromium.org/chromium-os/developer-guide.

It is recommended by the Chromium OS team that you use Ubuntu 10.04 when compiling Chromium OS which is the version I used when walking through the build myself. Also for this step by step walkthrough I am also running all commands unless specified starting from my user home directory.

The first step will be to download depot_tools. These tools are required for getting and syncing the current Chromium OS source code. The commands you will need to run to do so are as follows.

sudo apt-get install subversion
svn co http://src.chromium.org/svn/trunk/tools/depot_tools export PATH=${HOME}/depot_tools:"$PATH"

Next we will need to install Git. To do so run the following commands.

sudo apt-get install git-core gitk git-gui
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Next we will need to make our source directory. Feel free to place this directory in a difrent location if you like but in order to more easily follow this walkthrough I suggest that if you do so you create a symbolic link to chromiumos in your home directory from where we are working from.

mkdir -p ${HOME}/chromiumos

Now it is time to get the latest source code. Run the following commands to allow connections to git and then using the depot tools we installed earlier get the latest version of the source code.

ssh -p 29418 gerrit.chromium.org
cd ${HOME}/chromiumos
repo init -u http://git.chromium.org/chromiumos/manifest.git
repo sync

We will now need to create a chroot inwhich we will do our work. The ./make_chroot command may take awhile to finish while it downloads compiles and moves around the tools needed to build Chromium OS.

cd src/scripts
./make_chroot
./enter_chroot.sh

After running ./enter_chroot.sh you should be at a command prompt which looks something like this.

(should see (cr) ((26d68ec...)) joe@ubuntu ~/trunk/src/scripts $)

Next we will need to initialize the build for a chosen board type. You will need to choose the board type depending on the processor type you are building Chromium OS for. Choose board type you wish to compile for and run ONE of the following two commands to store your chosen board type within your environment for referance through the rest of the build.

BOARD=x86-generic
BOARD=arm-generic

Now initialize the chosen board with the following command.

./setup_board --board=${BOARD}

It is now time to set the chronos password. The chronos account is the “root” or “sudo” access for the system and is the account you will need to log in with in order to get command line access to the system.

./set_shared_user_password.sh

It is now time to build the packages for the chosen board. The following command will download any needed files to build the packages, nearly 3GB on your first build as well as build any packages not available in binary form. This portion of the build may take awhile to complete depending on your connection and computer speed.

./build_packages --board=${BOARD} --oldchromebinary

Now we need to build the image by running the following command.

./build_image --board=${BOARD} --withdev --noenable_rootfs_verification

After the build has been completed it is now time to create our disk image. You have a few choices here either build a virtual machine image, bootable USB image or install directly to a Chrome OS notebook. I will not cover the installation to a Chrome OS notebook due to the fact I do not have one to test the steps out on.

To build a virtual machine image choose one of the following commands depending on the virtual machine environment you wish to run the image under. If you wish to create a USB image skip this step.

qemu

./image_to_vm.sh --board=${BOARD}

VMware

./image_to_vm.sh --board=${BOARD} --format=vmware

Virtualbox

./image_to_vm.sh --board=${BOARD} --format=virtualbox

To build a USB image you will run the following command.

./image_to_usb.sh --board=${BOARD}

You may specify a specific USB drive to send the image to by specifying the device it is running under such as /dev/sdc by adding the –to= flag followed by the location of the device as well.

./image_to_usb.sh --board=${BOARD} --to=/dev/sdc

You should now have a functioning virtual machine or bootable USB image of Chromium OS. Simply boot up your virtual machine using your chosen virtual machine software or boot directly to your USB drive if that was the type of medium you chose to run Chromium OS from.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">