*

Quick hack: Setting up a ChromiumOS development environment

Posted on 16/02/2017 by Robert Foss

How to set up a fully functional ChromiumOS development environment on actual Chromebook hardware.

Set up environment

export DEV_DIR="/opt"
mkdir -p $DEV_DIR
export CHROMIUM_DIR="$DEV_DIR/chromiumos"
mkdir -p $CHROMIUM_DIR
export PATH="$DEV_DIR/depot_tools:$PATH"
# The BOARD variable used here is specific for the Chromebook that is
# being targeted, a more generic target like "amd64-generic" could
# be more useful for you needs.
export BOARD=chell

# The USB_DEVICE variable refers to the USB device that will be used
# for flashing ChromiumOS onto a Chromebook.
# Make sure that this device does not contain anything important!
export USB_DEVICE="/dev/sda"

 

Install dependencies

sudo apt install git-core gitk git-gui subversion curl
cd $DEV_DIR
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

 

Get ChromiumOS source

cd ${CHROMIUM_DIR}
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git
repo sync -j25

 

Build ChromiumOS

cros_sdk -- ./build_packages --board=${BOARD}
cros_sdk -- ./build_image --board=${BOARD}

 

Flash ChromiumOS to storage medium

cros_sdk -- cros flash --board=${BOARD} usb:/$USB_DEVICE

 

Install ChromiumOS on Chromebook

Enter Chromebook into dev-mode

This part is highly device specific, and depends on how the manufacturer of your device has chosen to implement the dev-mode switch.

A partial list of devices and how to enter them into dev-mode can be found here.

Flash ChromiumOS to Chromebook

Fire up your Chrombook device and hit Ctrl+Alt+Back, followed by 'chronos' and hit enter. Followed by the below command to install the ChromiumOS build that was just flashed.

/usr/sbin/chromeos-install

 

Debug an application

On Chromebook

Again fire up your Chrombook device and hit Ctrl+Alt+Back, followed by 'chronos' and hit enter.

# Remount the root drive read / write
sudo mount -o remount,rw /

# Open port so that gdbserver can be reached
sudo /sbin/iptables -A INPUT  -p tcp --dport 1234 -j ACCEPT

# Run gdb server, listening on port 1234 (opened in iptables command above)
sudo gdbserver :1234 chrome


On dev machine

# On x86
cros_sdk -- sudo USE=expat emerge cross-i686-pc-linux-gnu/gdb
# On ARMv7
cros_sdk -- sudo USE=expat emerge cross-armv7a-cros-linux-gnueabi/gdb

cros_sdk -- i686-pc-linux-gnu-gdb "/build/$BOARD/opt/google/chrome/chrome"
(gdb) set sysroot /build/$BOARD/
(gdb) target remote IP_ADDR_CHROMEBOOK:1234
(gdb) continue

 

Conclusion

This is a bit of a rough outline, and is only suitable for Chromebook devices that already are in dev-mode.

Thanks!

This post has been a part of work undertaken by my employer Collabora.

References

ChromiumOS Depo Tools
ChromiumOS Quick Start
ChromiumOS Dev Mode
ChromiumOS Debug

Original post

Comments (0)


Add a Comment





Allowed tags: <b><i><br>Add a new comment:


Latest Blog Posts

Collabora contributions to GStreamer 1.12

04/05/2017

Along with the usual load of memory leaks, crashes and other bugs, Collabora's multimedia team once again contributed a number of improvements…

Android: Getting up and running on the iMX6

27/04/2017

Getting Android up and running on the iMX6 platform using an open source graphics stack has been impossible up until recently, but now you…

Receiving an AES67 stream with GStreamer

25/04/2017

With GStreamer you can easily receive a AES67 stream, the standard which allows inter-operability between different IP based audio networking…

Quick hack: Changing the Android boot animation

21/04/2017

If you're looking to change the Android boot animation to something other than the stock one, here's a hands-on guide to help you to do…

GStreamer 1.12: Intel Media SDK support and more

19/04/2017

With GStreamer 1.12's first release candidate out for testing and the final release expected soon, here's a brief preview of some of the…

Tracing the user space and Operating System interactions

10/04/2017

Like the bug that no one can solve, many issues occur on the interface between the user application and the operating system. But even in…

Open Since 2005

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2017. All rights reserved. Website sitemap.