So I haven't had a lot of luck making this work yet, but this is how I was able to get the appropriate kernel source from the git repository. It requires a little trial and error, but it seemed to work for me. I haven't been able yet to get the virtualbox drivers to compile properly yet upon installation, so I wouldn't mind a hand if someone gets this to work for them. NOTE: I had to intentionally break some of my reference links to post this because I don't have enough rep points yet; I put a space near the beginning of the link, so you may need to copy/paste and edit.
This is from text that I was preparing to update divx118's wiki page on this; it's not 100% ready, so it's a little raw, but should be clear enough. FOr me, when I tried this Tuesday night, HEAD~115 hit my current kernel version, but that may have changed by now, so tweak as necessary.
Add to the wiki page:
https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-%28x86%29/_edit
Next, we need to determine the version of the kernel we're currently running.
$ uname -r
Then clone the kernel branch chromeos-[version] to our home folder.
$ cd ~
$ git clone https://chromium.googlesource.com/chromiumos/third_party/kernel -b chromeos-[version]
For example, [version]
may be 3.18 or some other value; see the value returned by uname above to determine this. Then we may need to download the correct revision of the kernel source from the git repository, if the downloaded source version doesn't match that of what we're currently running, by rolling back to a previous commit. First, determine the kernel version for the source we just downloaded:
$ cd kernel
$ ./chromeos/scripts/prepareconfig chromeos-intel-pineview
$ make oldconfig
$ make kernelrelease
If the version from the uname
command above does not match what is displayed, and is indeed a later version, then one can do the following to download an earlier version:
$ git reset --hard origin/chromeos-3.18
$ git checkout HEAD~[number of commits prior to current version]
$ ./chromeos/scripts/prepareconfig chromeos-intel-pineview
$ make oldconfig
$ make kernelrelease
One may need to repeat the above steps a number of times, each time increasing the commit number in brackets, to get back to the appropriate version of the kernel source, and some trial and error may be needed to find your matching version. Once the correct version has been retrieved:
$ git reset --hard origin/chromeos-3.18
... to clean up after ourselves.
How to get rid of the -dirty
tag when compiling kernel source:
http://arago-project.org/pipermail/meta-arago/2013-January/000795.html
https://groups.google.com/a/chromium.org/forum/#!msg/chromium-os-reviews/qg1i7ptQX80/AYdUWC7zGZsJ
Basically, edit base.config
and change LOCALVERSION_AUTO
to N
.