After poking around a few weeks in the developer shell on my Chrome OS, I felt like I needed more. I wanted the utilities that I am accustomed to on OSX or linux shell. The first thing I needed to do was find the right toolchain for the Samsung Chromebook. A quick google turned up a great resource as a starting point. (The blog also mentions how to get in the right ‘mode’ and how to backup.)
When you are ready to go, press ctrl-alt-t to get in the crosh tab, then type ‘shell’ to get into a bash shell, and then type ‘mkdir toolchain’. Move into the directory with ‘cd toolchain’.
Cruise to http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a_hardfp/ and find the latest release of the tool chain. At the time of writing it is stage3-armv7a_hardfp-20130821.tar.bz2 (it has changed since I started messing with it).
A few items you might have to update in the below command:
The first command allows you to modify the filesystem that is normally protected.
sudo /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions 2 wget http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a_hardfp/stage3-armv7a_hardfp-20130209.tar.bz2 tar xf stage3-armv7a_hardfp-20130209.tar.bz2 sudo mount -i -o remount,exec /home/chronos/user/ export C_INCLUDE_PATH=~/toolchain/usr/include export LD_LIBRARY_PATH=~/toolchain/usr/lib:~/toolchain/usr/lib/binutils/armv7a-hardfloat-linux-gnueabi/2.22 export PATH=$PATH:~/toolchain/usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/4.5.4:~/toolchain/usr/armv7a-hardfloat-linux-gnueabi/binutils-bin/2.22 sed -i 's/\/usr/\/home\/chronos\/user\/toolchain\/usr/g' ~/toolchain/usr/lib/libc.so export PATH=$PATH:~/toolchain/usr/armv7a-hardfloat-linux-gnueabi/gcc-bin/4.6.3:~/toolchain/usr/armv7a-hardfloat-linux-gnueabi/binutils-bin/2.22
And now you are ready to start compiling files. To make thinks easier, I built ‘make’ next.
wget http://ftp.gnu.org/gnu/make/make-3.82.tar.bz2 tar xf make-3.82.tar.bz2 cd ma* ./configure ./build.sh
You can choose to copy this into /usr/local/bin. To copy, ‘sudo cp make /usr/local/bin’.
Let’s test a few applications:
wget http://www.nano-editor.org/dist/latest/nano-2.3.2.tar.gz tar -zxvf nano-2.3.2.tar.gz cd nano-2.3.2/ ./configure make cd src sudo cp ./nano /usr/local/bin
And now you should have ‘nano’. We can build another one, htop.
wget http://downloads.sourceforge.net/project/htop/htop/1.0.2/htop-1.0.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fhtop%2F&ts=1378015747&use_mirror=superb-dca2 -O htop-1.0.2.tar.gz ls ##I see I screwed up on my wget options mv htop-1.0.2.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fhtop%2F htop-1.0.2.tar.gz tar -zxvf htop-1.0.2.tar.gz ./configure make sudo cp htop /usr/local/bin
These same basic steps should work for most open-source code available for compiling on ARM architecture. If you want to download the compiled version of nano and htop please right click and select save as or use wget.
It was at this point I decided to try to compile Open-Zwave. No real point building it on Chrome OS, but I wanted to see how it ran. Open-Zwave was pretty easy to get compiled but the OpenZwave Control Panel took a little bit of work due to the required libmicrohttpd.
Comments
hello,
i have a problem when i execute ./build.sh. i have the error message :
./guile.c:25:22: fatal error: libguile.h: No such file or directory
Are you building make-4.0? Someone else reported this bug recently. I will try building the latest version this weekend.
I do exactly the same manipulation as in your tutorial, but with the latest versions. So yes, with make 4.0 and the last image of gentoo.
Any luck on this? I am running into the same thing. I adjusted the path variables to point to the most recent version, as well as LD_Library_path, but I’m getting the guile.h error. Where should I expect this file to be?
Use an older version of make. 3.82 worked for me
Hi, I tried this but have this issue upon compiling make:
checking for a BSD-compatible install… /usr/bin/install -c
checking whether build environment is sane… yes
checking for a thread-safe mkdir -p… /bin/mkdir -p
checking for gawk… no
checking for mawk… mawk
checking whether make sets $(MAKE)… no
checking for gcc… gcc
checking whether the C compiler works… no
configure: error: in `/home/chronos/user/dev/make-3.82′:
configure: error: C compiler cannot create executables
See `config.log’ for more details.
I (obviosuly) used a newer version of the first zip however i did change all the values for versions in the EXPORT commands just incase this is my config.log: http://pastebin.com/raw/My67TNth