How do I build/install the kernel on a XO?

Andres Salomon dilinger at laptop.org
Mon Apr 9 12:45:48 EDT 2007


Hal Murray wrote:
> I found a recipe for building the kernel at
>   http://wiki.laptop.org/go/Rebuilding_OLPC_kernel
> 
> 
> I've got a FC6 system.  git clone, make oldconfig,and make seemed to do 
> something sensible.

That should work.  We do the builds on an FC6 system as well.

> 
> I'm a bit suspicious of the .config file.  I'd expect one/some of these to be 
> set:
> # CONFIG_M386 is not set
> # CONFIG_M486 is not set
> # CONFIG_M586 is not set
> # CONFIG_M586TSC is not set
> # CONFIG_M586MMX is not set
> # CONFIG_M686 is not set
> # CONFIG_X86_GENERIC is not set
> 
> Is that really the right config file?  (Maybe I fatfingered something?)
> 


That is correct.  Note that the following *is* set:

CONFIG_MGEODE_LX=y

That's our cpu, and optimizing for other x86 cpus causes us to end up
with the wrong cache line size.

> 
> make install tries do a normal install on the current system.
> 
> I'm assuming I can do the build on a handy machine, transport the bits to a 
> running XO, install them there, and then reboot.  Is that reasonable?
> 

Yes.


>   A: My handy machine is FC6 on an Intel PC.  I'm assuming
>   that's close enough to the XO that I don't have to do a real
>   cross-compile type build.
> 
>   B: I'm willing to re-install everything from scratch/flash if
>   my new kernel doesn't work.
> 
> Assuming I'm on the right track, does anybody have a simple recipe for the 
> transport/install step?  I'll be happy with transport via flash or scp.
> 
> 

Basically, I do:

- make oldconfig
- make
- make modules_install
- tar zcvf modules.tar.gz /lib/modules/$VERS
- scp arch/i386/boot/bzImage System.map modules.tar.gz $XO:

Replace $VERS with the version of the kernel that's being built, and $XO
with the user at host of your xo machine.

Once it's on the xo, I ssh in, untar modules.tar.gz (into /lib/modules),
copy the bzImage and System.map files into /boot, and update the
/boot/vmlinuz symlink to point to the bzImage.   Reboot, and you should
be all set.

Note that this is for booting off nand; if you're booting off a flash
disk or something, there's are the extra steps of running 'mkinitrd' on
the xo after you've untarred modules, and then updating the
/boot/initrd.img symlink to point to the newly created initrd.

> My XO:/boot/ has things like:
>   symsets-2.6.21-20070330.1.olpc.168c2435fc81673.tar.gz
>   symvers-2.6.21-20070330.1.olpc.168c2435fc81673.gz
> 
> Do I need them and/or what are they used for and where do they come from?
> 
> 

They come from the rpm generation script; I'm not entirely sure what
they're used for.  I never bother copying them, though.



More information about the Devel mailing list