Welcome! Log In Create A New Profile

Advanced

GoFlex Home: booting the original firmware

Posted by teosoft 
GoFlex Home: booting the original firmware
April 06, 2013 04:06PM
I have installed the new u-boot using Jeff's install_uboot_mtd0.sh in my Seagate GoFlex Home without any problems. I have also installed Debian following davygravy's instructions in http://forum.doozan.com/read.php?2,7806. However I only have a few moments everyday to work in the unit (while is not serving files to the family) and hence, I need to boot the original firmware until my Debian installation is fully configured and working. According to http://projects.doozan.com/uboot/, it can be done by simply unplugging the USB drive and rebooting. But it doesn't work in my case. I plugged a serial cable to the GFH and here is the output:

U-Boot 2011.12 (Apr 18 2012 - 23:08:20)
Seagate GoFlexNet

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  3  2  1  0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
** Block device usb 0 not supported

** Invalid boot device **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI error: validate_ec_hdr: bad VID header offset 2048, expected 512
UBI error: validate_ec_hdr: bad EC header
UBI error: ubi_io_read_ec_hdr: validation failed for PEB 0
UBI error: ubi_init: cannot attach mtd1
UBI error: ubi_init: UBI error: cannot initialize UBI, error -22
UBI init error 22
** Block device usb 0 not supported
** Block device usb 1 not supported
** Block device usb 2 not supported
** Block device usb 3 not supported
** Block device usb 0 not supported
** Block device usb 0 not supported
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS:    done.

find_inode failed for name=uboot-original-mtd0.kwb

load: Failed to find inode

### JFFS2 LOAD ERROR<0> for uboot-original-mtd0.kwb!
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS:

The printenv output is
ethact=egiga0
bootdelay=3
baudrate=115200
mainlineLinux=yes
console=ttyS0,115200
led_init=green blinking
led_exit=green off
led_error=orange blinking
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
mtdids=nand0=orion_nand
partition=nand0,2
stdin=serial
stdout=serial
stderr=serial
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
rescue_bootcmd=if test $rescue_installed -eq 1; then run rescue_set_bootargs; nand read.e 0x800000 0x100000 0x400000; bootm 0x800000; else run pogo_bootcmd; fi
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
force_rescue=0
force_rescue_bootcmd=if test $force_rescue -eq 1 || ext2load usb 0:1 0x1700000 /rescueme 1 || fatload usb 0:1 0x1700000 /rescueme.txt 1; then run rescue_bootcmd; fi
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
ubifs_bootcmd=run ubifs_set_bootargs; if ubi part data && ubifsmount rootfs && ubifsload 0x800000 /boot/uImage && ubifsload 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; fi
usb_scan=usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 && ext2load usb $usb 0x800000 /boot/uImage 1; then usb_scan_done=1; echo "Found bootable drive on usb $usb"; setenv usb_device $usb; setenv usb_root /dev/$dev; fi; done
usb_scan_list=1 2 3 4
usb_scan_1=usb=0:1 dev=sda1
usb_scan_2=usb=1:1 dev=sdb1
usb_scan_3=usb=2:1 dev=sdc1
usb_scan_4=usb=3:1 dev=sdd1
usb_init=run usb_scan
usb_device=0:1
usb_root=/dev/sda1
usb_rootfstype=ext2
usb_rootdelay=10
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_boot=mw 0x800000 0 1; ext2load usb $usb_device 0x800000 /boot/uImage; if ext2load usb $usb_device 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run rescue_bootcmd; run pogo_bootcmd; reset
ethaddr=00:10:75:29:73:32
arcNumber=3338

I was able to boot the original kernel by running the original uboot environment commands:
GoFlexNet> setenv bootargs_root 'ubi.mtd=2,2048 root=ubi0:rootfs rootfstype=ubifs init=/linuxrc'
GoFlexNet> setenv console2 'console=ttyS0,115200'
GoFlexNet> setenv bootcmd 'nand read.e 0x800000 0x100000 0x600000; setenv bootargs $(console2) $(bootargs_root); bootm 0x800000'
GoFlexNet> run bootcmd 

