(First Version)
(Updated for new kernel, device tree support and cross compiler)
Line 5: Line 5:
 
=== ARM Cross Compiler ===
 
=== ARM Cross Compiler ===
  
To compile the linux kernel for the GoFlex Home, you must have an ARM cross compiler installed. I use the [http://www.codesourcery.com/sgpp/lite/arm/portal/release1802 CodeSourcery G++ Lite 2011.03-42 for ARM EABI]. It is assumed the cross compiler has been added to your path.
+
To compile the Linux kernel for the GuruPlug, you must first have an ARM cross compiler installed. I use gcc-4.7-arm-linux-gnueabi-base that comes with Ubuntu 13.04. To install the compiler run:
  
=== uBoot mkimage ===
+
<PRE>
 +
sudo apt-get install gcc-arm-linux-gnueabi
 +
</PRE>
 +
 
 +
=== U-Boot mkimage ===
  
The bootloader used on the GoFlex Home is [http://www.denx.de/wiki/U-Boot 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:
+
The bootloader used on the GoFlex Home is [http://www.denx.de/wiki/U-Boot 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:
  
 
<PRE>
 
<PRE>
Line 20: Line 24:
  
 
== Building the GoFlex Home Kernel ==
 
== Building the GoFlex Home Kernel ==
 
The mainline kernel is yet to include hardware options for the GoFlex Home. However the developers over at [http://archlinuxarm.org/platforms/armv5/seagate-goflex-home Arch Linux Arm] have this sorted with a patch.
 
 
Download the linux kernel and patch:
 
  
 
<PRE>
 
<PRE>
# wget https://raw.github.com/archlinuxarm/PKGBUILDs/master/core/linux/archlinuxarm.patch
+
# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.tar.xz
# wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.1.10.tar.bz2
+
# tar -xJf linux-3.14.tar.xz
# tar -xjf linux-3.1.10.tar.bz2
+
# cd linux-3.14
# 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
+
 
</PRE>
 
</PRE>
  
Line 51: Line 38:
 
</PRE>
 
</PRE>
  
Enable the following Options:
+
Customise your kernel. I enable the following:
 
<PRE>
 
<PRE>
 
System Type -> Marvell Kirkwood Implementations --> Seagate GoFlex Home
 
System Type -> Marvell Kirkwood Implementations --> Seagate GoFlex Home
Line 70: Line 57:
 
</PRE>
 
</PRE>
  
and make the kernel:
+
Once you have finished configuring your kernel, save the config. Then build it:  
  
 
<PRE>
 
<PRE>
# make ARCH=arm CROSS_COMPILE=arm-none-eabi- uImage
+
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs -j4
 
</PRE>
 
</PRE>
  
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.
+
Now build the modules and install them to a suitable path:
 
+
Edit include/generated/mach-types.h and change :
+
  
 
<PRE>
 
<PRE>
#define MACH_TYPE_GOFLEXHOME          3338
+
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules
</PRE>
+
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/home/cpeacock/export/rootfs modules_install
to
+
<PRE>
+
#define MACH_TYPE_GOFLEXHOME          527
+
 
</PRE>
 
</PRE>
  
and rebuild.
+
== Testing ==
  
Now build the modules and install them to a suitable path:
+
To support your newer Linux Kernel with Device Tree Support, you must have an up-to-date u-Boot bootloader with Device Tree Support installed on your GuruPlug.
  
<PRE>
+
Please see [[Seagate_GoFlexHome_Upgrading_uBoot|Upgrading uBoot with Device Tree Support for the Seagate GoFlex Home]]
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
+
</PRE>
+

Revision as of 09:09, 14 April 2014


Prerequisites

ARM Cross Compiler

To compile the Linux kernel for the GuruPlug, you must first have an ARM cross compiler installed. I use gcc-4.7-arm-linux-gnueabi-base that comes with Ubuntu 13.04. To install the compiler run:

sudo apt-get install gcc-arm-linux-gnueabi

U-Boot 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

# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.tar.xz
# tar -xJf linux-3.14.tar.xz
# cd linux-3.14

Make and run the configuration menu:

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

Customise your kernel. I enable the following:

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

Once you have finished configuring your kernel, save the config. Then build it:

# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs -j4

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

# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=/home/cpeacock/export/rootfs modules_install

Testing

To support your newer Linux Kernel with Device Tree Support, you must have an up-to-date u-Boot bootloader with Device Tree Support installed on your GuruPlug.

Please see Upgrading uBoot with Device Tree Support for the Seagate GoFlex Home