OpenWrt on Seagate Dockstar

U-Boot from OpenWrt

Since U-Boot is currently not built by OpenWrt's buildbot, you have to compile
it on your own.
In the meantime, OpenWrt's snapshot builds include all U-Boot variants.
You can also download my prebuilt U-Boot 2019.01 on this page.

U-Boot 2019.01

You can download a prebuilt version for Seagate Dockstar here.

See its logs here.

Installation of U-Boot + OpenWrt

Installation is a bit tricky and requires access to the device's serial console.

Start a serial session to your device's default U-Boot.
At first, a new bootloader is installed:
Be aware of the risk of flashing a bootloader!
tftpboot 0x800000 u-boot.kwb
nand erase 0x0 0x10000000
nand write 0x800000 0x0 0x80000
reset
Hopefully, you did not brick your device and land in the new U-Boot.
There, you can re-programm the device's MAC-address, and create the ubi-partitions.
setenv ethaddr 00:10:75:__:__:__
saveenv
ubi part ubi
ubi create kernel 0x400000
ubi create rootfs 0xc00000
ubi create rootfs_data
Three partitions are created:
kernel (4MB), roots (12MB) and rootfs_data (remaining space ~225MB for overlay)

In contrast to other sources, you must NOT change the bootargs_root-parameter!

For the firmware itself, I had no luck with lede-kirkwood-dockstar-squashfs-factory.bin,
so we'll use lede-kirkwood-dockstar-squashfs-sysupgrade.tar.
Get your copy of the file, extract its contents and provide them via your TFTP server.

Then, load those files and flash:
tftpboot 0x800000 kernel
# the above command outputs something like 'bytes transferred = 1913260 (1d31ac hex)'
# take the number inside the brackets (without 'hex' addendum)
# and use it for the next command
ubi write 0x800000 kernel 0x1d31ac
tftpboot 0x800000 root
# the above command outputs something like 'bytes transferred = 1215322 (1285ba hex)'
# take the number inside the brackets (without 'hex' addendum)
# and use it for the next command
ubi write 0x800000 rootfs 0x128b5a
reset
If everything went well, your Dockstar starts booting OpenWrt: bootlog.

From now on you can use the sysupgrade utility to flash new firmware:
sysupgrade lede-kirkwood-dockstar-squashfs-sysupgrade.tar
This will immediatley terminate your SSH session, you're doing the upgrade with,
but after 1-2 minutes, it should be up and running again.

Upgrade

Once you run OpenWrt's U-Boot you can upgrade using these commands:
# first copy u-boot.kwb from somewhere to /tmp
cd /tmp
root@lede:/tmp# mtd unlock uboot
Unlocking uboot ...
root@lede:/tmp# mtd -e uboot write u-boot.kwb uboot
Unlocking uboot ...
Erasing uboot ...

Writing from u-boot.kwb to uboot ...
root@lede:/tmp# reboot
root@lede:/tmp#
This does not touch U-Boot's configuration which is stored on another
partition, so it should easily come up again.

Downloads

for Seagate Dockstar:

Logs

U-Boot 2019.01 (Jan 18 2019 - 12:24:02 +0000)
Seagate FreeAgent DockStar

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
NAND:  256 MiB
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
DockStar>
DockStar> help
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootefi - Boots an EFI payload from memory
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
bootz   - boot Linux zImage image from memory
chpart  - change active partition
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dhcp    - boot image via network using DHCP/TFTP protocol
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatsize - determine a file's size
fdt     - flattened device tree utility commands
fsinfo  - print information about filesystems
fsload  - load binary file from a filesystem image
fsls    - list files in a directory (default /)
go      - start application at address 'addr'
help    - print command description/usage
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mtdparts- define flash/nand partitions
mw      - memory write (fill)
nand    - NAND sub-system
nboot   - boot from NAND device
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sleep   - delay execution for some time
source  - run script from memory
tftpboot- boot image via network using TFTP protocol
ubi     - ubi commands
ubifsload- load file from an UBIFS filesystem
ubifsls - list files in a directory
ubifsmount- mount UBIFS volume
ubifsumount- unmount UBIFS volume
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
DockStar>
DockStar> printenv
baudrate=115200
bootcmd=setenv bootargs ${console} ${mtdparts} ${bootargs_root}; ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000
bootdelay=3
console=console=ttyS0,115200
ethact=egiga0
ethaddr=00:10:75:__:__:__
ipaddr=192.168.1.1
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)
serverip=192.168.1.2
stderr=serial
stdin=serial
stdout=serial

Environment size: 478/131068 bytes
DockStar>
DockStar> boot
ubi0: attaching mtd4
ubi0: scanning is finished
ubi0: attached mtd4 (name "ubi", size 254 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 2030, bad PEBs: 2, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 5/2, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 0, total reserved PEBs: 2030, PEBs reserved for bad PEB handling: 38
No size specified -> Using max size (2322432)
Read 2322432 bytes from volume kernel to 00800000
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.19.9
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2295774 Bytes = 2.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.9 (lede@debian-compiler) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r7920+828-4f3d700138)) #0 Thu Dec 27 14:39:36 2018
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: Seagate FreeAgent Dockstar
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: get_random_bytes called from start_kernel+0x70/0x47c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 mtdparts=orion_nand:0xe0000@0x0(uboot),0x20000@0xe0000(uboot_env),0x100000@0x100000(second_stage_uboot),-@0x200000(ubi)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 121240K/131072K available (4915K kernel code, 177K rwdata, 1284K rodata, 1024K init, 206K bss, 9832K reserved, 0K cma-reserved)
(...)