Page 1 of 1

Updating the kernel

Posted: 13 Oct 2007, 13:16
by unavowed
I am a proud owner of a new Bubba server and in general I am satisfied with it apart from one thing: it's not clear how to upgrade the kernel. I noticed that on download.excito.net there are 3 kernels available, 2 of them newer than the 2.6.16.16 shipped by default, so there must be a way to do it. I want to be able to do it because some kernel features cannot be compiled as modules and I want to use them.

I did a little investigation:

Code: Select all

# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00010800 00000210 "bootloader"
mtd1: 0018c000 00000210 "kernel"
mtd2: 00073800 00000210 "filesystem"
mtd0 is the boot loader, which can bee seen by using cat /dev/mtd0 | strings
mtd2 seems to contain a gzipped ext2 initrd filesystem
mtd1, according to the description, is the kernel.

So, after compiling a new kernel with patches from download.excito.net, it would make sense if the kernel could be updated by writing the Image file to mtd1.

My questions, therefore, are:
1. Am I right that it can be done this way?
2. What happens if something bad is written to mtd1; can the system be recovered?

Thanks.

Posted: 13 Oct 2007, 16:40
by unavowed
On further examination, it seems that to me the contents of mtd1 is actually the zImage file produced after compiling linux. The beginning of both looks very similar and the size is quite close too.

Posted: 14 Oct 2007, 14:51
by pa
Hi unavowed,

You are right about that the mtd1 partition contains the zImage, and it is possible to "just" write that file to mtd1.

However, you are correct about worringing about writing something bad to this partition. If the kernel is corrupt in any way it will be very hard for you to get it up and running again.
The processor supports boot from the debug serial port if there is nothing valid in the boot flash. The problem here is that there is, the bootloader. So in order to be able to restore the image you would have to open the Bubba, and somehow disable the bootflash. You would then have to do some soldering work to get the debug serial port up and running, see this thread: http://excito.org/forum/viewtopic.php?t=206
If there is not a valid image in the flash, the processor will boot using the built in Atmel bootloader, and can accept code using x-modem protocol. Please refer to Atmel homepage for documentation of this.

But in short, if you mess up the boot flash, you have a tough job restoring the system.

/PA

Posted: 14 Oct 2007, 17:58
by unavowed
Thank you for the detailed reply :-)