Difference between revisions of "Compile a uBoot Kernel"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
(New page: This is a tutorial of how to compile a uBoot kernel from vanilla gentoo-sources. Step 1 Get the sources Right now (24 Nov 2008) the latest stable version is gentoo-sources-2.6.26-r2. If...)
 
Line 1: Line 1:
 
This is a tutorial of how to compile a uBoot kernel from vanilla gentoo-sources.
 
This is a tutorial of how to compile a uBoot kernel from vanilla gentoo-sources.
  
Step 1
+
===Get the sources===
Get the sources
+
  
 
Right now (24 Nov 2008) the latest stable version is gentoo-sources-2.6.26-r2.  If you want a newer kernel, simply edit /etc/portage/package.keywords and add this line:
 
Right now (24 Nov 2008) the latest stable version is gentoo-sources-2.6.26-r2.  If you want a newer kernel, simply edit /etc/portage/package.keywords and add this line:
Line 16: Line 15:
  
  
Step 2
+
 
Edit your kernel config
+
===Edit your kernel config===
  
 
Clean up before you begin
 
Clean up before you begin
Line 31: Line 30:
  
  
Step 3
+
 
Compile your kernel
+
===Compile your kernel===
  
 
# make uImage && make modules && make modules_install
 
# make uImage && make modules && make modules_install
Line 38: Line 37:
 
Sit back and listen to music.  Go to the store.  Wash the dog.
 
Sit back and listen to music.  Go to the store.  Wash the dog.
  
Step 4
+
 
Backup your old kernel and dtb file
+
===Backup your old kernel and dtb file===
  
 
# cp /boot/uImage /boot/uImage.bak
 
# cp /boot/uImage /boot/uImage.bak
Line 45: Line 44:
  
  
Step 5
+
 
Compile the dtb file
+
===Compile the dtb file===
  
 
# cd /usr/src/linux/arch/powerpc/boot/dts
 
# cd /usr/src/linux/arch/powerpc/boot/dts
Line 53: Line 52:
  
  
Step 6
+
 
Install the kernel
+
===Install the kernel===
  
 
# cp /usr/src/linux/arch/powerpc/boot/uImage /boot/uImage
 
# cp /usr/src/linux/arch/powerpc/boot/uImage /boot/uImage
  
  
Step 7
+
 
Reboot
+
===Reboot===
  
 
# reboot
 
# reboot
Line 66: Line 65:
 
With any luck, you'll be booting your new kernel.
 
With any luck, you'll be booting your new kernel.
  
However, if something goes wrong, simply boot in EM mode and copy your old kernel back.
+
 
 +
 
 +
===Troubleshooting===
 +
If something goes wrong, simply boot in EM mode and copy your old kernel back.
  
 
# cp /boot/uImage.bak /boot/uImage
 
# cp /boot/uImage.bak /boot/uImage
 
# cp /boot/kuroboxHG.dtb.bak /boot/kuroboxHG.dtb
 
# cp /boot/kuroboxHG.dtb.bak /boot/kuroboxHG.dtb
 
# echo -n "OKOK" > /dev/fl3
 
# echo -n "OKOK" > /dev/fl3

Revision as of 15:27, 24 November 2008

This is a tutorial of how to compile a uBoot kernel from vanilla gentoo-sources.

Contents

Get the sources

Right now (24 Nov 2008) the latest stable version is gentoo-sources-2.6.26-r2. If you want a newer kernel, simply edit /etc/portage/package.keywords and add this line: sys-kernel/gentoo-sources ~ppc

then download the kernel sources

  1. emerge -ua gentoo-sources

make a link to the kernel sources

  1. cd /usr/src
  2. ln -sfn linux-2.6.26-gentoo-r2 linux



Edit your kernel config

Clean up before you begin

  1. cd /usr/src/linux
  2. make mrproper

Use the default KuroBox config

  1. cp arch/powerpc/configs/linkstation_defconfig .config

Make sure the config is sane

  1. make menuconfig

The default config is minimal. You'll have to enable support for any non-standard things you may be using. I use reiserfs and netatalk, so I enabled support for that filesystem and also for appletalk.


Compile your kernel

  1. make uImage && make modules && make modules_install

Sit back and listen to music. Go to the store. Wash the dog.


Backup your old kernel and dtb file

  1. cp /boot/uImage /boot/uImage.bak
  2. cp /boot/kuroboxHG.dtb /boot/kuroboxHG.dtb.bak


Compile the dtb file

  1. cd /usr/src/linux/arch/powerpc/boot/dts
  2. ../dtc -I dts -O dtb -V 16 -o /tmp/kuroboxHG.dtb kuroboxHG.dts
  3. cp /tmp/kuroboxHG.dtb /boot/kuroboxHG.dtb


Install the kernel

  1. cp /usr/src/linux/arch/powerpc/boot/uImage /boot/uImage


Reboot

  1. reboot

With any luck, you'll be booting your new kernel.


Troubleshooting

If something goes wrong, simply boot in EM mode and copy your old kernel back.

  1. cp /boot/uImage.bak /boot/uImage
  2. cp /boot/kuroboxHG.dtb.bak /boot/kuroboxHG.dtb
  3. echo -n "OKOK" > /dev/fl3