• Zach Pfeffer

Build Chromium OS for BOARD=arm-generic

This post lists the steps to get the Chromium OS source code, build it and try it out. It is being provided as-is; there are a few issues: programming the image on the USB key and updating the build's keys. My initial debug suggests the USB key programming issue is related to using a VM. If the user tries the instructions on a box running Linux directly this issue may not exist.

This work was done on a ThinkPad T460 model 20FNCTO1WW running Window's 7 Pro SP1. The source code was downloaded and built using Ubuntu 14.04.5 running in Oracle VM VirtualBox Version 5.1.30 r118389 (Qt5.6.2).

A Samsung XE303C12 was used to boot the custom image. Model Code: XE303C12-A01US from Oct. 2012. It may be Model "Samsung Chromebook" listed at link. Release: October 14, 2012. Developer info for this Chromebook is located here: link.

For this model enter Recovery Mode by holding down ESC and Refresh (F3) and poke the Power button.

The official guide is at: https://www.chromium.org/chromium-os/developer-guide. These steps and commands are the steps and commands I used while following the official guide.

1. Download http://releases.ubuntu.com/14.04/ubuntu-14.04.5-desktop-amd64.iso.

2. Create a Virtual Machine with 8 GB RAM and 64 GB diskspace and install the ISO you downloaded. Step-by-step instructions can be found here (use the 14.04 file downloaded in the previous step instead of the Ubuntu 16.04.2 LTS listed in the instructions). I named mine: ubuntu-14.04.5-desktop-amd64-8GB_RAM-64GB_Disk.

3. Enable copy and paste from the Window's box to the VM. Follow these instructions (or these instructions if you'd like screen shots):

3.a. In the Virtual Machine's window click Devices > Insert Guest Additions CD image..., click Run and enter your password

3.b. Reboot the Virtual Machine: click the gear in the upper right corner of the Ubuntu desktop, select Shut Down..., Click Restart.

3.c. When Ubuntu boots back up, in the Virtual Machine's window click Devices > Shared Clipboard > Bidirectional.

4. Log into the Virtual Machine and run Terminal.

5. Install git and curl by typing this into the terminal you started:

6. Install depot_tools by typing this into the terminal you started:

The full instructions to install depot_tools can be found here.

7. Update the PATH variable run:

7.a. Add this to the end of the file and then type control-X to exit and Y to save

7.b. Open a new terminal and type the following command:

If you see the following, you've updated the path correctly.

8. "Tweak your sudoers configuration"

8.a. Open the file where 'sudo' options can be set:

If you see:

try again by pressing 'e' or press 'x' to exit.

The full instructions to "tweak your sudoers configuration" can be found here.

More Info on what tty_tickets and timestamp_timeout do:

  • !tty_tickets turns off the tty_tickets option. Turning the tty_tickets option off allows you to run sudo commands without a password when you open a new Terminal (official doc is here).

  • timestamp_timeout is the number of minutes before sudo will ask for a password again (again the official doc is here).

9. Configure git

10. Double-check that you are running a 64-bit architecture by typing:

You should see x86_64 (passing -m or --machine to uname prints the machine hardware name).

11. Make sources world readable

11.a. Update umask in ~/.bashrc, run:

11.b. Add this to the end of the file and then type control-X to exit and Y to save

11.c. To test it, open a new terminal and type:

If you see something like this, with -rw-r--r-- you have ensured that sources will be word readable.

Passing 022 ensures that files can be created world readable. The 022 gets expanded into 000 010 010. The first 000 says that files created by the users can be created with rwx permissions. The second and third values of 010 say that people in the same group and people in other groups (global) can create files that have r and x permissions, but not w permissions. The 1 masks the w permission. The 0's allow the r and x permissions.

12. Get the Source Code

12.b. Type the following to create a directory for the source code

12.c. Use repo to get the source code. The sync -j4 command actually gets the source code. It can take a long time depending on how fast your network connection is.

13. Add Google API Keys

This step is required if you need access to: signing in, translating web pages, geolocation, etc.

The original instructions are here. On the site it lists:

If you build Chromium and Chromium OS yourself setting up API keys is mandatory so that it will allow user login on Chromebooks!

13.a. Subscribe to chromium-dev at this link. Click on Join group to post. Decide if you want to get emails and how frequently, then click Join this group.

13.b. While logged in with the account you joined chromium-dev with, go to: https://cloud.google.com/console.

13.c. Create a project by clicking Home.

13.d. Then click Create. Name you project: Acquiring Keys for Chromium and click Create again.

13.e. Open the API Manager > Library

