Wednesday, December 02, 2009

ChromeOS -- making the rootfs writable

Yes, I had a major problem with ChromeOS that I installed on a 4GB pendrive and run on my EeePC 901. I posted about the install here.

Slow browsing
The problem was that browsing was painfully slow mainly due to so much time spent "resolving host" which is indicative of a DNS problem.
Now, going to a terminal I could see that /etc/resolv.conf contained only the localhost as nameserver. (nameserver OK, that should be easy to fix, just add the OpenDNS servers to this file, right?
Unfortunately, the root file system is mounted read-only so no changes can be made to anything. Oh boy!!
Then I came across this blogpost which explains how wifi can be made to work in ChromeOS (on a pendrive). The first step is to make the rootfs writable with this command:

sudo mount -o remount,rw /

The only terminal editor available in ChromeOS (AFAICS) is VI at which I am no expert. I managed to get one DNS server into /etc/resolv.conf and browsing speed improved dramatically.
However, now that the rootfs is writable, I can mount the Ubuntu partitions I have on the same machine and copy over the /etc/.resolv.conf from Ubuntu (which contains the two OpenDNS servers) to ChromeOS. This worked perfectly.

No wifi in ChromeOS
Ironically, I couldn't get wifi working in ChromeOS on the EeePC 901.
I first copied rt2860.bin from Ubuntu's /lib/firmware to the equivalent folder on ChromeOS. No wifi.
So, then I copied everything from Ubuntu's /lib/firmare to ChjromeOS. Still no wifi.
Then I copied rt2860sta.ko from Ubuntu's /lib/modules/2.6.31-15-generic/kernel/drivers/staging/rt2860/ to Chrome's /lib/modules/2.6.30-chromeos-intel-menlow/kernel/drivers/net/wireless/ but still no wifi.
Finally, I created staging and rt2860 directories in Chrome and copied from Ubuntu's /lib/modules/2.6.31-15-generic/kernel/drivers/staging/rt2860/rt2860sta.ko to Chrome's /lib/modules/2.6.31-15-generic/kernel/drivers/staging/rt2860/. But still no wifi.
So, I ran (as root)
depmod -a

and this gave no errors.
Next I ran
modprobe rt2860sta

and got this error
FATAL: Error inserting rt2860sta (/lib/modules/2.6.31-15-generic/kernel/drivers/staging/rt2860/rt2860sta.ko): Invalid module format.

This sounds to me that the rt2860sta.ko copied from Ubuntu is not compatible with ChromeOS possibly because of the difference in kernels. Maybe I'll have to compile the module myself.

Booting ChromeOS from Ubuntu Grub
Up to now I had been booting ChromeOS directly from the USB key's bootloader.
So, I wanted to see if booting from Ubuntu's Grub (0.97) would speed up booting.
So, I added a new stanza to Ubuntu's /boot/grub/menu.lst as follows:
title Google Chrome OS 2.6.30-chromeos-intel-menlow
root (hd1,1)
kernel /boot/chromeos/vmlinuz-2.6.30-chromeos-intel-menlow root=/dev/sdc3
initrd /boot/chromeos/initrd.img-2.6.30-chromeos-intel-menlow

Note that the rootfs in ChromeOS is on the third (of three) partitions that the installer creates on the pendrive. Additionally for this to work the bootfiles (vmlinuz-2.6.30-chromeos-intel-menlow, initrd.img-2.6.30-chromeos-intel-menlow) must be copied from the /boot directory in ChromeOS to /boot/chromeos/ on Ubuntu.
This works perfectly and seems to boot a little faster although I haven't verified this with measurements.

No comments:

Post a Comment