Writing /home/mute/www/wiki.scottn.us/data/cache/7/7065f916e5fe83dea44f70777937a3f5.metadata failed
Table of Contents
Seagate GoFlex Home Hacks // Debian
Lots of people working on this. But the information is scattered, and I've not seen the point to some of it… Guess if you want something done right, you have to do it yourself? ;)
I started this 4/23 so this is a work-in-progress, aka a severely disorganized page. Wiki clean-up usually happens after I put the device back together, and that could take awhile since my free time is limited.
[edit: 8/1] I guess it'll be some time. This project was short lived. I got debian on it and then it's done. ha. been running fine just another computer on the network now…
someone with dockstar-like device (bootrom 1.11) asked for my dump to compare and see why they cannot boot from serial as we can. my results:
external serial port
first thing you'll want is serial console access to the device. i soldered my Nokia cable onto the board almost directly after opening the device, but then i had to put it back together before the kids came home for the weekend. what can carry 3-wire serial and be small? RadioShack catalog #274-0245 is 3-conductor stereo submini audio jack, and #274-244 is submini phone plug (3/32“). Visit here for the pics: Serial port install.
only thing missing is our arch type in the kernel. let's start with debian stable kernel sources and rebuild with goflex patch. http://packages.debian.org/squeeze/linux-source-2.6.32
it says it includes the debian patches, but it comes up as normal 2.6.32… meh. I added a bit also to arch/arm/kernel/head-common.S so that we need not pass arcNumber. This would help later for making installable without editing bootloader. :P It seemed that although the Goflex Home has USB/IDE enabled in U-Boot, the arcNumber variable is not. This was partially verified later by a grep of the u-boot sources supplied in GPL release by Seagate.
We can start serial commands at u-boot to load USB key with my kernel+initrd. For example:
usb start;ext2load usb 0:1 $(loadaddr) /boot/uImage;set bootargs console=ttyS0,115200 root=UUID=93f87267-e952-437c-a87a-76712671784f;bootm $(loadaddr)
Here is full clean boot. debianboot
Creation of the USB key or even ext2 partition on the SATA can be easy with debootstrap. I will attempt emdebian's soon to see if it's dependencies are a bit less a tangled web of bloat. ;) [edit nah I probably won't. Debian's running well, just follow this guide to ensure dumb things like X11 libraries getting installed with openssh doesn't happen.]
You can download debootstrap .deb from whatever Linux you are booted hopefully, and extract it with “ar x debootstrap.deb” and you find data.tar.gz which you can extract to current directory. It is much easier to go ahead to do the entirety of it on the native machine if you can, verus doing a two stage.. but I've done both with success. cdebootstrap is even better. “apt-get cdebootstrap” in Ubuntu or Debian and insert and ext2 format a USB key.
cdebootstrap --foreign --arch armel --include=linux-image-2.6-kirkwood squeeze /mnt http://ftp.debian.org/debian/
including kirkwood image ensures you get all the modules and initramfs things, you can use my uMulti to do actual booting.
i built this too as backup. the tiny rootfs lives in my ext2 /boot partition for now. maybe will flash to NAND some time. i also mirrored snapshot of trunk packages for the day, in case libraries change or whatever. even placed a jfs.ko there to access the jfs share if i need to. i didn't make it a kmod opkg, sorry. ;\
consistent nand map between kernels
first set the two mtdids/mtdparts variables, then you can use mtdparts add. for example:
set mtdids nand0=orion_nand set mtdparts mtdparts=orion_nand:1M(uboot)ro mtdparts add nand0 6M uImage mtdparts add nand0 - rootfs
That is my nand's layout inside factory firmware. You'll also need to mention $(mtdparts) inside bootargs.
Then I was hoping that using mtdparts del nand0,0 and removing the uboot partition would suffice on making normal kernels ignore the 4-bit ECC and printing a screen-full of bad block messages upon boot. :\
mods to official firmware
Just captured this: bootlog
U-Boot seems to already support USB and IDE booting… I dunno why people are flashing these things? FAT and EXT2…
I'm going to try using this:
Looking to match their toolchain. I'm not sure why it's not included in the GPL tarball. I need gcc 4.3.2 and glibc2.5 and hopefully the rest works OK… ;)
Working on JFS module… http://scottn.us/downloads/GoFlex-JFS.tar.gz
Module and utilities work. Will need to analysis start-up scripts to see how to make it continue to function correctly. /usr/lib/spd/scripts/usb/usbToolbox.php seems to be a good start.
Some tinkering with scripts and still no normal success… It did somewhat begin to work.
external boot without uboot replacement
really don't want to have to JTAG this. i'm scurred. took about 30min to do 64kB on my router. would probably take all day to do 512kB on this..
This is example only. Probably you want to change it some. This example uses FAT on partition 1, and sets root to be partition 2. You maybe want ext2 on 1 partition. Replace 'fatload' with 'ext2load' and '-part2' with '-part1' .. just throwing ideas out there.. I use this for mine though.
usb_start=usb start; fatload usb 0:1 $(loadaddr) /uImage usb_boot=echo usb success; set bootargs $(console) root=/dev/disk/by-path/platform-orion-ehci.0-usb-0:1:1.0-scsi-0:0:0:0-part2; bootm $(loadaddr) ide_start=set filesize; ide reset; ext2load ide 0:1 $(loadaddr) /uImage ide_if_loaded=print filesize ide_boot=echo ide success;set bootargs $(console) root=/dev/disk/by-path/platform-sata_mv.0-scsi-0:0:0:0-part2;bootm $(loadaddr) boot_nand=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000 bootcmd=run usb_start usb_boot; run ide_start; run ide_if_loaded ide_boot; run boot_nand
NOTE I noticed last night that 'ext2load' return value is broken in 1.1.4. The way 'run' works is you only run the next variable if the previous one returns success, which is represented by 0. In Marvell's GPL source, ext2load returns 'filelen' so basically ext2load always returns failure. Didn't see a problem yet with fatload so didn't check. I use 'filesize' as test variable now.
cross compiling toolchain
Ubuntu already has: apt-get install gcc-arm-linux-gnueabi
Very handy if you're using x86_64 and want to get your hands dirty right away without compiling a compiler 2-3 times. :P
you never need a JTAG. since this device can boot from UART. You have to first activate the BootROM's XMODEM receive by sending a special string (0xBB11223344556677). Then, it will begin sending XMODEM packets (NAK, ASCII 0x15). Obviously that string has to be sent over and over before you press the power button, since you only have a few milliseconds (or microseconds? heh).
So I edited picocom to make this super easy in Linux. http://goflex.scottn.us/picocom-debug.tar.gz and you begin by pressing CTRL+A CTRL+E. It asks for filename, sends the DEBUG string for about 5 seconds, then sends the file.
Oh you'll also need http://goflex.scottn.us/uboot.uart since the header is changed. It specifies UART boot vs NAND boot. This is the GoFlex Net original U-boot.
As you see from this log, the header must be changed to boot from serial: uartboot.