Setting 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 are specific for the Chromebook that Is
# being targeted, a more generic target like "Amd64-generic" could # is more useful for your
needs.
Export Board=chell
# The Usb_device variable refers to the USB DEVICE that'll be used
# for flashing ChromiumOS onto a Chromebook.
# Make sure the 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 are highly device specific, and depends on how the manufacturer of your device-has chosen to implement the Dev-mo De switch.
A partial list of devices and how to enter them into Dev-mode can is 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" ChromiumOS build is 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, Gdbserver can be reached
Sudo/sbin/iptables-a INPUT -P TCP--dport 1234-j ACCEPT
# Run GDB server, listening on port 1234 (opened in IPT Ables 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 E Merge 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 the a rough outline, and is only suitable for Chromebook devices that already are in Dev-mode. Original address: http://memcpy.io/setting-up-a-chromiumos-dev-environment.html