Dockstar salvage
May 23, 2020 08:24AM
Hello,
I recently found an old Seagate Dockstar which I would like to re-use as a network backup & monitoring server (since it is such a neat compact low-power unit), and would appreciate your advice on how feasible it would be to get it loaded with Debian or similar, given its current behaviour, outlined below :-

I bought the unit new about 10 years ago, registered it on pogoplug.com, and used it for about 6 months or so. Since then it has been sitting unused in a cupboard.
When it powers on, the LED flashes green for 10 seconds, then flashes amber indefinitely , which I understand means it failed to boot.

I connected it to my home network to see if it got an IP address from my broadband router, but it didn't appear to : an nmap -sP of my 192.168.10.0/24 showed no new hosts.

Then I read online that it was a good idea to prevent the dockstar from 'phoning home' to prevent firmware updates .. woops, too late..!

I made a wee cable to connect my raspberry Pi GPIO UART pins to the Dockstar's serial pins, and used 'screen /dev/serial0 115200' to see if there was any serial output when booting the Dockstar, but see none. I tried swapping the TX and RX connections in case I got that wrong, but still no output visible when booting.

Next I tried to snoop the network to see if there was any evidence of the Dockstar trying to do DHCP : I connected it directly to an isolated raspberry Pi which is running a DHCP server (dnsmasq) on its wired LAN interface. I could see a flurry of packets when the Dockstar was switched on , which looked promising: ICMP6 neighbour solicitations, multicast DNS and even a few BOOTP/DHCP Request packets. -see attached

However on closer inspection these packets all had a source MAC address of the rasp Pi: there appeared to be no other MAC address sending out packets.
So probably the packets were just a by-product of the Pi's LAN interface coming up when the Dockstar is powered on and the link-level connectivity comes up..
Incidentally the amber LED on the Pi's LAN interface flashes during boot of the Dockstar, then stays on solid. The green LED on the Pi's LAN stays off - I understand this is normal for a Pi 3B+ and shows it has made a gigabit link rather than 10/100M.

So my questions for you experts are:
1. From the above info, are you able to judge whether the unit might still be hackable, or is likely dead ?
2. does the fact that it has 'phoned home' in the past mean that it may now have a more bullet-proof firmware on it which intentionally disables serial output & SSH etc?
3. would my only option now be to get hold of a JTAG board/kit and see if I can try to re-enable serial output / re-flash it ?

I have not used JTAG before - it sounds interesting and could be a good lockdown project. However the £30 or so I spend on JTAG kit might be better spent on purchasing a new mini ARM device .. I do like the Dockstar's design though and reluctant to throw it away unless it is really dead .!

Thanks for your patience for the lengthy newbie post
Rob
Attachments:
open | download - dockstar-boot-tcpdump-detailed-23may.txt (14.9 KB)
Re: Dockstar salvage
May 23, 2020 09:10AM
1 Dockstar is good. No need jtag since the led still flashes. If there is no led activity at all, then jtag MIGHT help.

2 Your serial connection might be wrong. Pi3b used hardware Uart for Bluetooth. Disable Bluetooth to use the Uart. Also, enable Uart in raspi-config but do not output a console to Uart. Fix the Uart you will get something from Dockstar.

3 once you get the booting info from Dockstar, you can go further.
Re: Dockstar salvage
May 23, 2020 02:06PM
Thanks for the prompt reply David. Glad to hear my dockstar is almost certainly good - that has made my day !

I omitted to mention in my original post that I already had my doubts about the Pi serial port setup when I saw no output from the Dockstar ( especially since the Pi has a LCD display HAT ('Displayotron') on top of it which offers up the UART pins as pass-through ) , so to test it was working OK I had connected the TX RX & GND to an Arduino nano board - via a couple of resistors to step down the voltage - and wrote a small sketch to write 'Hello world' to the Arduino serial port every 2 seconds. ( I had previously used raspiconfig to enable the UART & disable the console getty )
When I then ran 'screen /dev/serial0 115200' on the Pi I was able to see Hello world appearing every 2 sec.
So I think the raspi end of the serial comms is OK.

I will double check my homemade cable , may try swapping the TX & RX again and swearing at it a bit
Re: Dockstar salvage
May 23, 2020 03:37PM
yippee, I now have serial comms ! My homemade cable wasn't connecting well to the GND pin on the Dockstar . Thanks for the pointer David

So I now see the boot process : a Bad Data CRC error when it tries to boot the kernel - see full details further down..

From some research it looks like I now need to :
1. Restore the original kernel :
Set up a tftp server, Download uboot.mtd0.dockstar.original.kwb and tftp it to 0x800000
// Erase just enough of NAND to replace uBoot
nand erase 0x0 0x80000
// Write uBoot from RAM to NAND
nand write.e 0x800000 0x0 0x80000
Reboot
2. Make sure I can SSH in as root/stxadmin , then follow homepage Tutorial to format a USB stick, install Debian & optional Netconsole etc

- is that correct ?

U-Boot 1.1.4 (Jul 16 2009 - 21:02:16) Cloud Engines (3.4.16)

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 00690D60

Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000   size 128MB
DRAM Total size 128MB  16bit width
Flash:  0 kB
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
NAND:256 MB

CPU : Marvell Feroceon (Rev 1)
CLOUD ENGINES BOARD: REDSTONE:1.0

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net:   egiga0 [PRIME], egiga1
Hit any key to stop autoboot:  0
 

NAND read: device 0 offset 0x100000, size 0x300000

Reading data from 0x3ff800 -- 100% complete.
 3145728 bytes read: OK
## Booting image at 00800000 ...
   Image Name:   Linux-2.6.22.18
   Created:      2009-08-31  23:31:05 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1976384 Bytes =  1.9 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... Bad Data CRC
CE>>

CE>> setenv ipaddr 169.254.120.6
CE>> setenv netmask 255.255.0.0
CE>> setenv serverip 169.254.120.1
CE>> ping 169.254.120.3
Using egiga0 device
ping failed; host 169.254.120.3 is not alive
CE>>  ping $(serverip)
Using egiga0 device
host 169.254.120.1 is alive
CE>>

Re: Dockstar salvage
May 23, 2020 04:54PM
I'm sure bodhi will be along to tell you the best approach (he is the man!), but you might want to start reading about how to update the u-boot: http://forum.doozan.com/read.php?3,12381

I love my Dockstar. It has been in constant operation for about a decade thanks to this forum.
Re: Dockstar salvage
May 23, 2020 06:17PM
Rob,

Quote

I would like to re-use as a network backup & monitoring server (since it is such a neat compact low-power unit), and would appreciate your advice on how feasible it would be to get it loaded with Debian or similar,

If that's your goal then it is easy, since you have full control with serial console. Stock u-boot is old, but it can boot Debian rootfs on USB.
U-Boot 1.1.4 (Jul 16 2009 - 21:02:16) Cloud Engines (3.4.16)

There are 3 alternatives.

=====
1. Since this is the Dockstar, the easiest way to get there is:

a. Create a Debian rootfs on USB using Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 from the release thread:

https://forum.doozan.com/read.php?2,12096

b. In serial console create some new envs to boot this USB rootfs. I can help you with this.

c. Boot into Debian, and flash new 2017.07 U-Boot (as renojim had suggested):

https://forum.doozan.com/read.php?3,12381

=====
2.

The next alternative is to reflash mtd1 (the kernel file) in serial console to restore stock kernel. This requires a backup mtd1 file, someone will upload here. After flashing, hopefully you can boot stock OS on NAND. And then from there, you can install new Debian rootfs and new u-boot.

However, this might become tedious and time consuming if you cannot log into stock because the rootfs in NAND is also corrupted.

Also, this is a little bit risky for the Dockstar (no recovery path if something goes wrong).

=====
3.

The next alternative is to flash new u-boot in serial console. and boot to Debian rootfs on USB. This is most risky for the Dockstar (no recovery path if something goes wrong).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dockstar salvage
May 24, 2020 04:18AM
Wow thanks for outlining detailed options! most helpful of you

I will definitely go for option 1 as less risk of faffing around if unexpected problems encountered with bad NAND blocks etc

I created a 8GB USB stick with the Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi untarred on it, and had a go at booting from USB but will definitely appreciate your help on the correct setenv commands please..

( I tried setting bootargs_root:

CE>> setenv bootargs_root root=/dev/sda1 rootdelay=10 rootfstype=ext3

& doing a saveenv before rebooting
but I guess it's not as simple as that ! I guess it also needs a clever bootcmd to start USB but I was unable to work out how to tinker with USB from the stock u-boot:

CE>> setenv robin usb start
CE>> run robin
Unknown command 'usb' - try 'help'
Re: Dockstar salvage
May 24, 2020 06:00AM
Rob,

It's a little bit more involved than just bootargs. I'll come back tomorrow and show you how to set a few envs to boot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dockstar salvage
May 24, 2020 04:34PM
Rob,

At serial console prompt,

setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10'
setenv usb_boot 'mw 0x800000 0 1; ext2load usb 0:1 0x800000 /boot/uImage; if ext2load usb 0:1 0x2100000 /boot/uInitrd; then bootm 0x800000 0x2100000; else bootm 0x800000; fi'
setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
setenv bootcmd 'usb start; run usb_bootcmd; usb stop; reset'
printenv
and then
boot

Please post the entire serial console log here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dockstar salvage
May 25, 2020 03:24AM
Thanks for the fast response!
When doing the setenv of the long usb_boot string, it gives a 'too many args' error, but I went ahead anyway, and it gave a 'Unknown command - usb ' , similar to yesterday.

I subsequently tried splitting the long usb_boot into two shorter ones, usb_boot1 & usb_boot2 , but still get the same "Unknown command usb" -

Hopefully you know a way to get this old u-boot to talk to USB.. By the way, does it matter which USB slot my 8GB stick is in?

CE>> setenv usb_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10'
CE>> setenv usb_boot 'mw 0x800000 0 1; ext2load usb 0:1 0x800000 /boot/uImage; if ext2load usb 0:1 0x2100000 /boot/uInitrd; then bootm 0x800000 0x2100000; else bootm 0x800000; fi'
** Too many args (max. 16) **
Unknown command 'setenv' - try 'help'
CE>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot'
CE>> setenv bootcmd 'usb start; run usb_bootcmd; usb stop; reset'
CE>>
CE>> printenv
baudrate=115200
loads_echo=0
ipaddr=169.254.254.253
rootpath=/mnt/ARM_FS/
netmask=255.255.0.0
run_diag=yes
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
ethaddr=00:10:75:1A:C1:34
cesvcid=925RLLVQG3B3BV9ND63NR4REKW
ceserialno=2GEP1DDS
ceboardver=REDSTONE:1.0
serverip=169.254.120.1
bootargs_root=root=/dev/sda1 rootdelay=10 rootfstype=ext3
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
bootargs=console=ttyS0,115200 root=/dev/sda1 rootdelay=10 rootfstype=ext3
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10
usb_boot=mw 0x800000 0 1; ext2load usb 0:1 0x800000 /boot/uImage; if ext2load usb 0:1 0x2100000
usb_bootcmd=run usb_set_bootargs; run usb_boot
bootcmd=usb start; run usb_bootcmd; usb stop; reset

Environment size: 1027/131068 bytes
CE>>

CE>> boot
Unknown command 'usb' - try 'help'

** Block device usb 0 not supported
Unknown command 'if' - try 'help'
Unknown command 'usb' - try 'help'


U-Boot 1.1.4 (Jul 16 2009 - 21:02:16) Cloud Engines (3.4.16)

U-Boot code: 00600000 -> 0067FFF0  BSS: -> 00690D60

Soc: 88F6281 A0 (DDR2)
CPU running @ 1200Mhz L2 running @ 400Mhz
SysClock = 400Mhz , TClock = 200Mhz

DRAM CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
..
...   ( usual boot from 0x800000 , ending in Bad Data CRC )
..
..
..
CE>> setenv usb_boot1 'mw 0x800000 0 1; ext2load usb 0:1 0x800000 /boot/uImage; ext2load usb 0:1 0x2100000 /boot/uInitrd'
CE>> setenv usb_boot2 ' bootm 0x800000 0x2100000 '
CE>> setenv usb_bootcmd 'run usb_set_bootargs; run usb_boot1; run usb_boot2'
CE>>
CE>> boot
Unknown command 'usb' - try 'help'

** Block device usb 0 not supported

** Block device usb 0 not supported
## Booting image at 00800000 ...
Bad Magic Number
Unknown command 'usb' - try 'help'


U-Boot 1.1.4 (Jul 16 2009 - 21:02:16) Cloud Engines (3.4.16)
..
...   ( usual boot from 0x800000 , ending in Bad Data CRC 
Re: Dockstar salvage
May 25, 2020 04:32AM
Rob,

> anyway, and it gave a 'Unknown command - usb ' ,
> similar to yesterday.

I don't recall this stock u-boot does not have USB. Run

help
See what commands it provides.


> I subsequently tried splitting the long usb_boot
> into two shorter ones, usb_boot1 & usb_boot2 , but
> still get the same "Unknown command usb"

Yeah. Sometimewe need to do this to shorten the commands, some old u-boot only takes 16 arguments.

> Hopefully you know a way to get this old u-boot to
> talk to USB.. By the way, does it matter which
> USB slot my 8GB stick is in?

It does not matter which slot the USB is plugged in if it is the only one.


> ## Booting image at 00800000 ...
> Bad Magic Number
> Unknown command 'usb' - try 'help'
>
>
> U-Boot 1.1.4 (Jul 16 2009 - 21:02:16) Cloud
> Engines (3.4.16)
> ..
> ... ( usual boot from 0x800000 , ending in Bad
> Data CRC

The above indicates that it tried to boot stock kernel, but it was corrupted.

Let's see the output of "help" before we go further.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dockstar salvage
May 25, 2020 08:37AM
Here you go ..

CE>> help
?       - alias for 'help'
base    - print or set address offset
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootext2    dev:boot_part1,boot_part2 addr boot_image linux_dev_name
bootm   - boot application image from memory
bootp   - boot image via network using BootP/TFTP protocol
bubt    - Burn an image on the Boot Nand Flash.
chpart  - change active partition
cmp     - memory compare
cmpm    - Compare Memory
cp      - memory copy
cpumap - Display CPU memory mapping settings.
crc32   - checksum calculation
date    - get/set/reset date & time
dclk    - Display the MV device CLKs.
dhcp    - invoke DHCP client to obtain IP/boot params
diskboot- boot from IDE device
echo    - echo args to console
eeprom  - EEPROM sub-system
erase   - erase FLASH memory
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
fi      - Find value in the memory.
flinfo  - print FLASH memory information
fsinfo  - print information about filesystems
fsload  - load binary file from a filesystem image
g       - start application at cached address 'addr'(default addr 0x40000)
go      - start application at address 'addr'
help    - print online help
icrc32  - checksum calculation
ide     - IDE sub-system
iloop   - infinite loop on address range
imd     - i2c memory display
imm[.b, .s, .w, .l]     - i2c memory modify (auto-incrementing)
imw     - memory write (fill)
inm     - memory modify (constant address)
iprobe  - probe to discover valid I2C chip addresses
ir      - reading and changing MV internal register values.
loop    - infinite loop on address range
ls      - list files in a directory (default /)
map     - Diasplay address decode windows
md      - memory display
me      - PCI master enable
mm      - memory modify (auto-incrementing)
mp      - map PCI BAR
mtdparts- define flash/nand partitions
mtest   - simple RAM test
mv_diag - perform board diagnostics
mw      - memory write (fill)
nand                   - NAND sub-system
nboot   - boot from NAND device
nbubt   - Burn a boot loader image on the Boot Nand Flash.
nm      - memory modify (constant address)
pci     - list and access PCI Configuration Space
phyRead - Read PCI-E Phy register
pciePhyWrite    - Write PCI-E Phy register
phyRead - Read Phy register
phyWrite        - Write Phy register
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset   - Perform RESET of the CPU
resetenv        - Return all environment variable to default.
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
se      - PCI Slave enable
setenv  - set environment variables
sflash  - read, write or erase the external SPI Flash.
sg      - scanning the PHYs status
sp      - Scan PCI bus.
tftpboot- boot image via network using TFTP protocol
version - print monitor version
CE>>
Re: Dockstar salvage
May 25, 2020 04:53PM
rsinklair,

Indeed, there is no usb command available! it has been a very long time so I forgot whether it is available in this version.

OK so if we stay with method 1, we need to change 1.b to load the kernel using tftpboot. And this requires the serial console host (the box that you are using to monitor serial console currently) to be a Linux box.

b. Boot with tftp.

b.1. Set up tftp in the serial console host. And copy the uImage and uInitrd kernel files on the USB rootfs /boot to the tftproot.

b.2 Power up and interrupt serial console, and execute:

Assuming the serial console host IP is 192.168.0.100, and you want this Dockstar to be 192.168.0.101 (change these IP addresses to be appropriate for your network).

setenv serverip 192.168.0.100
setenv ipaddr 192.168.0.101
setenv tftp_load 'tftpboot 0x800000 uImage; tftpboot 0x2100000 uInitrd'
setenv tftp_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10'
setenv tftp_boot 'mw 0x800000 0 1; run tftp_load; bootm 0x800000 0x2100000'
setenv tftp_bootcmd 'run tftp_set_bootargs; run tftp_boot'
setenv bootcmd 'run tftp_bootcmd; reset'
printenv
and then
boot

Let me know if you are not sure about some steps above.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Dockstar salvage
May 26, 2020 04:40AM
That's great thanks, it now boots nicely from tftp.:)
However it gives an invalid dtb error - see below

Elsewhere I saw the use of
dtb_file=/boot/dts/kirkwood-dockstar.dtb
however that file is on USB.. do we have to tftpboot the dtb file into a specific location on the NAND instead?

BTW, is there a way to escape back to the bootloader prompt once it has failed to boot ? ( like stop-A on an old sparcstation )



CE>> setenv tftp_load 'tftpboot 0x800000 uImage; tftpboot 0x2100000 uInitrd'
CE>> setenv tftp_set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10'
CE>> setenv tftp_boot 'mw 0x800000 0 1; run tftp_load; bootm 0x800000 0x2100000'
CE>> setenv tftp_bootcmd 'run tftp_set_bootargs; run tftp_boot'
CE>> setenv bootcmd 'run tftp_bootcmd; reset'
CE>> printenv
baudrate=115200
loads_echo=0
ipaddr=192.168.13.13
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
run_diag=yes
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
ethaddr=00:10:75:1A:C1:34
cesvcid=925RLLVQG3B3BV9ND63NR4REKW
ceserialno=2GEP1DDS
ceboardver=REDSTONE:1.0
serverip=192.168.13.1
bootargs_root=root=/dev/sda1 rootdelay=10 rootfstype=ext3
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
bootargs=console=ttyS0,115200 root=/dev/sda1 rootdelay=10 rootfstype=ext3
tftp_load=tftpboot 0x800000 uImage; tftpboot 0x2100000 uInitrd
tftp_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10
tftp_boot=mw 0x800000 0 1; run tftp_load; bootm 0x800000 0x2100000
tftp_bootcmd=run tftp_set_bootargs; run tftp_boot
bootcmd=run tftp_bootcmd; reset

Environment size: 1045/131068 bytes
CE>>


CE>> boot
Using egiga0 device
TFTP from server 192.168.13.1; our IP address is 192.168.13.99
Filename 'uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
            ...snip..
         #################################################################
         ############################################################
done
Bytes transferred = 4963680 (4bbd60 hex)
Using egiga0 device
TFTP from server 192.168.13.1; our IP address is 192.168.13.99
Filename 'uInitrd'.
Load address: 0x2100000
Loading: #################################################################
         #################################################################
           ..snip
         #################################################################
         #############
done
Bytes transferred = 9713936 (943910 hex)
## Booting image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4963616 Bytes =  4.7 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:50 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes =  9.3 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x0000020f, r2=0x00000100
  r2[]=05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00
Available machine support:

ID (hex)        NAME
ffffffff        Generic DT based system
ffffffff        Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.



...............................................
Re: Dockstar salvage
May 26, 2020 04:51AM
Rob,

> That's great thanks, it now boots nicely from
> tftp.:)
> However it gives an invalid dtb error - see
> below

Cool!

>
> Elsewhere I saw the use of
> dtb_file=/boot/dts/kirkwood-dockstar.dtb
> however that file is on USB.. do we have to
> tftpboot the dtb file into a specific location on
> the NAND instead?

No. Because this is stock u-boot. You need to to append the DTB to uImage as in step 4:

Quote

4. Create uImage with embedded DTB for booting with older u-boots (2012 or earlier). Do not do this step if you have installed the latest U-Boot for Kirkwood (or are installing this u-boot at the same time).

Please replace kirkwood-goflexnet.dtb below with the correct DTB name for your box (see the folder /media/sdb1/boot/dts for the exact spelling of your Kirkwood box name).

Generate the uImage with DTB embedded inside:
cd /media/sdb1/boot
cp -a zImage-5.2.9-kirkwood-tld-1 zImage.fdt
cat dts/kirkwood-goflexnet.dtb >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d zImage.fdt uImage
sync

If your Linux box does not have mkimage, then install it

apt-get install u-boot-tools
For the Dockstar the command above is


cat dts/kirkwood-dockstar.dtb >> zImage.fdt



> BTW, is there a way to escape back to the
> bootloader prompt once it has failed to boot ? (
> like stop-A on an old sparcstation )


Unfortunately, no way to escape when you got to the phase that the kernel has loaded and about to start. Only possible to escape if the kernel files were not loaded successfully.

So I's say it is very close to booting. Just do Step 4 and it will most likely to boot into Debian.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 2 time(s). Last edit at 05/26/2020 04:56AM by bodhi.
Re: Dockstar salvage
May 26, 2020 12:27PM
Great , that did it thanks ! It has now booted up, gets an IP address from my DHCP server, and I can log in as root. Yippee!

( I had actually run the mkimage commands at the weekend when creating the USB stick, but then when setting up the TFTP server yesterday I just used the uImage file from the original tar.bz file , to save me walking downstairs to unplug the USB stick.. forgetting the uImage wasn't the same.. *doh*

Many thanks for your help so far !- I shall now look into flashing the 2017-07 U-boot as per earlier link above, to set up USB boot, netconsole etc.
Re: Dockstar salvage
May 26, 2020 02:20PM
Update - flashing the newer u-boot went smoothly, thanks to the clear & detailed instructions, so my U-boot banner now shows 2017.07 :-)
And boots from USB.

Thanks again for your help bodhi. I would like to buy you a beer but it looks from your signature that a donation to MSF is preferred, so have donated the proceeds of my only sale today on eBay ( a pair of 15-year-old 18GB 10k rpm SCSI disks from a Sun workstation sold for £25
Cheers, keep up the good work !

U-Boot 2017.07-tld-1 (Oct 24 2017 - 22:32:36 -0700)
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
starting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices...
Use USB retry period from the environment: 15 second(s)
1 Storage Device(s) found
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'

Partition Map for USB device 0  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     8064            15125184        c9904ef6-01     83

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0

## Unknown partition table type 0
loading envs from usb 0 ...
** File not found /boot/uEnv.txt **
Unknown command 'ide' - try 'help'
Unknown command 'mmc' - try 'help'
running scan_disk ...
Scan device usb
device usb 0:1
1 bytes read in 692 ms (0 Bytes/s)
Found bootable drive on usb 0
loading uImage ...
4973738 bytes read in 1015 ms (4.7 MiB/s)
loading uInitrd ...
9713936 bytes read in 963 ms (9.6 MiB/s)
loading DTB ...
** No boot file defined **
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-5.2.9-kirkwood-tld-1
   Created:      2020-05-24   7:44:14 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4973674 Bytes = 4.7 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-5.2.9-kirkwood-tld-1
   Created:      2019-08-25   2:22:50 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9713872 Bytes = 9.3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
   Loading Ramdisk to 071cc000, end 07b0f8d0 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
....
Re: Dockstar salvage
May 26, 2020 07:19PM
Rob,

> Update - flashing the newer u-boot went smoothly,
> thanks to the clear & detailed instructions, so my
> U-boot banner now shows 2017.07 :-)
> And boots from USB.

Cool!

> Thanks again for your help bodhi. I would like to
> buy you a beer but it looks from your signature
> that a donation to MSF is preferred, so have
> donated the proceeds of my only sale today on eBay
> ( a pair of 15-year-old 18GB 10k rpm SCSI disks
> from a Sun workstation sold for £25
> Cheers, keep up the good work !

Much appreciated :)

>
> U-Boot 2017.07-tld-1 (Oct 24 2017 - 22:32:36
> -0700)
> 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
> starting USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 3 USB Device(s)
> found
>        scanning usb for storage devices...
> Use USB retry period from the environment: 15
> second(s)
> 1 Storage Device(s) found
> Unknown command 'ide' - try 'help'
> Unknown command 'mmc' - try 'help'
> 
> Partition Map for USB device 0  --   Partition
> Type: DOS
> 
> Part    Start Sector    Num Sectors     UUID      
>      Type
>   1     8064            15125184       
> c9904ef6-01     83
> 
> ## Unknown partition table type 0
> 
> ## Unknown partition table type 0
> 
> ## Unknown partition table type 0
> 
> ## Unknown partition table type 0
> 
> ## Unknown partition table type 0
> 
> ## Unknown partition table type 0
> loading envs from usb 0 ...
> ** File not found /boot/uEnv.txt **
> Unknown command 'ide' - try 'help'
> Unknown command 'mmc' - try 'help'
> running scan_disk ...
> Scan device usb
> device usb 0:1
> 1 bytes read in 692 ms (0 Bytes/s)
> Found bootable drive on usb 0
> loading uImage ...
> 4973738 bytes read in 1015 ms (4.7 MiB/s)
> loading uInitrd ...
> 9713936 bytes read in 963 ms (9.6 MiB/s)
> loading DTB ...
> ** No boot file defined **
> ## Booting kernel from Legacy Image at 00800000
> ...
>    Image Name:   Linux-5.2.9-kirkwood-tld-1
>    Created:      2020-05-24   7:44:14 UTC
>    Image Type:   ARM Linux Kernel Image
> (uncompressed)
>    Data Size:    4973674 Bytes = 4.7 MiB
>    Load Address: 00008000
>    Entry Point:  00008000
>    Verifying Checksum ... OK
> ## Loading init Ramdisk from Legacy Image at
> 01100000 ...
>    Image Name:   initramfs-5.2.9-kirkwood-tld-1
>    Created:      2019-08-25   2:22:50 UTC
>    Image Type:   ARM Linux RAMDisk Image (gzip
> compressed)
>    Data Size:    9713872 Bytes = 9.3 MiB
>    Load Address: 00000000
>    Entry Point:  00000000
>    Verifying Checksum ... OK
>    Loading Kernel Image ... OK
>    Loading Ramdisk to 071cc000, end 07b0f8d0 ...
> OK
> 
> Starting kernel ...
> 
> Uncompressing Linux... done, booting the kernel.
> ....
>

The highlighted error above indicated that you are not booting with separate DTB. Now since you are booting with the new u-boot, you need to reverse Step 4

cd /boot
cp -a  uImage uImage.dockstar.dtb
cp -a uImage.orig uImage

and then

fw_setenv dtb_file=/boot/dts/kirkwood-dockstar.dtb

and then reboot
sync
shutdown -r now

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
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: