Revision as of 00:28, 5 February 2012 by Craig Peacock (Talk | contribs)


Prerequisites

ARM Cross Compiler

To compile the linux kernel for the GoFlex Home, you must have an ARM cross compiler installed. I use the CodeSourcery G++ Lite 2011.03-42 for ARM EABI. It is assumed the cross compiler has been added to your path.

uBoot mkimage

The bootloader used on the GoFlex Home is u-boot. u-boot has a special image format called uImage. It includes parameters such as descriptions, the machine/architecture type, compression type, load address, checksums etc. To make these images, you need to have a mkimage tool that comes part of the u-Boot distribution. Download u-boot, make and install the u-boot tools:

wget ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2
tar -xjf u-boot-latest.tar.bz2
cd into u-boot directory
make tools
sudo install tools/mkimage /usr/local/bin

Building the GoFlex Home Kernel

The mainline kernel is yet to include hardware options for the GoFlex Home. However the developers over at Arch Linux Arm have this sorted with a patch.

Download the linux kernel and patch:

# wget https://raw.github.com/archlinuxarm/PKGBUILDs/master/core/linux/archlinuxarm.patch
# wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.1.10.tar.bz2
# tar -xjf linux-3.1.10.tar.bz2
# cd linux-3.1.10
# patch -p1 < ../archlinuxarm.patch
patching file arch/arm/mach-kirkwood/dockstar-setup.c
patching file arch/arm/mach-kirkwood/goflexhome-setup.c
patching file arch/arm/mach-kirkwood/goflexnet-setup.c
patching file arch/arm/mach-kirkwood/guruplug-setup.c
patching file arch/arm/mach-kirkwood/iconnect-setup.c
patching file arch/arm/mach-kirkwood/Kconfig
patching file arch/arm/mach-kirkwood/Makefile
patching file arch/arm/mach-kirkwood/mpp.h
patching file arch/arm/mach-kirkwood/pogoplugv4-setup.c
patching file arch/arm/mach-kirkwood/sheevaplug-setup.c
patching file arch/arm/tools/mach-types

Make and run the configuration menu:

# make ARCH=arm kirkwood_defconfig
# make ARCH=arm menuconfig

Enable the following Options:

System Type -> Marvell Kirkwood Implementations --> Seagate GoFlex Home

Device Drivers --> Memory Technology Devices (MTD) --> Enable UBI - Unsorted Block Images
File Systems --> Miscellaneous Filesystems --> UBIFS file system support
File Systems --> Miscellaneous Filesystems --> LZO compression support
File Systems --> Miscellaneous Filesystems --> ZLIB compression support

File Systems --> DOS/FAT/NT Filesystems --> NTFS file system support
File Systems --> DOS/FAT/NT Filesystems --> NTFS write support

File Systems --> The Extended 4 (ext4) filesystem

Device Drivers --> Block Devices --> RAM block device support (reflashing)

set CONFIG_BLK_DEV_INITRD in .config

and make the kernel:

# make ARCH=arm CROSS_COMPILE=arm-none-eabi- uImage

My Seagate GoFlex Home expects a machine ID of 527. However the kernel sources currently have the machine ID for the GoFlex Home as 3338.

Edit include/generated/mach-types.h and change :

#define MACH_TYPE_GOFLEXHOME           3338

to

 
#define MACH_TYPE_GOFLEXHOME           527

and rebuild.

Now build the modules and install them to a suitable path:

make ARCH=arm CROSS_COMPILE=arm-none-eabi- modules
make ARCH=arm CROSS_COMPILE=arm-none-eabi INSTALL_MOD_PATH=/home/cpeacock/export/rootfs-f12 modules_install