Kernel Building: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
m (cosmetics)
Line 1: Line 1:
;Note: it is recommended that you build an RPM ([[Rebuilding OLPC kernel]]) unless you are already familiar with kernel development!
[[Category:Developers]]
[[Category:Software]]

Note: it is recommended that you build an RPM ([[Rebuilding OLPC kernel]]) unless you are already familiar with kernel development!


== Building an OLPC kernel ==
== Building an OLPC kernel ==
Line 8: Line 5:
After obtaining the OLPC source (and if desired, making changes), the following steps can be taken to build a kernel on any Fedora Core 6 machine:
After obtaining the OLPC source (and if desired, making changes), the following steps can be taken to build a kernel on any Fedora Core 6 machine:


* make oldconfig
make oldconfig
* make
make
* make modules_install # as root
make modules_install # as root
* tar zcvf kern.tar.gz arch/i386/boot/bzImage System.map /lib/modules/$VERS
tar zcvf kern.tar.gz arch/i386/boot/bzImage System.map /lib/modules/$VERS


(Warning, this needs root and will trash your /lib/modules, if you happen to already have same version. Use "make INSTALL_MOD_DIR=/somewhere modules_install" if you want to avoid using root).
;Warning!:this needs root and will trash your /lib/modules, if you happen to already have same version. Use "make INSTALL_MOD_DIR=/somewhere modules_install" if you want to avoid using root).


Replace $VERS above with the proper kernel version that has been built.
Replace $VERS above with the proper kernel version that has been built.
Line 19: Line 16:
Assuming everything builds correctly, you will be left with kern.tar.gz. This can be copied over to an XO laptop, and the following steps will install the kernel (again, replacing $VERS with the kernel version):
Assuming everything builds correctly, you will be left with kern.tar.gz. This can be copied over to an XO laptop, and the following steps will install the kernel (again, replacing $VERS with the kernel version):


* cd /
cd /
* tar zxvf .../kern.tar.gz
tar zxvf .../kern.tar.gz
* mv System.map /boot/System.map-$VERS
mv System.map /boot/System.map-$VERS
* mv arch/i386/boot/bzImage /boot/vmlinuz-$VERS
mv arch/i386/boot/bzImage /boot/vmlinuz-$VERS
* ln -sf /boot/vmlinuz-$VERS /boot/vmlinuz
ln -sf /boot/vmlinuz-$VERS /boot/vmlinuz


If not booting off NAND, the additional steps are also necessary:
If not booting off NAND, the additional steps are also necessary:


* mkinitrd /boot/initrd-$VERS.img $VERS
mkinitrd /boot/initrd-$VERS.img $VERS
* ln -sf /boot/initrd-$VERS.img /boot/initrd.img
ln -sf /boot/initrd-$VERS.img /boot/initrd.img

[[Category:Developers]]
[[Category:OS]]
[[Category:Software]]

Revision as of 20:52, 9 May 2007

Note
it is recommended that you build an RPM (Rebuilding OLPC kernel) unless you are already familiar with kernel development!

Building an OLPC kernel

After obtaining the OLPC source (and if desired, making changes), the following steps can be taken to build a kernel on any Fedora Core 6 machine:

make oldconfig
make
make modules_install  # as root
tar zcvf kern.tar.gz arch/i386/boot/bzImage System.map /lib/modules/$VERS
Warning!
this needs root and will trash your /lib/modules, if you happen to already have same version. Use "make INSTALL_MOD_DIR=/somewhere modules_install" if you want to avoid using root).

Replace $VERS above with the proper kernel version that has been built.

Assuming everything builds correctly, you will be left with kern.tar.gz. This can be copied over to an XO laptop, and the following steps will install the kernel (again, replacing $VERS with the kernel version):

cd /
tar zxvf .../kern.tar.gz
mv System.map /boot/System.map-$VERS
mv arch/i386/boot/bzImage /boot/vmlinuz-$VERS
ln -sf /boot/vmlinuz-$VERS /boot/vmlinuz

If not booting off NAND, the additional steps are also necessary:

mkinitrd /boot/initrd-$VERS.img $VERS
ln -sf /boot/initrd-$VERS.img /boot/initrd.img