Submitted by Coyote on Sat, 09/15/2007 - 11:07am.
Follow these instructions at your own risk. They work perfectly on my RaQ4, but I can't guarantee they'll work on your Cobalt. I cannot be held responsible for your machine.
I don't always check this page for comments, so please, leave your comments & then contact me using my contact page so I know to come by & respond. You should also check on my updates before starting, this is where I note new versions of my patches & whatnot.
These instructions assume that you've already upgraded your ROM to at least 2.10.3 from the Cobalt ROM Sourceforge Project. I'm using cobalt-2.10.3-ext3-1M. It's probably a good idea to have an NFS boot server handy or be able to set one up pretty quick. Installing Debian 3.1 Sarge on a Cobalt RaQ4 shows you how to set that up. If something isn't right with the kernel & it doesn't boot, you'll want to be able to boot from the network to fix any issues.
Before I get started, I'd like to thank Jim Tuttle for his Ubuntu Dapper on Qube3 HOWTO. His instructions on compiling the Linux kernel on Cobalt were flawless. I'd also like to thank Jeff Walters for his work in keeping up with the newer kernels & giving us a way to use them on these machines. And also to Tim Hockin, a former Cobalt engineer who has continued hacking the Cobalt kernel long after Sun backed out.
1) Preparation
You'll need root privileges for almost every command in here, and since we're all good admins & don't login to the machine as root, we'll need to switch to UID 0. There are also a few packages that we'll need to compile our kernel. Grab them all with apt-get.
2) Download Linux source
Now we need to get the latest kernel source from kernel.org. The repository can be found here: http://www.kernel.org/pub/linux/kernel/. Go there & get whichever version you want. They come in all different flavors, but this HOWTO assumes that you're downloading the bzip2 archive. The one I used is linux-2.6.24.3.tar.bz2. If you get anything different, certain parts of this HOWTO will change of course.
3) Unpack Source & Prepare Environment
Unpack your source archive
I wanted to rename the source directory so I'd know that it's the patched source (we'll be patching it in a moment).
Create a link to the source directory for building the kernel & change into it.
4) Download & Apply Patch
I originally got my patch from Jeff Walters at http://gentoo.404ster.com/projects.php?action=view&id=4. I had to make some more changes to the kernel source to make his patch work with linux-2.6.22.6, so I have a different patch. I will be submitting the patch to Jeff Walters for review & possible inclusion on his site. For now, feel free to get it from me. You can find it here: linux-2.6.24.3-cobalt3-tw.patch
5) Copy Config File
I've got a working config file for the 2.6.24.3 kernel. It has the cobalt options, netfilter as well as support for a few devices that I have. It's definitely a good starting point. You can find it here: linux-2.6.24.3-cobalt3-tw.config
NOTE: This config is for Cobalt Gen III machines. If you have a GEN V machine (XTR, etc.), you'll want to make sure that you remove Cobalt Gen III support & add Cobalt Gen V support when you make menuconfig.
6) Add Optional Trailing Version Information
Use your favorite text editor to open Makefile. I prefer vi, so that's what I'll use.
At the top, you will find the variables which build the full version information. Find the variable EXTRAVERSION & add anything to the end that you'd like. Whatever you add here will show up with `uname -r` when running the new kernel. This step is completely optional. Don't feel like you have to do it. Mine looks like this.
7) Prepare to Compile Kernel
During the oldconfig step, you may be asked a series of questions regarding support for different options. Most components can be built statically (included in the kernel) or as a module (can be loaded & unloaded on the fly). This step will also add options that have been added since your previous config to the new one. The menuconfig step will give you a set of menus that will allow you to browse through the different categories of options as well as add or remove them.
8) Compile Kernel
In the command below, change --revision to anything you want. This will show up in the debian package name. I usually go with the date & my revision number. Since this is the first try on 2007.03.02, we'll use '2007.03.02-1'.
9) Install Kernel Packages You Just Built
The installer will ask you if you want to abort installation of an initrd kernel image, choose "No".
10) Create vmlinux
It should be noted here that I'm pretty sure you don't need to make modules or modules_install as that's done by the linux-image package (when you told make-kpkg to make modules_image). However, I haven't fully tested this, so I've added those to the steps below. Feel free to try leaving them out.
You're kernel can't be any larger than 1800k when compressed, so you'll want to check it before moving on.
Mine is 1448k, so I'm fine.
If your bzipped kernel is larger than 1800k, you should try removing support for certain options that aren't necessary or build some options as modules.
11) Recreate Bootloader Links
Since the Cobalts don't have a bootloader, they load generic files from the boot partition. So we're going to create links to our new kernel for the boot ROM.
12) Reboot
When you log back in you should be running your new kernel.
1). Second stage kernel: Decompressing - done
If your Cobalt hangs or stalls on boot at "Second stage kernel: Decompressing - done" make sure you've compiled, stripped & bzip2 compressed vmlinux properly. Easiest way to do this it to hit the spacebar when you see Press spacebar to enter ROM mode on your console & then at the prompt type bfr to boot from ROM. Then repeat steps 10 & 11 above.
2007.10.21
I've updated my patch for linux-2.6.23.1. Get the Cobalt patch & config for linux-2.6.23.1 here. Below are the release notes.
2007.11.24
You may notice that my patch & config for linux-2.6.23.8-cobalt3-tw have references to linux-2.6.23.1-cobalt-tw. That's because I've linked 2.6.23.8 to 2.6.23.1 because there were no errors or new config features. Below are my latest release notes.
2008.03.02
I've updated my patch for linux-2.6.24.3. Get the Cobalt patch & config for linux-2.6.24.3 here. Below are the release notes.
»
Follow these instructions at your own risk. They work perfectly on my RaQ4, but I can't guarantee they'll work on your Cobalt. I cannot be held responsible for your machine.
I don't always check this page for comments, so please, leave your comments & then contact me using my contact page so I know to come by & respond. You should also check on my updates before starting, this is where I note new versions of my patches & whatnot.
These instructions assume that you've already upgraded your ROM to at least 2.10.3 from the Cobalt ROM Sourceforge Project. I'm using cobalt-2.10.3-ext3-1M. It's probably a good idea to have an NFS boot server handy or be able to set one up pretty quick. Installing Debian 3.1 Sarge on a Cobalt RaQ4 shows you how to set that up. If something isn't right with the kernel & it doesn't boot, you'll want to be able to boot from the network to fix any issues.
Before I get started, I'd like to thank Jim Tuttle for his Ubuntu Dapper on Qube3 HOWTO. His instructions on compiling the Linux kernel on Cobalt were flawless. I'd also like to thank Jeff Walters for his work in keeping up with the newer kernels & giving us a way to use them on these machines. And also to Tim Hockin, a former Cobalt engineer who has continued hacking the Cobalt kernel long after Sun backed out.
1) Preparation
You'll need root privileges for almost every command in here, and since we're all good admins & don't login to the machine as root, we'll need to switch to UID 0. There are also a few packages that we'll need to compile our kernel. Grab them all with apt-get.
user@host:~$ sudo su -
host:~# apt-get install build-essential bzip2 \
kernel-package gcc libncurses5 libncurses5-dev \
bin86 gawk ncurses-dev initramfs-tools2) Download Linux source
Now we need to get the latest kernel source from kernel.org. The repository can be found here: http://www.kernel.org/pub/linux/kernel/. Go there & get whichever version you want. They come in all different flavors, but this HOWTO assumes that you're downloading the bzip2 archive. The one I used is linux-2.6.24.3.tar.bz2. If you get anything different, certain parts of this HOWTO will change of course.
host:~# cd /usr/src
host:/usr/src# wget 'http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.24.3.tar.bz2'3) Unpack Source & Prepare Environment
Unpack your source archive
host:/usr/src# tar -jxvf linux-2.6.24.3.tar.bz2I wanted to rename the source directory so I'd know that it's the patched source (we'll be patching it in a moment).
host:/usr/src# mv linux-2.6.24.3 linux-2.6.24.3-cobalt3-twCreate a link to the source directory for building the kernel & change into it.
host:/usr/src# ln -s linux-2.6.24.3-cobalt3-tw linux
host:/usr/src# cd linux4) Download & Apply Patch
I originally got my patch from Jeff Walters at http://gentoo.404ster.com/projects.php?action=view&id=4. I had to make some more changes to the kernel source to make his patch work with linux-2.6.22.6, so I have a different patch. I will be submitting the patch to Jeff Walters for review & possible inclusion on his site. For now, feel free to get it from me. You can find it here: linux-2.6.24.3-cobalt3-tw.patch
host:/usr/src/linux# wget 'http://cobalt.timntina.com/kernel/2.6.24.3-cobalt3-tw/linux-2.6.24.3-cobalt3-tw.patch'
host:/usr/src/linux# patch -p1 < linux-2.6.24.3-cobalt3-tw.patch5) Copy Config File
I've got a working config file for the 2.6.24.3 kernel. It has the cobalt options, netfilter as well as support for a few devices that I have. It's definitely a good starting point. You can find it here: linux-2.6.24.3-cobalt3-tw.config
NOTE: This config is for Cobalt Gen III machines. If you have a GEN V machine (XTR, etc.), you'll want to make sure that you remove Cobalt Gen III support & add Cobalt Gen V support when you make menuconfig.
host:/usr/src/linux# wget 'http://cobalt.timntina.com/kernel/2.6.24.3-cobalt3-tw/linux-2.6.24.3-cobalt3-tw.config'
host:/usr/src/linux# cp linux-2.6.24.3-cobalt3-tw.config .config6) Add Optional Trailing Version Information
Use your favorite text editor to open Makefile. I prefer vi, so that's what I'll use.
host:/usr/src/linux# vi MakefileAt the top, you will find the variables which build the full version information. Find the variable EXTRAVERSION & add anything to the end that you'd like. Whatever you add here will show up with `uname -r` when running the new kernel. This step is completely optional. Don't feel like you have to do it. Mine looks like this.
EXTRAVERSION = .3-cobalt3-tw7) Prepare to Compile Kernel
During the oldconfig step, you may be asked a series of questions regarding support for different options. Most components can be built statically (included in the kernel) or as a module (can be loaded & unloaded on the fly). This step will also add options that have been added since your previous config to the new one. The menuconfig step will give you a set of menus that will allow you to browse through the different categories of options as well as add or remove them.
host:/usr/src/linux# make oldconfig
host:/usr/src/linux# make menuconfig
host:/usr/src/linux# make-kpkg clean8) Compile Kernel
In the command below, change --revision to anything you want. This will show up in the debian package name. I usually go with the date & my revision number. Since this is the first try on 2007.03.02, we'll use '2007.03.02-1'.
host:/usr/src/linux# make-kpkg --initrd --revision='2007.03.02-1' kernel_image kernel_headers modules_image9) Install Kernel Packages You Just Built
The installer will ask you if you want to abort installation of an initrd kernel image, choose "No".
host:/usr/src/linux# cd /usr/src
host:/usr/src# dpkg -i linux-image-2.6.24.3-cobalt3-tw_2007.03.02-1_i386.deb
host:/usr/src# dpkg -i linux-headers-2.6.24.3-cobalt3-tw_2007.03.02-1_i386.deb10) Create vmlinux
It should be noted here that I'm pretty sure you don't need to make modules or modules_install as that's done by the linux-image package (when you told make-kpkg to make modules_image). However, I haven't fully tested this, so I've added those to the steps below. Feel free to try leaving them out.
host:/usr/src# cd /usr/src/linux
host:/usr/src/linux# make vmlinux modules modules_install
host:/usr/src/linux# strip vmlinux
host:/usr/src/linux# bzip2 -c vmlinux > /boot/vmlinuz-2.6.24.3-cobalt3-tw.bz2You're kernel can't be any larger than 1800k when compressed, so you'll want to check it before moving on.
host:/usr/src/linux# du /boot/vmlinuz-2.6.24.3-cobalt3-tw.bz2
1448 vmlinuz-2.6.24.3-cobalt3-tw.bz2Mine is 1448k, so I'm fine.
If your bzipped kernel is larger than 1800k, you should try removing support for certain options that aren't necessary or build some options as modules.
11) Recreate Bootloader Links
Since the Cobalts don't have a bootloader, they load generic files from the boot partition. So we're going to create links to our new kernel for the boot ROM.
host:/usr/src/linux# cd /boot
host:/boot# rm System.map vmlinux.bz2 initrd.img
host:/boot# ln -s System.map-2.6.24.3-cobalt3-tw System.map
host:/boot# ln -s initrd.img-2.6.24.3-cobalt3-tw initrd.img
host:/boot# ln -s vmlinuz-2.6.24.3-cobalt3-tw.bz2 vmlinux.bz212) Reboot
host:/boot# shutdown -r nowWhen you log back in you should be running your new kernel.
user@host:~$ uname -r
2.6.24.3-cobalt3-twTroubleshooting
1). Second stage kernel: Decompressing - done
If your Cobalt hangs or stalls on boot at "Second stage kernel: Decompressing - done" make sure you've compiled, stripped & bzip2 compressed vmlinux properly. Easiest way to do this it to hit the spacebar when you see Press spacebar to enter ROM mode on your console & then at the prompt type bfr to boot from ROM. Then repeat steps 10 & 11 above.
Updates
2007.10.21
I've updated my patch for linux-2.6.23.1. Get the Cobalt patch & config for linux-2.6.23.1 here. Below are the release notes.
Changes in 2007.10.21-1
*) [config] removed Pegasus USB Ethernet support
*) [patch] fixed 15 offset patch hunks
*) [patch] imported cobalt support back into drivers/char/nvram.c
*) [patch] fixed the following 4 patch hunk failures
*) arch/i386/kernel/traps.c (Hunk #2 FAILED at 640)
*) drivers/Kconfig (Hunk #1 FAILED at 84)
*) drivers/Makefile (Hunk #1 FAILED at 69)
*) drivers/char/nvram.c (Hunk #1 FAILED at 48)2007.11.24
You may notice that my patch & config for linux-2.6.23.8-cobalt3-tw have references to linux-2.6.23.1-cobalt-tw. That's because I've linked 2.6.23.8 to 2.6.23.1 because there were no errors or new config features. Below are my latest release notes.
Changes in 2007.11.24-1
*) patched linux-2.6.23.8
*) [patch] changed 2.6.23.{1,8} drivers.char/nvram.c to include cobalt/nvram.h
instead of linux/cobalt-nvram.h. cobalt/nvram.h is a newer version
anyway and there's no reason to have two copies/versions of that file
duplicated in the source.2008.03.02
I've updated my patch for linux-2.6.24.3. Get the Cobalt patch & config for linux-2.6.24.3 here. Below are the release notes.
Changes in 2008.03.02-1
*) patched linux-2.6.24.3
*) [config] added ppp_mppe module support
*) [config] enable deprecated pci_find_* API
*) [patch] fixed patch to match new upstream directory structure with regard
to i386/x86_64 in to arch/x86
*) [patch] fixed some hunk offsets
Filed Under:
»
Thu, 08/21/2008 - 5:14am
It seems that the cobalt rom expects /, /boot. /etc, and maybe some key parts of /usr, /sbin, and /bin on the boot HD. By twiddling bits in the CMOS you can select different boot and root drives and partitions, but I've not made that work yet. I need to dump the CMOS in my RAQ 4r and see what it's doing with the MD drive.
I'm trying to get one of mine to boot from an SD flash card (set to ext2 ro) and run on a big (>>>>137G) pair of drives set up as RAID 1.
The machine sees the second ATA controller card in the PCI slot, but for some reason does not detect attached drives. I've seen some libata bug reports that seem to relate but I've not found the problem yet.
- Login or register to post comments
»Fri, 08/01/2008 - 5:41pm
greetings, i've followed the tutorials to its end, i have now a cobalt booting on nfsroot perfectly, i also have setup my partitions etc..
but when i try to boot the newly compiled kernel, it get stuck at 'booting kernel...' (after 2nd stage) and it freeze there, no info or anything, i've also setup proper ttyS0 & ttyS1 (in case.. the bootstrap needed this) and also tried to change the boot devices from hda1 to md1 (using raid) any help please ? :/
segfault67@gmail.com is my mail
- Login or register to post comments
»Fri, 08/01/2008 - 9:47pm
I saw this and I *think* is was because I was using the wrong compression. it may have also been a CMOS reset ws needed:
http://www.dincom.co.uk/bq/problems1.php
Try this kernel;
http://www.osoffice.co.uk/linux/strongbolt-kernels/RaQ3-4/current/vmlinux.bz2
I used it as a 'known good' to troubleshoot with and then started compiling my own.
Oz
- Login or register to post comments
»Mon, 08/04/2008 - 6:24am
you said by mail that maybe you were on skype, maybe you should add me, here my id : lemurtek :)
see ya
- Login or register to post comments
»Tue, 08/05/2008 - 7:51am
tried the same, again reinstalled fully the system... i'm still getting the booting kernel problem...
i got it sucessfully booted with a strongbolt kernel, but as i need custom patchs afterwards, i need to recompile..
this time, i did not use make-kpkg, i did a standard compilation, then vmlinux etc the whole stuff.. i'm kinda getting worried, i don't see anything that could be wrong (i used the vmlinux, stripped it down etc) if anyone want, i'll upload my files (vmlinux.bz2, /usrc/src/linux etc) somewhere.
- Login or register to post comments
»Tue, 08/05/2008 - 8:57am
i'm uploading my kernel contents and a bootlog here : http://lemurtek.fr/cobalt/
there is already a bootlog.. the kernel is on his way, don't think ya need the source people ? :)
- Login or register to post comments
»Tue, 08/05/2008 - 6:59pm
I'm fighting a potentially related and really weird problem. Same kernel that works fine on two machines (that I compiled) won't boot on another two machines. There's a few weird steps in the boot log;
Freeing unused kernel memory: 100k freed
BOOTLOADER: Mapping in physical locations
BOOTLOADER: load_addr=0xc2004000 ret_data=0xc2205cc4
BOOTLOADER: opening "/boot/vmlinux.bz2"
BOOTLOADER: opening "/vmlinux.bz2"
BOOTLOADER: opening "/boot/vmlinux.gz" <
BOOTLOADER: opening "/vmlinux.gz"
BOOTLOADER: calling reboot notifiers
md: stopping all md devices.
flushing ide devices: hda
BOOTLOADER: mapping 22M-32M for ride home
BOOTLOADER: disabling interrupts
BOOTLOADER: flushing cache
BOOTLOADER: Leap of faith!
Back in ramcode: done
Second stage load failed. Booting ROM kernel...
note the line "BOOTLOADER: opening "/boot/vmlinux.gz""
.gz? I have two machines failing this way. The SAME kernel boots fine on two others (without the .gz) I moved a disk from a machine that is booting correctly - and it works in the new machine.
I thought it might be disk geometry related, so I upped the blocksize to get the cylinder count below the magic 1024 - no joy. Zerod the MBR with
dd if=/dev/zero of=/dev/hda bs=512 count=1
to no effect.
Maybe it's not finding the vmlinux.bz2?? I see it when the disk is mounted.
- Login or register to post comments
»Tue, 08/12/2008 - 3:35am
In this case it turned out I'd made a mistake and the vmlinux.bz2 wasn't a valid kernel. The machine went looking in the root directory for one, then went looking for a gzipped one.
- Login or register to post comments
»Thu, 08/07/2008 - 1:48am
well, i'm completely clueless, since the strongbolt kernel boot, it should boot too, the only thing i've seen different is the strongbolt kernel is aiming for i586 instructions and has more modules compiled, i'm going to check them one by one..
i'll be on skype the whole day.
- Login or register to post comments
»Fri, 05/09/2008 - 11:15am
Great work, thanks for the patch.
I've removed all the .orig's and fixed one other minor issue so that this patches cleanly against Ubuntu Hardy's linux-source-2.6.24. This file can be found here:
http://zork.net/~v/files/linux-2.6.24-16.3-cobalt3-tw.patch
Thanks again!
- Michael
- Login or register to post comments
»Thu, 12/27/2007 - 4:44pm
I have been working through installing an ubuntu kernel on my raq3i. Here is the problem I keep running in to. Patching and kernel builds work fine but when I try to boot the kernel I get the following messages...
[ 39.129858] VFS: Cannot open root device "" or unknown-block(3,1)
[ 39.136521] Please append a correct "root=" boot option
[ 39.141767] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(3,1)
I think the problem has to do how the ubuntu kernels know what the root device is. I have noticed that on my ubuntu machines, the bootloader ususally passes root="xxx". Now the machine where I compile has /boot on /dev/hda2 while the cobalt is /dev/hda1. It seems odd that we would compile the root device into the kernel though.
I tried to pass a "root="..."" parameter to the kernel via the set_lparams in the ROM menu but to no avail.
Any help would be appreciated.
- Login or register to post comments
»Mon, 02/11/2008 - 4:12pm
I haven't had much luck putting / & /boot on separate partitions. I just went back to having both on /dev/hda1.
- Coyote
Living life 32 beats at a time...
- Login or register to post comments
»Tue, 09/18/2007 - 11:23am
Hi Tim!
Thanks for this very good how-to! I run into some problems with getting debian into my sun cobalt raq3.
1.) Upgrading my ROM didn't work fine with the flashtools from the sf-project. I always got this error:
flushing block 1 to ROM..../flashtool.small: flashrom_flush
_buffers(): erase failed for block 1! Bad or non-existent flash chip?
....
So I found on http://www.dincom.co.uk/bq/rom.php "Tim Hockin's" flashtool; with this tool the upgrade to 2.10.3-ext3 worked without and error!
2.) After installing Debian etch 4.0 on my raq3 with your howto I tried every kernel-pkg from http://hugues.lepesant.com/stuff/cobalt/ and I always got a kernel panic with unable to read super block ): After that I used the 2.6.22.6-cobalt3-tw but again: unable to read super block!
First I reset the cmos (http://www.dincom.co.uk/bq/problems1.php) but this dit not help...
After this a set the boot-option again to hda1 (this was already done before, but it seems, that this settings was "gone" somehow): http://www.dincom.co.uk/bq/lcdboot.php
And now:
cobalt:~$ uname -r
2.6.22.6-cobalt3-tw
:)
So your howto works for Debian 4.0 etch and Cobalt RaQ3 too, I can promise *fg*
Cheers,
Patrick
- Login or register to post comments
»Sat, 09/22/2007 - 7:36pm
AWESOME! I'm glad it worked for you. Unfortunately, your trial & error in getting it all setup is shared by almost every other Cobalt enthusiest trying to install a modern OS onto it. And that's exactly the reason I'm writing these HOWTOs. Ok, I'm lying. I'm writing them so that I can do it the next time it needs to be done. But apparently others are finding them helpful as well. And I'm pleased with that...for sure. So...I'll continue to write them & post them on my site. Thanks for posting your results & your trial/error steps & solutions. They certainly add to the HOWTO & will most definitely help others in setting up their Cobalt.
- Coyote
Living life 32 beats at a time...
- Login or register to post comments
»