13.f. Search for each of these on "Enable API" button at the top, read and agree to the Terms of Service that is shown, check the "I have read and agree to <API name> Terms of Service" checkbox and click Accept. A means I was able to enable it or it was enabled when I when to enable it. An means I could not enable it.

  • Calendar API

  • Contacts API

  • Drive API (Optional, enable this for Files.app on Chrome OS and SyncFileSystem API)

  • Chrome Remote Desktop API

  • Chrome Spelling API

  • Chrome Suggest API

  • Chrome Sync API

  • Chrome Translate Element

  • Chrome Web Store API

  • Chrome OS Hardware ID API

  • Optional, Chrome OS

  • Can't find

  • Device Registration API

  • Optional, Chrome OS

  • Can't find

  • Google Cloud DNS API

  • This exists but requires a billing account. Click CREATE BILLING ACCOUNT on the popup, accept the Terms and conditions (as of 1/3/2017 Google was offering $300.00 in credit). After clicking through it will return you back to the Enable screen so you can click Enable. Every time I click the back arrow by API Library I was returned to the Google Cloud DNS API screen and had to click APIs & services to get back to the search screen. See picture below.

  • Google Cloud Storage

  • Had already been Enabled

  • Google Cloud Storage JSON API

  • Had already been Enabled

  • Google Maps Geolocation API

  • Also requires enabling billing but is free to use; you can skip this one, in which case geolocation features of Chrome will not work)

  • Google Maps Time Zone API

  • Google Now For Chrome API

  • Optional, enabled to show Google Now cards

  • Google+ API

  • Nearby Messages API

  • Safe Browsing API

  • Also enabled Legacy version

  • Speech API

  • See the "Speech API" box at the top of the page)

  • Also enabled Google Cloud Speech API. I'm not sure if this was required.

This list might be out of date; try searching for APIs starting with "Chrome" or having "for Chrome" in the name if you're working through this HOWTO after Jan 3.

13.f.i. Searching "Chrome" on Jan 3rd 2018 listed these 7 which were already included above:

  • Google Now For Chrome API

  • Chrome Web Store API

  • Chrome Sync API

  • Chrome Remote Desktop API

  • Chrome Spelling API

  • Chrome Suggest API

  • Chrome Translate Element

13.f.ii. Searching "for Chrome" on Jan 3rd 2018 listed this result which is already included above:

  • Google Now For Chrome API ✔

13.f.iii. The text from this instructions has largely been used verbatum from the original instructions.

13.f.iv. Google Cloud DNS Bug

13.g. Go to the Credentials sub tab under the API Manager.

13.h. Click the "Create credentials" button then click on the OAuth client ID item in the drop-down list.

13.h.i. Click on the "Configure consent screen" button. Fill in the "Product name" (name it anything you want) and other details if you have available then click on "Save" at the bottom.

13.h.ii. Return to the Credentials tab (this may have popped up, if so click Create credentials then OAuth client ID) and click the "Add credentials" button again, then select "OAuth 2.0 client ID" from the drop-down list.

13.h.iii. In the "Application type" section check the "Other" option and give it a name in the "Name" text box, then click "Create." I used the name "Custom Chromium". Save the client ID and client secret on your private dev box.

13.h.iv. Click the "Create credentials" button again on the same page.

  • In the pop-over window that shows up click the "API key" button.

  • A pop-over should show up giving you the API key. Copy and paste it in a text file to save it, although you can access it later as well.

  • Click OK to dismiss this.

Your use these keys later in the process.

14. Build Chromium OS

14.a. Download and install the chroot

You may see a pop up:

You'll know it was successful if your dropped into the chroot terminal like this:

You're investment in vim will be rewarded - its the only editor that works _in_ the chroot.

14.b. Select a board

Type this into the chroot:

Type this into the chroot:

14.d. Set the chronos user password. The script does not ask for confirmation.

Type this into the chroot:

This password allows you to log into Chromium OS using username: chronos

14.e. Build the packages for your board, i.e. make all

Type this into the chroot:

This command took 46 minutes on my machine.

15. Build the disk image for Chrome OS

Type this into the chroot:

This builds a image that is close to the normal Chrome OS image. --noenable_rootfs_verification turns off verified boot. This allows the root filesystem to be modified.

Note: a reader of the blog suggested:

In his words, "The +3G expands the stateful partition by an additional 3 GB. The default is 2 GB so this will take it to 5 GB. You can of course expand this larger if you have a larger disk/eMMC. I just find that 2GB is really not enough for most users"

Replace base with test to build a test image. The password for chronos will be test0000. The test image accepts incoming ssh connections.

Replace base with dev to build a developer image. The developer image has additional developer packages.

This command took about 20 min.

16. Add the keys to the build. Specify the keys in the args.gn file by running (this wasn't working):

17. Copy the image to a USB key

17.a. Insert a USB key

17.b. Select the USB key in VirtualBox

If you see an error and you're running Windows and you have installed USBPcap as part of a Wireshark installation, uninstall USBPcap, reboot Windows and the virtual machine and try again. If you need additional info about this change take a look at: https://www.zachpfeffer.com/single-post/A-fix-for-a-USB-drive-or-any-USB-device-not-working-in-VirtualBox.

17.c. Copy the image to a USB key (still debugging this)

After building the image, the build_image script lists how to write it to a USB key

Type this (or the line build_image listed) into the chroot and press return:

If you see this error your USB drive may still work. I'm investigating it.

And when you type dmesg in the chroot you see:

18. Look at the disk image (this wasn't working)

Type this into the chroot:

Then type this:

19. Try out the build.

19.a. Enter recovery mode

Hold down ESC and Refresh (F3, the circle with a arrow) and poke the Power. Follow the steps listed at:

Our Recent Posts

Tags

SEARCH THIS SITE

©2020 by Zach Pfeffer