Xebian-1.1.4-Kernel-2.6-Upgrade

From Xbox-Linux

Table of contents [hide]

Xebian-1.1.4 Kernel 2.6 Upgrade Walkthrough

This has been tested, but due to the extreme complexity of the process, we can't ensure you that every step was correctly written down. Please read up on this first as it is not an easy job. I read the following pages:

[1] (http://www.freeos.com/articles/2589/)

As I got many requests for the pre-compiled 2.6 Kernel packages i made a new site for this to download. You can always get the latest stable 2.6.x Kernel from the Website XBOX CORESEC DEVCENTER (http://xbox.coresec.de). Its part of the CoreSec Security Network. You just need to download and "dpkg -i (filename)" the kernel and voila you are 2.6 ready.

This guide will make the following assumptions

  1. Xbox has already been modded.
  2. Installed Xebian-1.1.4.
  3. Base Xebian functions
  4. Network access
  5. Rescue CD to boot

You will need the following

Kernel Sources

To get the latest Debian source type in the following on the command line:

apt-get install kernel-source-2.6

It will probably say that it is getting a more recent version. Mine got version 2.6.16, which is the version we will be using in this tutorial. Please note that this is probably not the latest kernel, but the latest kernel that has been patched for Debian.

This will download the source into /usr/src/kernel-source-2.6.8
If apt-get isn't working for you, you can download the kernel at http://www.kernel.org/

Create a symlink to your linux source directory with the following command:

ln -s kernel-source-2.6.8/ /usr/src/linux

Applying the Patch

cd to /usr/src/linux and get the latest xebian patch file for the source you have downloaded. (There is a better way of getting this out of cvs but I'm not sure of the command)

wget http://kent.dl.sourceforge.net/sourceforge/xbox-linux/linux-2.6.8-xbox.patch.gz

be sure that the patch you download matches the version of the source you just installed.


Type in the following:

patch -p1 < linux-2.6.8-xbox.patch

Configuring for FATX

As yet I have not found a completely automated patch that can use FATX so we will have to do some custom tweaking:

cd /usr/src/linux
cvs -d:pserver:anonymous@xbox-linux.cvs.sourceforge.net:/cvsroot/xbox-linux login
cvs -z3 -d:pserver:anonymous@xbox-linux.cvs.sourceforge.net:/cvsroot/xbox-linux co -P kernel-2.6/arch/i386/configs/xbox_defconfig
mv kernel-2.6/arch arch && rm -R kernel-2.6
cp arch/i386/configs/xbox_defconfig .config
vi fs/Kconfig

Under the section "config FATX_FS", change "depends on EXPERIMENTAL && BROKEN && !LBD" to "depends on EXPERIMENTAL && !LBD". This is because the 'broken' configuration option is no longer available in many newer version (tested in 2.6.16)

--

Add the following options to the kernel (make menuconfig)

  1. loop
  2. Wireless Extensions (You'll thank me for that! the reason why I upgraded...)
  3. Hotplug Support (Needed for udev)

Can someone please specify the path to each of these option in menuconfig? I couldn't find them!

--

Building de kernel

for a non-xebian install

Type in the following

cd /usr/src/linux/
make clean
make
make modules
make modules_install

xebian

under xebian you should use the kernal package helper:

apt-get update
apt-get install kernel-package coreutils
cd /usr/src/linux/
make-kpkg kernel-image
cd ../
dpkg -i linux-image.X.X.XX-.deb

(Note: On my system, I had to: dpkg -i kernel-image.2.6.8-xxxxxxxx.deb)


OK, now you should have a file called bzImage in the directory

/usr/src/linux/arch/i386/boot

if you have used the xebian method, it will have installed the image to the /boot directory with the kernel version appended to the end of the name.

This is your new kernel image file. So before we do anything else, lets test it. Type in

vi /boot/linuxboot.cfg

(if your xbox is softmodded, you'll edit the file E:\debian\linuxboot.cfg instead)

This is the file that determines which kernel to boot from. You want to add another option. Mine looks a bit like this:

title v2_6
kernel /boot/vmlinuz
append root=/dev/ide/host0/bus0/target0/lun0/part2 devfs=mount kbd-reset xbox=hdd
xboxfb y

title v2_4
kernel /boot/vmlinuz-2.4.31-xbox
append root=/dev/ide/host0/bus0/target0/lun0/part2 devfs=mount kbd-reset xbox=hdd
xboxfb y

default v2_6

XBOX IS SOFTMODDED ON F:

copy bzImage (or vmlinuz-2.6.XXXX if debian method was used) to the folder on E containing default.xbe

edit linuxboot.cfg on E in your default.xde folder to look like this instead:

kernel bzImage                                               (or vmlinuz-2.6.XXXX)
append root=/dev/hda2 initrd=initrd kbd-reset xbox=hdd
xboxfb y

So you see I have a 2.4 kernel and a 2.6 kernel.

Add an entry to point to /usr/src/linux/arch/i386/boot/bzImage (or /boot/vmlinuz-2.6.XXXX if xebian method was used), but do not make it the default.

Save and quit vim and then reboot your machine. At the Cromwell BIOS prompt, select the entry you just added.

If all goes well your xbox should now boot into your new kernel. If not you're on your own! ;-)

Make the change a little more permanent

normal method (non xebian)

Go back to your /usr/src/linux/ directory and type (See below for xebian make-kpkg install):

make install

When prompted answer no to creating a boot disk.

This will copy your kernel image file into /boot/ and update your vmlinuz symlink file to point to your new kernel. You can now change your linuxboot.config file to point at the new location similar to my file above. If you have a native install you are now complete.

xebian kernel-package method

Under xebian if you have used the kernel-package you should do the following to make it permanent:

rm /boot/System.map
rm /boot/vmlinuz
ln -s /boot/System.map-2.6.XXXX /boot/System.map
ln -s /boot/vmlinuz-2.6.XXXX /boot/vmlinuz

Replacing the "XXXX" with the kernel version

Modules

I found that when I booted up after my upgrade to 2.6 that some of the modules would not load. I am not entirely sure why some of them wouldn't load as I definately compiled them. The keyboard and mouse modules have changed names between 2.4 and 2.6. In 2.4 they were called mousedev and keybdev but now are called usbmouse and usbkbd.

To change the name, edit the file /etc/modules.xbox to rename them. If you still want to use 2.4 as an option, just add usbmouse and usbkbd under mousedev and keybdev, unknown modules are just ignored. If you're only using 2.6, you can comment out any modules you don't need anymore.

Creating an INITRD

mkdir /mnt/initrd
mount -o loop -t cramfs /boot/initrd-2.4.xxx /mnt/initrd
mkdir /mnt/initrd.new
cd /mnt/initrd
find . -depth | cpio --create > /tmp/initrd.cpio
cd /mnt/initrd.new
cpio --extract --make-directories < /tmp/initrd.cpio
populate some additional devices in /dev
  1. mknod -m 600 /mnt/initrd.new/dev/console c 5 1
  2. /dev/loop0
  3. /sysfs
mkcramfs /mnt/new-initrd /boot/initrd-2.6.xxx
I think that should be:> mkcramfs /mnt/initrd.new /boot/initrd-2.6.xxx

Prepare system for bootup (softmoded)

  1. copy the kernel and initrd to the appropriate places (backup the good ones)
    1. cp /boot/vmlinuz-xxx /mnt/E/debian/vmlinuz
    2. cp /boot/initrd-xxx /mnt/E/debian/initrd

Finishing Touches

Troubleshooting

If you try to patch the 2.6.17 kernel with the 2.6.16 kernel patch, one chunk fails in "arch/i386/pci/direct.c"

#include <linux/pci.h>
#include <linux/init.h>
#include "mach_pci_blacklist.h"
#include "pci.h"

To fix this, manually edit the file "arch/i386/pci/direct.c" and add the line:

#include "mach_pci_blacklist.h"

to the file, I have compiled and tested the new kernel and it seems to be all good so far.

References