IntroductionThis page aims to document how to use an Upstream Kernel on Chrome OS. It's aimed at helping people with upstreaming for the Samsung ARM Series 3 Chromebook (AKA snow) and uses that in many examples. However, it's useful in other cases, too. In general this documentation assumes that you've got the Chrome OS source tree synced down and have a build environment (and chroot) setup. It assumes you've built packages and an image for your board (like Obtain source code and recent patchesThe whole point here is to use the upstream kernel, so these instructions will direct you to linux-next. ...but linux-next is pretty darn bleeding edge. If you get stuck and things won't boot, you could always try a known-good state. In fact, many of the needed patches have now landed on even landed on the main linux tree now. See the section below "Patches relevant to the Samsung ARM Chromebook" for the last known good state. The easiest way to get source code is to just add a remote git server to your normal kernel tree, fetch things, and then use patchwork to apply some patches. Here's some steps to do that and start a new work branch on linux-next. WARNING: The fetch might be slow. cd ~/trunk/src/third_party/kernel/files git remote add linuxnext git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch linuxnext git checkout -b my_branch linuxnext/master Installing pwclientNow that you've got the source code you should apply a few patches. In this case we'll use First we need to install One way to install the patchwork client in the cros chroot is via its ebuild: sudo emerge pwclient Alternatively, you can install the latest pwclient directly from kernel.org: sudo bash -c "curl 'https://patchwork.kernel.org/pwclient/' > /usr/local/bin/pwclient" sudo chmod +x /usr/local/bin/pwclient Next, setup the .pwmclientrc for the LKML project on patchwork.kernel.org:# The following will clobber any existing ~/.pwclientrc you have (!) curl 'https://patchwork.kernel.org/project/LKML/pwclientrc/' > ~/.pwclientrc Patches relevant to the Samsung ARM ChromebookThis section should go away eventually once patches are upstream... Relevant patch series that I've tested (as of 12/19/12)
Quick way to apply: for id in 1966801 1966931 1966871 1966781 1966811; do pwclient git-am $id done pwclient git-am 1966911 pwclient git-am 1840211
Status on linux-next/master:
Building and installing the kernelCertainly there are lots of ways to build and install the kernel. I'm not going to copy them all here but I'll just point you at the Kernel FAQ. Specifically read the How to quickly test kernel modifications (the fast way) section carefully. I would strongly suggest that you boot from a fast SD card rather than directly messing with what you have on eMMC. That way you can always get back to a running system. The quick set of steps for that is:
You might also want to look at Using nv-U-Boot on the Samsung ARM Chromebook. The kernel configOne especially weird thing when working with the upstream kernel is that standard ChromeOS kernel If you need to make changes to the kernel config locally the easiest thing to do is to just override that config. Here's a set of commands that might suit you: DEFCONFIG=~/trunk/src/third_party/chromiumos-overlay/eclass/cros-kernel/exynos5_defconfig cd ~/trunk/src/third_party/kernel/v3.8 cp ${DEFCONFIG} .config ARCH=arm make menuconfig # Make your changes ARCH=arm make savedefconfig cp defconfig ${DEFCONFIG} make mrproper If you have changes to the config that you think is relevant to others working on the upstream kernel then feel free to submit a patch! Making sure other configs compileIt's hard to make 100% sure that your change won't break anyone else. ...but it's usually considered courtesy to make sure that some other boards compile. If you want to see if the cd ~/trunk/src/third_party/kernel/v3.8 ARCH=arm CROSS_COMPILE=armv7a-cros-linux-gnueabi- make exynos4_defconfig ARCH=arm CROSS_COMPILE=armv7a-cros-linux-gnueabi- make -j16 make mrproper exynos4_defconfig is particularly interesting when you're modifying exynos code because it is a non-device tree enabled board that shares a lot of code with the exynos config that we're using (so it's easy to break). It's actually broken at the git hash I listed above because I didn't run it before submitting my last patch. :(Sending your change upstreamThis is documented over at the Kernel FAQ, which will soon (hopefully) include the use of patman. What is known to work (and known to not work)As of 11/30/12: Works:
Known not to work yet:
MusingsA few random thoughts:
ContributingPatches are certainly appreciated as are reviews of patches posted upstream. In general most people on the Chrome OS team wouldn't object to people taking patches from the Chrome OS kernel tree, adjusting them, and posting them upstream (check with the author, though, since people may be midway through doing that themselves). |
Chromium OS > How Tos and Troubleshooting >