NAND read: device 0 offset 0x100000, size 0x600000
 6291456 bytes read: OK
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-2.6.22.18
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2095148 Bytes = 2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.................................................................................................................................... done, booting the kernel.
but then it hangs. I tried setting all the original environment variables before running those commands without any success.

I can revert to the original uboot but I would like to have a way to boot the original firmware from the updated uboot.

Does you have any idea on what is going wrong?

Thanks and sorry for this long post.
Re: GoFlex Home: booting the original firmware
April 06, 2013 04:47PM
I don't have a detail instruction written up. But the idea is:

- Boot into Debian.

- check the mtd partitions
#fw_printenv mtdparts

- The original uBoot image uboot-original-mtd0.kwb should have been copied to the top directory of rootfs mtd partition (mtd2). So you can mount this while in Debian and make sure the file is there, and not corrupted (looks like this file is there, according to your log, but it's not usable).

- find the original uBoot fle, and copy it to the top directory of this root files system. And then umoun this rootfs.
- shutdown and reboot wihtout the USB stick.

The mount command is something like below. This is only an example, please make sure you find the correct commands before trying.
mount -t jffs2 -o rw /dev/mtdblock2 /mnt
Re: GoFlex Home: booting the original firmware
April 06, 2013 07:48PM
Hi Bodhi, thank you for your answer.

I have tried the solution you proposed but I couldn't mount the nand. The syntax is correct but when I try to mount any of /dev/mtdblock* it results in a long list of errors. For instance:
mount -t jffs2  /dev/mtdblock0 kk
[  465.006916] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x008b instead
[  465.015869] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0xf254 instead
[  465.024798] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c: 0x0200 instead
............
[  467.660724] uncorrectable error : 
[  467.664144] uncorrectable error : 
[  467.667566] mtd->read(0x1ff08 bytes from 0xa00f8) returned ECC error
[  467.674150] sched: RT throttling activated
............
[  467.756648] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0020: 0x6475 instead
[  467.765569] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x000c0024: 0x6574 instead
[  467.774488] Further such events for this erase block will not be printed
[  467.814290] Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[  467.822177] empty_blocks 2, bad_blocks 0, c->nr_blocks 8
I have tried with all them with the same result. cat /proc/mtd returned:
 cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "rootfs"
mtd3: 0db00000 00020000 "data"

I have also tried stupid things as to create a jffs2 filesystem only with the uboot-original-mtd0.kwb file and write it to mtd2 (I made a backup before). When rebooting, I got
...
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS: . done.
### JFFS2 load complete: 524288 bytes loaded to 0x800000
## Starting application at 0x00800200 ...
and a nice blinking red led.

I rewrote the backup of the nand back to mtd2, wrote the original uboot to mt0 and rebooted.
It resulted in an error while reading the nand and I had to flash the original seagate firmware again.

So, I'm again in the same place. Any other idea?

Thanks
Re: GoFlex Home: booting the original firmware
April 06, 2013 08:20PM
Ok. Instead of trying to make the Pogo OS work, you could use Davy's rootfs to run the GoFlex Home temporarily. I don't remmeber it has samba already installed. If not, it should be simple to install it. This could serve as temporary file server for the family until you get your own Debian rootfs set up.
http://forum.doozan.com/read.php?2,7806
Re: GoFlex Home: booting the original firmware
April 07, 2013 09:06AM
OK, I will take that approach. However it is a pity not to be able to make uboot to run the original firmware.


Thank you for your help.
Re: GoFlex Home: booting the original firmware
April 10, 2013 04:35PM
I'm actually facing pretty the same issue as teosoft. I have installed Jeff's uBoot on my Goflex Net and booting debian from USB works fine. But I also do want to use the Pogo OS/original firmware as well (without necessarily having to restore the original uBoot on mtd0). As far as I understand this should be possible based on Jeff's description. Thus I consider that I'm facing a bug!?

My uBoot output looks like this:
U-Boot 2011.12 (Apr 18 2012 - 23:08:20)
Seagate GoFlexNet

SoC:   Kirkwood 88F6281_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  3 ··· 2 ··· 1 ··· 0 
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 1 USB Device(s) found
       scanning bus for storage devices... 0 Storage Device(s) found
** Block device usb 0 not supported

** Invalid boot device **
Creating 1 MTD partitions on "nand0":
0x000002500000-0x000010000000 : "mtd=3"
UBI: attaching mtd1 to ubi0
UBI: physical eraseblock size:   131072 bytes (128 KiB)
UBI: logical eraseblock size:    129024 bytes
UBI: smallest flash I/O unit:    2048
UBI: sub-page size:              512
UBI: VID header offset:          512 (aligned 512)
UBI: data offset:                2048
UBI: attached mtd1 to ubi0
UBI: MTD device name:            "mtd=3"
UBI: MTD device size:            219 MiB
UBI: number of good PEBs:        1751
UBI: number of bad PEBs:         1
UBI: max. allowed volumes:       128
UBI: wear-leveling threshold:    4096
UBI: number of internal volumes: 1
UBI: number of user volumes:     0
UBI: available PEBs:             1730
UBI: total number of reserved PEBs: 21
UBI: number of PEBs reserved for bad PEB handling: 17
UBI: max/mean erase counter: 1/1
UBIFS error (pid 0): ubifs_get_sb: cannot open "ubi:rootfs", error -19
Error reading superblock on volume 'ubi:rootfs'!
** Block device usb 0 not supported
** Block device usb 1 not supported
** Block device usb 2 not supported
** Block device usb 3 not supported
** Block device usb 0 not supported
** Block device usb 0 not supported
Wrong Image Format for bootm command
ERROR: can't get kernel image!
stopping USB..
### JFFS2 loading 'uboot-original-mtd0.kwb' to 0x800000
Scanning JFFS2 FS:   ··.  read_nand_cached: error reading nand off 0x64c800 size 8192 bytes
··.  ··.  ··.  ··.  ··.  ··.  ··.  read_nand_cached: error reading nand off 0x20dee00 size 8192 bytes
read_nand_cached: error reading nand off 0x20e0e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20e2e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20e4e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20e6e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20e8e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20eae00 size 8192 bytes
read_nand_cached: error reading nand off 0x20ece00 size 8192 bytes
read_nand_cached: error reading nand off 0x20eee00 size 8192 bytes
read_nand_cached: error reading nand off 0x20f0e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20f2e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20f4e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20f6e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20f8e00 size 8192 bytes
read_nand_cached: error reading nand off 0x20fae00 size 8192 bytes
read_nand_cached: error reading nand off 0x20fce00 size 8192 bytes
read_nand_cached: error reading nand off 0x20fee00 size 8192 bytes
·· done.

read_nand_cached: error reading nand off 0x64c000 size 8192 bytes
off = 0x64bd44 magic 0x1985 type 0xe002 node.totlen = 2537
### JFFS2 load complete: 524288 bytes loaded to 0x800000
## Starting application at 0x00800200 ...

And it will just hang at the last "Starting application…" prompt

Any ideas?
Re: GoFlex Home: booting the original firmware
April 10, 2013 04:42PM
worldchamp Wrote:
-------------------------------------------------------
> And it will just hang at the last "Starting
> application…" prompt
>
> Any ideas?

I have also mounted the JFFS2 mtdblock2 via my debian installation. I have copied away uboot-original-mtd0.kwb file from the root directory and have done a file compare with a version downloaded from the inet, which turned out to be identical. So even though I face "error reading nand", I assume the uBoot should be intact and loaded correctly.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: