Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 46983

Re: Rescue system for use with USB sticks and TFTP

$
0
0
Hi!

I stumbled to this thread after some very serious Googling about "How to UnBrick Dockstar".

Happened so far:

I got this Seagate DockStar from friend, who tried to install Debian into it but failed and was not any more interested to try again - so he gave this little gadget to me. I have no idea what he has done, but it seems that the DS is very dead :-(

I read this forum "from cover to cover" to learn what's going on with the box.

So, I hooked my serial adapter to it and started poking around.

The system:

After power on:
U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
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:  0
u-boot>>

Version:
U-Boot 2011.12 (Feb 12 2012 - 21:33:07)
Seagate FreeAgent DockStar
arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q3-67) 4.4.1
GNU ld (Sourcery G++ Lite 2009q3-67) 2.19.51.20090709

Environment:
u-boot>> printenv
arcNumber=2097
baudrate=115200
bootcmd=usb=start
bootdelay=3
console=ttyS0,115200
ethact=egiga0
ethaddr=00:10:75:1A:DC:0E
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
led_error=orange blinking
led_exit=green off
led_init=green blinking
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
partition=nand0,2
pogo_bootcmd=if fsload uboot-original-mtd0.kwb; then go 0x800200; fi
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
rescue_installed=0
rescue_set_bootargs=setenv bootargs console=$console ubi.mtd=2 root=ubi0:rootfs ro rootfstype=ubifs $mtdparts $rescue_custom_params
stderr=serial
stdin=serial
stdout=serial
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
ubifs_mtd=3
ubifs_set_bootargs=setenv bootargs console=$console ubi.mtd=$ubifs_mtd root=ubi0:rootfs rootfstype=ubifs $mtdparts $ubifs_custom_params
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
usb_bootcmd=run usb_init; run usb_set_bootargs; run usb_boot
usb_device=0:4
usb_init=run usb_scan
usb_root=/dev/sda1
usb_rootdelay=10
usb_rootfstype=ext3
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_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_scan_list=1 2 3 4
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params

Environment size: 2225/131068 bytes

As you can see, after the initial power on the system does not boot in any way, just sit's in the uboot prompt flashing the green led (initializing phase?). I do not know if my friend destroyed the original firmware (done something with the NAND) or has he altered the environment parameters.

Anyway, I then found this forum post about rescue system than can be run from TFTP! Great, as I do have serial connection, TFTP server and all needed files downloaded from the link in the original post.

Let's go:
u-boot>> setenv ipaddr 192.168.1.50
u-boot>> setenv serverip 192.168.1.1
u-boot>> tftp 0x800000 uImage-rescue
Using egiga0 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.50
Filename 'uImage-rescue'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #######################
done
Bytes transferred = 3185944 (309d18 hex)
u-boot>> tftp 0xe00000 uInitrd-rescue
Using egiga0 device
TFTP from server 192.168.1.1; our IP address is 192.168.1.50
Filename 'uInitrd-rescue'.
Load address: 0xe00000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################
done
Bytes transferred = 17417628 (109c59c hex)
u-boot>> setenv bootargs console=$console $mtdparts
u-boot>> setenv arcNumber 2097

So far so good, let's boot:
u-boot>> bootm 0x800000 0xe00000
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-2.6.32.18-dockstar
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3185880 Bytes = 3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 00e00000 ...
   Image Name:   initramfs
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    17417564 Bytes = 16.6 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux.......................................................................................................................................................................................................... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000bb6).

Available machine support:

ID (hex)        NAME
00000690        Marvell DB-88F6281-BP Development Board
00000691        Marvell RD-88F6192-NAS Development Board
00000692        Marvell RD-88F6281 Reference Board
0000078c        Marvell 88F6281 GTW GE Board
00000831        Marvell SheevaPlug Reference Board
0000085b        QNAP TS-119/TS-219
00000915        Marvell OpenRD Base Board

Please check your kernel config and/or bootloader.

Errr... W0T?!

I do have the ID set to "2097" as can be seen in the environment print out.

While trying to understand what went wrong I noticed there are updated files available also for this TFTP rescue, or not "File not foud" when trying to download.

I'm stuck - so, are there newer post somewhere deep inside this forum that I just not haven't found that could help me more? Or is there another way to restore full original DockStar firmware, environment setting, kernel and all nand partition so that I could start over without trying to figure out what the heck has this little gadget done.

Any,I mean A N Y info would be great!

Br: Mac

Viewing all articles
Browse latest Browse all 46983

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>