If you bought a (black) eSATA Sheevaplug, the regular ex-factory version has eSATA functionality (and kernel version 2.6.22.18). However, most of the information available regarding compiling newer kernels is for the white Sheevaplug and there is no need for eSATA capability for the white plugs.
Here's one way of compiling an eSATA capable kernel for a black eSATA Sheevaplug. What you will end up with is a kernel that is the equivalent of those available at
sheeva.with-linux.com, but with added eSATA capability. (and in this case, kernel version 2.6.32.8 ).
This procedure describes cross-compiling on a 32 bit intel (or compatible) processor.
The cross-compiler that was (?) available on CD version 1.2 is no longer, so we will download all the necessary components for compiling.
We follow the procedure outlined on the
Plug Computer wikiRequired software* Install the
CodeSourcery cross-compiler* Install mkimage (under Ubuntu, you can select package
uboot-mkimage)
SourceCreate a directory for the kernel sources:
mkdir ~/kernel/source
cd ~/kernel/source
* Download kernel sources
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.32.8.tar.bz2
* Decompress:
tar xvjf linux-2.6.32.8.tar.bz2
* Change into the newly created directory:
cd linux-2.6.32.8
* Download patches from
http://sheeva.with-linux.com/sheeva/ (also available at
http://www.newit.co.uk/kernels/eSATA/2.6.32.7/patches/)
wget http://sheeva.with-linux.com/sheeva/2.6.32.8/patches/linux-2.6.29-usb-serial-evdo.patch
wget http://sheeva.with-linux.com/sheeva/2.6.32.8/patches/mvsdio-1-2.6.30.patch
wget http://sheeva.with-linux.com/sheeva/2.6.32.8/patches/mvsdio-2.patch
wget http://sheeva.with-linux.com/sheeva/2.6.32.8/patches/UdlFb-0.2.3-2.6.30.2.patch
* Apply patches:
patch -p0 < linux-2.6.29-usb-serial-evdo.patch
Output:
patching file ./drivers/usb/serial/usb-serial.c
Hunk #1 succeeded at 61 (offset 2 lines).
Hunk #2 succeeded at 946 (offset 102 lines).
Hunk #3 succeeded at 976 with fuzz 2 (offset 106 lines).
Hunk #4 succeeded at 1004 (offset 106 lines).
Hunk #5 succeeded at 1037 (offset 106 lines).
Hunk #6 succeeded at 1397 (offset 117 lines).
patch -p0 < mvsdio-1-2.6.30.patch
Output:
patching file ./drivers/mmc/core/core.c
patching file ./drivers/mmc/host/mvsdio.c
patch -p0 < mvsdio-2.patch
Output:
can't find file to patch at input line 19
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From: Nicolas Pitre <nico@cam.org>
|Date: Tue, 28 Apr 2009 02:38:12 +0000 (-0400)
|Subject: [MMC] give Sandisk/Kingston SDHC cards some slack before the SWITCH command
|X-Git-Url: http://git.marvell.com/?p=orion.git;a=commitdiff_plain;h=3ea638523747f6d312f11f643a3175c1a4661eec;hp=c0c3df02efed0e5dea9aa4d8313e06e1f68f2cb4
|
|[MMC] give Sandisk/Kingston SDHC cards some slack before the SWITCH command
|
|Without this delay, those cards simply won't work in high speed mode
|as the SWITCH command does not succeeds.
|
|Signed-off-by: Nicolas Pitre <nico@marvell.com>
|Tested-by: Martin Michlmayr <tbm@cyrius.com>
|---
|
|diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
|index cd81c39..ba4c7ab 100644
|--- a/drivers/mmc/core/sd.c
|+++ b/drivers/mmc/core/sd.c
--------------------------
File to patch:
(and CTRL-C to exit, or specify the path to the target file, e.g.
/mnt/shared/data/new-it/kernels/source/linux-2.6.32.8/drivers/mmc/core/sd.c)
In this case, the format of the patch file is a little different, another way to fix this is to amend the following 2 lines:
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
Change to:
--- ./drivers/mmc/core/sd.c.original
+++ ./drivers/mmc/core/sd.c
Now try again:
patch -p0 < mvsdio-2.patch
Output:
patching file ./drivers/mmc/core/sd.c
patch -p0 < UdlFb-0.2.3-2.6.30.2.patch
Output:
patching file ./drivers/video/Kconfig
Hunk #1 succeeded at 2082 (offset 8 lines).
patching file ./drivers/video/Makefile
Hunk #1 succeeded at 126 with fuzz 2 (offset 2 lines).
patching file ./drivers/video/udlfb/Makefile
patching file ./drivers/video/udlfb/udlfb.c
patching file ./drivers/video/udlfb/udlfb.h
The final patch is to enable eSATA and we have a new file for this, to replace linux-2.6.32.8/arch/arm/mach-kirkwood/sheevaplug-setup.c The new version was uploaded on the plugcomputer forum and we provide it here for you also:
http://www.newit.co.uk/kernels/eSATA/2.6.32.7/patches/sheevaplug-setup.c.modified. We should probably create a .patch file that can be used per the above .patch files ...
Compilation:In the following commands, -j2 specifies 2 processors in the host PC. Change this to -j4 if appropriate (or omit the parameter if your host processor is single-core).
Kversion=2.6.32.8
make clean
make ARCH=arm kirkwood_defconfig
make ARCH=arm menuconfig
(At this point you could choose the sheeva-2.6.32.8.config configuration file,
downloaded from sheeva.with-linux.com). Alternatively, choose your own compilation settings. You may also be prompted to install a package for
libncurses or similar.
make -j2 ARCH=arm CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi- uImage
uImage may be found in linux-${Kversion}/arch/arm/boot
make -j2 ARCH=arm CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi- modules
Install the modules to a temporary directory (in this example, ".." implies the container of the current directory):
make -j2 ARCH=arm CROSS_COMPILE=~/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-eabi- INSTALL_MOD_PATH=.. modules_install
InstallationThe
sheeva.with-linux.com installation script uses a web server, but is easily modified to copy files from a USB stick. So the next steps are to copy our compiled kernel and modules to a USB stick:
To compress the modules:
cd ..
sudo tar czf modules.tar.gz ./lib/modules/${Kversion}/*
cp modules.tar.gz /mnt/target/${Kversion}/sheeva-${Kversion}-Modules.tar.gz
cp linux-${Kversion}/arch/arm/boot/uImage /mnt/target/${Kversion}/sheeva-${Kversion}-uImage
cd /mnt/target/${Kversion}/
md5sum sheeva-${Kversion}-uImage > sheeva-${Kversion}-uImage.md5
md5sum sheeva-${Kversion}-Modules.tar.gz > sheeva-${Kversion}-Modules.tar.gz.md5
We use a modified version of the
sheeva.with-linux.com installation script, a modified version is attached to this forum post. (modified because we don't have a 2.6.32.8 version yet, only 2.6.32.7, and also to remove some code that provided a download from webserver option. There's some scrappy / unfinished code in there, but the basic functionality of the original is retained; the
NandKernel and
ExtractModules functions are the bits that matter.
Now mount your USB stick in your black eSATA Sheevaplug:
mount /dev/sda1 /mnt
/mnt/kernel-upgrade-to-2.6.32.8-forum-version.sh --target nand
Upon reboot, you should be running your new kernel.
See also:
http://plugcomputer.org/plugforum/index.php?topic=434.30