We're hiring!
*

Quick hack: Setting up a ChromiumOS dev environment

Robert Foss avatar

Robert Foss
February 16, 2017

Share this post:

Reading time:

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 (1)

  1. Mr. Elder Glen Dawes:
    Jan 22, 2019 at 03:43 PM


Add a Comment






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


Search the newsroom

Latest Blog Posts

MLfix to quickly fix datasets

08/06/2023

Contrary to traditional software development, data is more important than code in machine learning. Building a high-performing model requires…

USB 3.0 preliminary support in U-boot for Radxa Rock-5B

31/05/2023

A while back I presented USB 2.0 host support that was added to U-boot for the Radxa Rock-5B RK3588 Rockchip board. This time, USB 3.0 was…

Radxa Rock-5B PCIe and RTL8125B networking in U-boot

18/05/2023

Work continues on the Radxa ROCK5B RK388, as PCIe and RTL8125B networking support in U-boot have now been added. Publishing code as Open…

Introducing Multiview for NVK

03/05/2023

NVK, an open-source Vulkan driver for NVIDIA hardware that is part of Mesa, now supports the Vulkan extension VK_KHR_multiview.

Adding bootloader support for USB 2.0 Host for Radxa ROCK 5B RK3588

27/04/2023

The beauty of Open Source is that we can reuse code written by many other people, keep their authorship, and credit them for their work,…

Meson & VSCode: Develop your project in a modern IDE

18/04/2023

Want to develop your Meson project in a modern IDE? Make sure to install Meson VSCode extension which is now fully functional with the recent…

Open Since 2005 logo

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-2023. All rights reserved. Privacy Notice. Sitemap.