Tutorial: Using Linux to Build ChromiumOS

naathyn

Reputable
Joined
Jul 3, 2012
Messages
144
Reaction score
0
FP$
6
Hey everyone. Ever wondered what the hype is all about with these new ChromeBooks? Using this tutorial will give you a chance to see for yourself. Whereas we won't be compiling ChromeOS as it is non-free and restricted-code, we will be compiling its counterpart, ChromiumOS. ChromiumOS is nearly identicle to ChromeOS in its size and how it functions and looks, only its code is free and open-source. Let's get started, shall we?

What you will need:
-Ubuntu or a Linux Distro based from Ubuntu or that uses Ubuntu repositories (Ubuntu, Mint, Lubuntu, Xubuntu, Edubuntu, Pinguy, etc. It would be best to use the 64-bit Ubuntu current distrobution.)
-4GB USB or VirtualBox
-Lots of space. This installation will take up, give or take, 15GB.
-A GitHub account. https://github.com

Before we get started, a quick note. Obviously the "$" character is not to be typed. infront of the code It is there to prevent copy and paste errors from being submitted. The "$" is also used to distinguish the beginning of a code. Therefore, if a code is accidentally copied as two lines but only has one "$", you need to make the code one line. (Such as in Example 5)

Step 1) Make your working directory.

This directory can be called anything you want, but deem it your "working directory" for installing ChromiumOS. This directory needs to be placed in your Home folder. You can do this via the GUI or use the following command below where "chromium" is the working directory.

Code:
$ mkdir -p ${HOME}/chromium

Step 2) Get the Git repository

Code:
$ sudo apt-get install git-core gitk git-gui subversion curl

Step 3) Get depot_tools

We need these tools to make certain commands work correctly. Move to your working directory and issue these commands:

Code:
$ git clone https://git.chromium.org/chromium/tools/depot_tools.git
Code:
$ export PATH="$PATH":`pwd`/depot_tools

Step 4) Configure your GitHub account information

Replace the default "yourusername" and "youremailaddress" with the suitable values and keep them inside the quotations.

Code:
$ git config --global user.email "[email protected]"
Code:
$ git config --global user.name "yourusername"

Step 5) Downloading the source

This process may take a while as it is nearly 13GB.

Code:
$ repo init -u https://git.chromium.org/chromiumos/manifest.git --repo-url https://git.chromium.org/external/repo.git

Once it is finished enter in:

Code:
$ repo sync

Prepare for another good wait.

Step 6) Make chroot

Making sure you are still in your working directory, issue this command:

Code:
$ ./chromite/bin/cros_sdk

After the chroot environment builds, you will be taken to a new shell within your working directory named ~/trunk/src/scripts

You will need to modify some settings in order for these mods to function as they should. Now open a new tab with Ctrl+Shift+T and issue these commands: (Remember, these are only two commands)

Code:
$ cd chroot/tmp
Code:
$ cat > ./sudo_editor <<EOF
#!/bin/sh
echo Defaults \!tty_tickets > \$1
echo Defaults timestamp_timeout=180 >> \$1
EOF
chmod +x ./sudo_editor
sudo EDITOR=./sudo_editor visudo -f /etc/sudoers.d/relax_requirements

Exit that window and go back to your previous window containing your working directory (~/trunk/src/scripts)

Step 7) Selecting your architecture and building your board

Although I am running on a 64-bit architecture, for the sake of compatibility, the board select in this tutorial will be x86. You can view more types of architectures in ~/trunk/src/overlay.

Quick note: Chromium supports the ARM architecture that can run on special devices such as the RaspberryPi, which is a neat little computer the size of a credit card usually used as a media center or server.

Code:
$ export BOARD=x86-generic
Code:
$ ./setup_board --board=${BOARD}

Set your password by issuing this command:

Code:
$ ./set_shared_user_password.sh

Step 8) Compile board packages

Another nice wait.

Code:
$ ./build_packages --board=${BOARD}

Step 9) Finalizing our image

We can finally build the ChromiumOS ISO.

Code:
$ ./build_image --board=${BOARD} --noenable_rootfs_verification dev

The "dev" on the end marks it as a development package, which enables you to modify the root filesystem once it has been installed. If you do not wish to have this option, simply remove the word dev.

Step 10) Installation (for Virtual Machine skip to Step 11)

Insert your USB and issue this command:

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

After the operation is complete, you can reboot your machine. Before it reboots, be sure to select the Boot Options menu and tell it to boot off your USB.

Once it has booted off your USB, to get to the command line select Ctrl+Alt+F2. Login as username:chronos and your password set in Step 7.

You can set up your account and it will offer to have it installed on your computer.

Proceeding on with this step confirms you wish to wipe your hard drive and replace it with ChromiumOS. If you do not wish to wipe your hard drive, jump to Step 11 and set up a Virtual Machine.

Note: I am beginning a tutorial on how you can dual-boot Chromium so that you will not have to replace your primary operating system.

Install (aka re-write over your whole hard drive) by issuing this command:

Code:
$ /usr/sbin/chromeos-install

That should about do it for the USB install!

Step 11) Virtual Machine (for USB devices refer back to Step 10)

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

You will need to make the .bin a .vdi to be compatible with a Virtual Machine. You can do this by using the VBoxManage command:

Code:
VBoxManage convertdd chromiumos_qemu_image.bin chromium_qemu_image.vdi

If you do not have Internet Access in your VM, go to Settings>Networking>Advanced and make adapter type Intel PRO/1000 MT Desktop.

That should about wrap up this tutorial. I hope it was successful for you guys and hope you have lots of fun playing around with it. If you have any questions/concerns/comments just ask!

Nathan Couch
[email protected]
Please report any known problems.
 
Back
Top Bottom