Seagate FreeAgent DockStar - FreeBSD

Hardware info on main page.

the DockStar runs the arm version of FreeBSD.

The usb memory stick I am using (da0) has two partitions:

slice 1 - 32 MB - msdosfs (FAT16) - used to store the kernel (kernel.bin) so the DockStar firmware can load it.
slice 2 - 456 MB - FreeBSD, currently 8.2-stable

Links

FreeBSD for Kirkwood,

Work log

2017-12-12: FreeBSD, via ssh

tingo@kg-core1$ ssh star
Password:
Last login: Tue Dec 12 22:34:53 2017 from kg-core1.kg4.no
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
    The Regents of the University of California.  All rights reserved.

FreeBSD 8.2-STABLE (DOCKSTAR) #2: Thu Jul 21 13:19:08 CEST 2011

**************************
**            **
**   kg-star.kg4.no    **
**            **
**************************
If you have a CD-ROM drive in your machine, you can make the CD-ROM that is
presently inserted available by typing 'mount /cdrom' as root.  The CD-ROM
will be available under /cdrom/.  Remember to do 'umount /cdrom' before
removing the CD-ROM (it will usually not be possible to remove the CD-ROM
without doing this.)

Note: This tip may not work in all configurations.
tingo@kg-star$ date;uptime
Tue Dec 12 23:01:16 CET 2017
11:01PM  up 27 mins, 1 user, load averages: 0.00, 0.00, 0.00
tingo@kg-star$ df -h
Filesystem               Size    Used   Avail Capacity  Mounted on
/dev/ufs/kirkwoodroot    442M    171M    235M    42%    /
devfs                    1.0k    1.0k      0B   100%    /dev

ok.

2017-12-12: after unbricking the DockStar (as far as getting the "U-Boot 2010.09 (Oct 23 2010 - 11:49:22)" onto it), I managed to boot FreeBSD off the usb stick by manually entering variables into u-boot

Marvell>> setenv usb_boot 'fatload usb $usb_device 0x900000 kernel.bin; go 0x900000;'
Marvell>> setenv usb_init 'usb start; if fatload usb 0 0x900000 kernel.bin; then setenv usb_device 0; elif fatload usb 1 0x900000 kernel.bin; then setenv usb_device 1; elif fatload usb 2 0x900000 kernel.bin; then setenv usb_device 2; elif fatload usb 3 0x900000 kernel.bin; then setenv usb_device 3; elif fatload usb 4 0x900000 kernel.bin; then setenv usb_device 4; else run pogo_bootcmd; fi;'
Marvell>> setenv bootcmd_test 'run usb_init; run usb_boot;'

try it.

Marvell>> run bootcmd_test
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
reading kernel.bin

3908596 bytes read
reading kernel.bin

3908596 bytes read
## Starting application at 0x00900000 ...
Copyright (c) 1992-2011 The FreeBSD Project.

cool.

2014-05-04: I'm going to play with the Dockstar, so I'm shuttding it down. Details and stats:

root@kg-star# uname -a
FreeBSD kg-star.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #2: Thu Jul 21 13:19:08 CEST 2011     root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR  arm
root@kg-star# date;swapinfo -h;tvlm;df -h;uptime
Sun May  4 11:02:35 CEST 2014
Device          1K-blocks     Used    Avail Capacity
Apr 21 00:02:10 kg-star ntpd[1007]: kernel time sync status change 6001
Apr 21 00:19:17 kg-star ntpd[1007]: kernel time sync status change 2001
Apr 24 01:09:11 kg-star ntpd[1007]: kernel time sync status change 6001
Apr 24 01:34:51 kg-star ntpd[1007]: kernel time sync status change 2001
Apr 27 13:57:12 kg-star ntpd[1007]: kernel time sync status change 6001
Apr 27 14:05:46 kg-star ntpd[1007]: kernel time sync status change 2001
Apr 29 04:09:12 kg-star ntpd[1007]: kernel time sync status change 6001
Apr 29 04:34:52 kg-star ntpd[1007]: kernel time sync status change 2001
May  3 21:09:51 kg-star ntpd[1007]: kernel time sync status change 6001
May  3 21:18:23 kg-star ntpd[1007]: kernel time sync status change 2001
Filesystem               Size    Used   Avail Capacity  Mounted on
/dev/ufs/kirkwoodroot    442M    171M    235M    42%    /
devfs                    1.0k    1.0k      0B   100%    /dev
11:02AM  up 338 days,  2:15, 1 user, load averages: 0.00, 0.00, 0.00

shutdown:

root@kg-star# shutdown -p now
Shutdown NOW!
shutdown: [pid 50653]
root@kg-star#                                                                               
*** FINAL System shutdown message from tingo@kg-star.kg4.no ***             

System going down IMMEDIATELY                                                 



System shutdown time has arrived
Connection to kg-star.kg4.no closed by remote host.
Connection to kg-star.kg4.no closed.

and it's gone.

2013-05-31: new power outage (this time it was maintenance from the power company), I needed to do the fsck again: look at the memstick:

root@kg-v2# gpart show da0
=>     32  1000912  da0  MBR  (488M)
       32    65536    1  freebsd  (32M)
    65568   935360    2  freebsd  (456M)
  1000928       16       - free -  (8.0k)

fsck slice 1:

root@kg-v2# fsck_msdosfs -y /dev/da0s1
** /dev/da0s1
** Phase 1 - Read and Compare FATs
** Phase 2 - Check Cluster Chains
** Phase 3 - Checking Directories
** Phase 4 - Checking for Lost Files
2 files, 28896 free (7224 clusters)

fsck slice 2:

root@kg-v2# fsck_ffs -y /dev/da0s2a
** /dev/da0s2a
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
11085 files, 87553 used, 138850 free (618 frags, 17279 blocks, 0.3% fragmentation)

***** FILE SYSTEM MARKED CLEAN *****

then back into DockStar for a boot:

tingo@kg-star$ date
Fri May 31 08:48:06 CEST 2013
tingo@kg-star$ uname -a
FreeBSD kg-star.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #2: Thu Jul 21 13:19:08 CEST 2011     root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR  arm
tingo@kg-star$ uptime
 8:48AM  up 1 min, 1 user, load averages: 0.37, 0.21, 0.08

and back in business again.

2013-01-17: after a power outage (an incandescent lightbulb blew and tripped the circuit breaker too) the DockStar didn't come up again. So take out the memory stick and do the fsck thing again:

root@kg-v2# fsck_msdosfs -y /dev/da3s1
** /dev/da3s1
** Phase 1 - Read and Compare FATs
** Phase 2 - Check Cluster Chains
** Phase 3 - Checking Directories
** Phase 4 - Checking for Lost Files
2 files, 28896 free (7224 clusters)
root@kg-v2# fsck_ffs -y /dev/da3s2a
** /dev/da3s2a
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
11084 files, 87568 used, 138835 free (587 frags, 17281 blocks, 0.3% fragmentation)

***** FILE SYSTEM MARKED CLEAN *****

then put it back into the DockStar and power up again. Does it work? Yes, up again:

tingo@kg-star$ uname -a;uptime
FreeBSD kg-star.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #2: Thu Jul 21 13:19:08 CEST 2011     root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR  arm
 8:32PM  up 2 mins, 1 user, load averages: 0.28, 0.21, 0.09

that's all for now.

2012-11-17: today the DockStar has been up 300 days:

root@kg-star# uname -a
FreeBSD kg-star.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #2: Thu Jul 21 13:19:08 CEST 2011     root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR  arm
root@kg-star# uptime
 1:31PM  up 300 days, 20:10, 1 user, load averages: 0.00, 0.00, 0.00

That's all.

2012-01-21: there was another power outage on January 12th, and the DockStar didn't come up afterwards. Since it is used only for testing I didn't bother with it until today. Take out the usb memory stick, put it into my workstation and fix it:

root@kg-v2# fsck_msdosfs -y /dev/da1s1
** /dev/da1s1
** Phase 1 - Read and Compare FATs
** Phase 2 - Check Cluster Chains
** Phase 3 - Checking Directories
** Phase 4 - Checking for Lost Files
2 files, 28896 free (7224 clusters)
root@kg-v2# fsck_ffs -y /dev/da1s2a
** /dev/da1s2a
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
LINK COUNT FILE I=16942  OWNER=operator MODE=100400
SIZE=2048 MTIME=Jan 12 18:55 2012  COUNT 2 SHOULD BE 1
ADJUST? yes

** Phase 5 - Check Cyl groups
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? yes

SUMMARY INFORMATION BAD
SALVAGE? yes

BLK(S) MISSING IN BIT MAPS
SALVAGE? yes

11085 files, 87591 used, 138812 free (604 frags, 17276 blocks, 0.3% fragmentation)

***** FILE SYSTEM MARKED CLEAN *****

***** FILE SYSTEM WAS MODIFIED *****

Ok, now try it. Yes, it is up again:

tingo@kg-star$ uname -a
FreeBSD kg-star.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #2: Thu Jul 21 13:19:08 CEST 2011     root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR  arm

Nice.

2011-12-02: after a power outage on November 30th, the DockStar wouldn't come up again. Today I had time to look at it. I put the usb memory stick into another machine and ran fsck on it: slice 1

root@kg-v2# fsck_msdosfs -y /dev/da4s1
** /dev/da4s1
** Phase 1 - Read and Compare FATs
** Phase 2 - Check Cluster Chains
** Phase 3 - Checking Directories
** Phase 4 - Checking for Lost Files
2 files, 28896 free (7224 clusters)
MARK FILE SYSTEM CLEAN? yes
MARKING FILE SYSTEM CLEAN

slice 2

root@kg-v2# fsck_ffs -y /dev/da4s2a
** /dev/da4s2a
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
11085 files, 87560 used, 138843 free (595 frags, 17281 blocks, 0.3% fragmentation)

***** FILE SYSTEM MARKED CLEAN *****

After that, I put the memory stick back into the DockStar and powered it on. It came right up:

root@kg-star# uname -a
FreeBSD kg-star.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #2: Thu Jul 21 13:19:08 CEST 2011     root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR  arm

Good.

2011-07-26: I created /etc/periodic.conf and added the following line:

daily_status_ntpd_enable="YES"

2011-07-21: (much later, after a few hours sleep, a few hours of RL activities) after fixing the kernel config file so it has the correct root device name:

options ROOTDEVNAME=\"ufs:/dev/ufs/kirkwoodroot\"

and building a new kernel, the DockStar now autoboots happily. dmesg output: normal.

2011-07-21: Various after install configuration. change root's shell

kg-star# chsh -s /bin/sh
chsh: user information updated

Setting local timezone:

root@kg-star# tzsetup /usr/share/zoneinfo/Europe/Oslo

(dialog based)

2011-07-21: The DockStar now runs FreeBSD 8.2-stable / arm. dmesg output: normal.

root@kg-star# uname -a
FreeBSD kg-star.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #1: Thu Jul 21 04:20:24 CEST 2011     root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR  arm

2011-07-21: Ok, let's try another memory stick:

root@kg-v2# gpart show da4
=>     32  1000896  da4  MBR  (488M)
       32      201       - free -  (100k)
      233   999703    1  !6  (488M)
   999936      992       - free -  (496k)

clear it:

root@kg-v2# gpart delete -i 1 da4
da4s1 deleted
root@kg-v2# gpart destroy da4
da4 destroyed

create what you need

root@kg-v2# gpart create -s MBR da4
da4 created
root@kg-v2# gpart add -s 32M -t freebsd da4
da4s1 added
root@kg-v2# gpart add -t freebsd da4
da4s2 added

Looks like this:

root@kg-v2# gpart show da4
=>     32  1000896  da4  MBR  (488M)
       32    65536    1  freebsd  (32M)
    65568   935360    2  freebsd  (456M)

A bit on the small side, but if it works... create a ms-dos filesystem

root@kg-v2# newfs_msdos /dev/da4s1
/dev/da4s1: 65432 sectors in 8179 FAT16 clusters (4096 bytes/cluster)
BytesPerSec=512 SecPerClust=8 ResSectors=1 FATs=2 RootDirEnts=512 Media=0xf0 FATsecs=32 SecPerTrack=32 Heads=64 HiddenSecs=0 HugeSectors=65536

mount it, copy the kernel and unmount

root@kg-v2# mount -t msdosfs /dev/da4s1 /mnt
root@kg-v2# cp /usr/obj/arm/usr/src/sys/DOCKSTAR/kernel.bin /mnt
root@kg-v2# umount /mnt

Next, the root file system

root@kg-v2# bsdlabel -w /dev/da4s2
root@kg-v2# newfs -n /dev/da4s2a
/dev/da4s2a: 456.7MB (935344 sectors) block size 16384, fragment size 2048
    using 4 cylinder groups of 114.19MB, 7308 blks, 14656 inodes.
super-block backups (for fsck -b #) at:
 160, 234016, 467872, 701728

Then, mount it and install on it:

root@kg-v2# mount /dev/da4s2a /mnt
root@kg-v2# env DESTDIR=/mnt make installworld distrib-dirs distribution TARGET_ARCH=arm

Takes up 170M:

root@kg-v2# df -h /mnt
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/da4s2a    442M    170M    236M    42%    /mnt

Do the config thing again:

root@kg-v2# echo 'send dhcp-client-identifier "kg-star.kg4.no";' >> /mnt/etc/dhclient.conf
root@kg-v2# echo '# Device  Mountpoint  FStype  Options                 Dump    Pass#' > /mnt/etc/fstab
root@kg-v2# echo '/dev/ufs/kirkwoodroot /           ufs     rw,noclusterr,noclusterw    0       0' >> /mnt/etc/fstab
root@kg-v2# echo 'hostname="kg-star.kg4.no"' > /mnt/etc/rc.conf
root@kg-v2# echo 'ifconfig_mge0="DHCP"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'sshd_enable="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'fsck_y_enable="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'background_fsck="NO"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'ntpd_enable="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'ntpd_sync_on_start="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo '** kg-start.kg4.no **' > /mnt/etc/motd
root@kg-v2# echo 'WITHOUT_X11=yes' >> /mnt/etc/make.conf

Umount, , tunefs -L and try to boot it.

root@kg-v2# tunefs -L kirkwoodroot /dev/da4s2a
root@kg-v2# tunefs -p /dev/da4s2a
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  2048
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 kirkwoodroot

Lets see...

da0: 488MB (1000944 512 byte sectors: 64H 32S/T 488C)
Trying to mount root from ufs:/dev/ufs/root
ROOT MOUNT ERROR:
If you have invalid mount options, reboot, and first try the following from
the loader prompt:

     set vfs.root.mountfrom.options=rw

and then remove invalid mount options from /etc/fstab.

Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot> ?

List of GEOM managed disk devices:
  ufs/kirkwoodroot ufsid/4e279ec0073023be da0s2a msdosfs/NO_NAME da0s2 da0s1 da0
Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot> ufs:ufs/kirkwoodroot
Trying to mount root from ufs:ufs/kirkwoodroot
Setting hostuuid: 63f5b2a9-bfde-11d3-9ede-025043b9e188.
Setting hostid: 0x511ae085.
Entropy harvesting: interrupts ethernet point_to_point kickstart.
Starting file system checks:
Mounting local file systems:.
Setting hostname: kg-star.kg4.no.
Starting Network: lo0 mge0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0mge0: link state changed to UP
xff000000
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
mge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
        ether 02:50:43:b9:e1:88
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
Starting devd.
DHCPDISCOVER on mge0 to 255.255.255.255 port 67 interval 4
DHCPOFFER from 10.1.10.1
DHCPREQUEST on mge0 to 255.255.255.255 port 67
DHCPACK from 10.1.10.1
bound to 10.1.10.96 -- renewal in 21600 seconds.
Generating host.conf.

Creating and/or trimming log files.
Starting syslogd.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Clearing /tmp (X related).
Updating motd:.
Starting ntpd.
Generating public/private rsa1 key pair.
Your identification has been saved in /etc/ssh/ssh_host_key.
Your public key has been saved in /etc/ssh/ssh_host_key.pub.
The key fingerprint is:
c9:0e:8b:e4:ee:ed:54:ee:41:e1:e0:32:cf:29:34:ac root@kg-star.kg4.no
The key's randomart image is:
+--[RSA1 1024]----+
|                 |
|                 |
|      . .        |
|   . . + o       |
|    B o S        |
|   = B O         |
|  E + * +        |
|   . + . .       |
|   .o.o .        |
+-----------------+
Generating public/private dsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
a1:f1:21:99:4c:27:b4:1f:f7:4e:c8:72:8a:9a:8d:84 root@kg-star.kg4.no
The key's randomart image is:
+--[ DSA 1024]----+
|     .+ .        |
|     o *         |
|      B + .      |
|       * * o     |
|      . S + o    |
|   .   . + o     |
|  E . . .   .    |
|   . =           |
|    + .          |
+-----------------+
Generating public/private rsa key pair.
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
ae:d4:e3:c2:dd:87:2a:29:ed:da:63:0b:7d:af:b6:ac root@kg-star.kg4.no
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|                 |
|        S        |
|     . o         |
|    .ooo=. .     |
|    .+O=ooo .    |
|    .=EB*+..     |
+-----------------+
Starting sshd.
Starting cron.

Thu Jul 21 04:31:40 UTC 2011

FreeBSD/arm (kg-star.kg4.no) (ttyu0)

login:

It works! Cool!

2011-07-21: trying to build FreeBSD for the DockStar. I'm building on this machine:

tingo@kg-v2$ uname -a
FreeBSD kg-v2.kg4.no 8.2-STABLE FreeBSD 8.2-STABLE #4: Sat Jul 16 02:07:14 CEST 2011     root@kg-v2.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64

and the FreeBSD sources are from the day before. I'm following the cooltrainer.org build instructions, with some changes. I'm NOT patching /usr/src/sys/kern/vfs_mount.c (I'll try without first) Since I have serial port access, I'm not patching /usr/src/etc/rc.d/fsck and not patching master.passwd. I am patching - bind, if_mge.c, /usr/src/sys/conf/files, liblzma, if_axe.c if_axereg.h seems to be patched already 1) making world for ARM

root@kg-v2# make -j 8 buildworld TARGET_ARCH=arm

2) build the kernel for ARM

root@kg-v2# make buildkernel TARGET_ARCH=arm KERNCONF=DOCKSTAR

3) install the kernel

root@kg-v2# mount -t msdosfs /dev/da4s1 /mnt
root@kg-v2# cp /usr/obj/arm/usr/src/sys/DOCKSTAR/kernel.bin /mnt
root@kg-v2# umount /mnt

4) install world

root@kg-v2# mount /dev/da4s2a /mnt
root@kg-v2# env DESTDIR=/mnt make installworld distrib-dirs distribution TARGET_ARCH=arm

In fact, I recreated the root filesystem on the usb drive (ok, memory stick) because that was easier than messing about with chflags and whatnot when deleting everything.

root@kg-v2# newfs -n /dev/da4s2a
/dev/da4s2a: 3790.9MB (7763852 sectors) block size 16384, fragment size 2048
    using 21 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
 160, 376416, 752672, 1128928, 1505184, 1881440, 2257696, 2633952, 3010208, 3386464, 3762720, 4138976, 4515232,
 4891488, 5267744, 5644000, 6020256, 6396512, 6772768, 7149024, 7525280
root@kg-v2# tunefs -L kirkwoodroot /dev/da4s2a

That's all.

5) configure things

root@kg-v2# echo 'send dhcp-client-identifier "kg-star.kg4.no";' >> /mnt/etc/dhclient.conf
root@kg-v2# echo '# Device  Mountpoint  FStype  Options                 Dump    Pass#' > /mnt/etc/fstab
root@kg-v2# echo '/dev/ufs/kirkwoodroot /           ufs     rw,noclusterr,noclusterw    0       0' >> /mnt/etc/fstab
root@kg-v2# echo 'hostname="kg-star.kg4.no"' > /mnt/etc/rc.conf
root@kg-v2# echo 'ifconfig_mge0="DHCP"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'sshd_enable="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'fsck_y_enable="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'background_fsck="NO"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'ntpd_enable="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo 'ntpd_sync_on_start="YES"' >> /mnt/etc/rc.conf
root@kg-v2# echo '** kg-start.kg4.no **' > /mnt/etc/motd
root@kg-v2# echo 'WITHOUT_X11=yes' >> /mnt/etc/make.conf

That's it.Just umount the memory stick and try it. Ok, first boot hangs on the welcome message:

## Starting application at 0x00900000 ...
Copyright (c) 1992-2011 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.2-STABLE #0: Thu Jul 21 03:18:16 CEST 2011
    root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR arm
I forgot to comment out PHYSMEM_SIZE in /usr/src/sys/arm/mv/kirkwood/std.sheevaplug, Fix that and  build a new kernel.
Second try, booting the new kernel
Copyright (c) 1992-2011 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.2-STABLE #1: Thu Jul 21 04:20:24 CEST 2011
    root@kg-v2.kg4.no:/usr/obj/arm/usr/src/sys/DOCKSTAR arm
CPU: Feroceon 88FR131 rev 1 (Marvell core)
  DC enabled IC enabled WB enabled EABT branch prediction enabled
  16KB/32B 4-way Instruction cache
  16KB/32B 4-way write-back-locking-C Data cache
real memory  = 134217728 (128 MB)
avail memory = 125607936 (119 MB)
SOC: Marvell 88F6281 rev A0, TClock 200MHz
mbus0: <Marvell Internal Bus (Mbus)> on motherboard
ic0: <Marvell Integrated Interrupt Controller> at mem 0xf1020200-0xf102023b on mbus0
timer0: <Marvell CPU Timer> at mem 0xf1020300-0xf102032f irq 1 on mbus0
timer0: [FILTER]
rtc0: <Marvell Integrated RTC> at mem 0xf1010300-0xf1010307 on mbus0
gpio0: <Marvell Integrated GPIO Controller> at mem 0xf1010100-0xf101011f irq 35,36,37,38,39,40,41 on mbus0
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
uart0: <16550 or compatible> at mem 0xf1012000-0xf101201f irq 33 on mbus0
uart0: [FILTER]
uart0: console (114678,n,8,1)
uart1: <16550 or compatible> at mem 0xf1012100-0xf101211f irq 34 on mbus0
uart1: [FILTER]
ehci0: <Marvell Integrated USB 2.0 controller> at mem 0xf1050000-0xf1050fff irq 48,19 on mbus0
ehci0: [FILTER]
ehci0: [ITHREAD]
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0: <Marvell Integrated USB 2.0 controller> on ehci0
mge0: <Marvell Gigabit Ethernet controller> at mem 0xf1072000-0xf1073fff irq 12,13,14,11,46 on mbus0
mge0: Ethernet address: 02:50:43:43:52:e7
miibus0: <MII bus> on mge0
e1000phy0: <Marvell 88E1116R Gigabit PHY> PHY 0 on miibus0
e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
mge0: [ITHREAD]
mge0: [ITHREAD]
Timecounter "CPU Timer" frequency 200000000 Hz quality 1000
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <Marvell> at usbus0
uhub0: <Marvell EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 1 port with 1 removable, self powered
Root mount waiting for: usbus0
ugen0.2: <vendor 0x05e3> at usbus0
uhub1: <vendor 0x05e3 USB2.0 Hub, class 9/0, rev 2.00/6.03, addr 2> on usbus0
Root mount waiting for: usbus0
uhub1: 4 ports with 4 removable, self powered
ugen0.3: <Verbatim> at usbus0
umass0: <Verbatim STORE N GO, class 0/0, rev 2.00/1.00, addr 3> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x0000
Root mount waiting for: usbus0
umass0:0:0:-1: Attached to scbus0
Trying to mount root from ufs:/dev/ufs/root
ROOT MOUNT ERROR:
If you have invalid mount options, reboot, and first try the following from
the loader prompt:

     set vfs.root.mountfrom.options=rw

and then remove invalid mount options from /etc/fstab.

Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

Ok, not so good. No amount of messing around with the mountroot> input helps.

2011-07-21: I just verified that my setup (DockStar, usb-ttl cable, memory stick with FreeBSD 8.1-RELEASE-p1) still boots. It does.

2011-02-07: Ok, now I have tried with only

kern.cam.scsi_delay=10000

in /boot/loader.conf. It doesn't make the machine boot, and it doesn't make it hang. I also tried with the delay set to 20000, no change.

2011-02-07: I created a /boot/loader.conf file and added

kern.cam.boot_delay=10000

to it. Still brings me here:

ugen0.3: <Verbatim> at usbus0
umass0: <Verbatim STORE N GO, class 0/0, rev 2.00/1.00, addr 3> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:0:0:-1: Attached to scbus0
Trying to mount root from ufs:/dev/ufs/kirkwoodroot
ROOT MOUNT ERROR:
If you have invalid mount options, reboot, and first try the following from
the loader prompt:

     set vfs.root.mountfrom.options=rw

and then remove invalid mount options from /etc/fstab.

Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot>

pressing any key at the prompt puts the cursor at the left (on the same line as the prompt), then nothing more happens. I also tried with delay set to 20000. Doesn't change anything. Next up is try using kern.cam.scsi_delay instead.

2011-02-07: I've been told to use '.' at the mountroot prompt to see if the usb subsystem needs time to stabilize / detect:

mountroot> ?

List of GEOM managed disk devices:

Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot>

No matter how long I wait, or how many times I enter '.' at the prompt, the list of GEOM devices are empty. Like this:

mountroot> .
Trying to mount root from .
Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot> ?

List of GEOM managed disk devices:

Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot>

That's it.

2011-02-06: trying to boot FreeBSD from the prepared usb memory stick:

U-Boot 2010.09 (Oct 23 2010 - 11:49:22)
Marvell-Dockstar/Pogoplug by Jeff Doozan

SoC:   Kirkwood 88F6281_A0
DRAM:  128 MiB
NAND:  256 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
88E1116 Initialized on egiga0
Hit any key to stop autoboot:  0
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
Loading file "/rescueme" from usb device 0:1 (usbda1)
Failed to mount ext2 filesystem...
** Bad ext2 partition or disk - usb 0:1 **
reading /rescueme.txt

** Unable to read "/rescueme.txt" from usb 0:1 **
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:        1729
UBI: number of bad PEBs:         23
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:             1708
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'!
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
reading kernel.bin

3834548 bytes read
reading kernel.bin

3834548 bytes read
## Starting application at 0x00900000 ...

and now comes the FreeBSSD kernel:

Copyright (c) 1992-2010 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 8.1-RELEASE-p1 #3: Sun Sep 26 21:26:45 EDT 2010
    nicole@Emi.cooltrainer.org:/usr/obj/arm/usr/src/sys/DOCKSTAR-COOLTRAINER arm
CPU: Feroceon 88FR131 rev 1 (Marvell core)
  DC enabled IC enabled WB enabled EABT branch prediction enabled
  16KB/32B 4-way Instruction cache
  16KB/32B 4-way write-back-locking-C Data cache
real memory  = 134217728 (128 MB)
avail memory = 125673472 (119 MB)
SOC: Marvell 88F6281 rev A0, TClock 200MHz
mbus0: <Marvell Internal Bus (Mbus)> on motherboard
ic0: <Marvell Integrated Interrupt Controller> at mem 0xf1020200-0xf102023b on mbus0
timer0: <Marvell CPU Timer> at mem 0xf1020300-0xf102032f irq 1 on mbus0
timer0: [FILTER]
rtc0: <Marvell Integrated RTC> at mem 0xf1010300-0xf1010307 on mbus0
gpio0: <Marvell Integrated GPIO Controller> at mem 0xf1010100-0xf101011f irq 35,36,37,38,39,40,41 on mbus0
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
gpio0: [FILTER]
uart0: <16550 or compatible> at mem 0xf1012000-0xf101201f irq 33 on mbus0
uart0: [FILTER]
uart0: console (114678,n,8,1)
uart1: <16550 or compatible> at mem 0xf1012100-0xf101211f irq 34 on mbus0
uart1: [FILTER]
ehci0: <Marvell Integrated USB 2.0 controller> at mem 0xf1050000-0xf1050fff irq 48,19 on mbus0
ehci0: [FILTER]
ehci0: [ITHREAD]
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0: <Marvell Integrated USB 2.0 controller> on ehci0
mge0: <Marvell Gigabit Ethernet controller> at mem 0xf1072000-0xf1073fff irq 12,13,14,11,46 on mbus0
mge0: Ethernet address: 02:50:43:4f:87:9d
miibus0: <MII bus> on mge0
e1000phy0: <Marvell 88E1116R Gigabit PHY> PHY 0 on miibus0
e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
mge0: [ITHREAD]
mge0: [ITHREAD]
Timecounter "CPU Timer" frequency 200000000 Hz quality 1000
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <Marvell> at usbus0
uhub0: <Marvell EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 1 port with 1 removable, self powered
ugen0.2: <vendor 0x05e3> at usbus0
uhub1: <vendor 0x05e3 USB2.0 Hub, class 9/0, rev 2.00/6.03, addr 2> on usbus0
uhub1: 4 ports with 4 removable, self powered
ugen0.3: <Verbatim> at usbus0
umass0: <Verbatim STORE N GO, class 0/0, rev 2.00/1.00, addr 3> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x0000
umass0:0:0:-1: Attached to scbus0
Trying to mount root from ufs:/dev/ufs/kirkwoodroot
ROOT MOUNT ERROR:
If you have invalid mount options, reboot, and first try the following from
the loader prompt:

     set vfs.root.mountfrom.options=rw

and then remove invalid mount options from /etc/fstab.

Loader variables:
vfs.root.mountfrom=
vfs.root.mountfrom.options=

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
                       eg. ufs:/dev/da0s1a
                       eg. cd9660:/dev/acd0
                       This is equivalent to: mount -t cd9660 /dev/acd0 /

  ?                  List valid disk boot devices
  <empty line>       Abort manual input

mountroot>

Ouch!

2011-02-06: changing the bootloader variables: The old ones looks like this:

debian:~# fw_printenv 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
debian:~# fw_printenv usb_init
usb_init=run usb_scan
debian:~#

new ones:

fw_setenv usb_boot 'fatload usb $usb_device 0x900000 kernel.bin; go 0x900000;'
fw_setenv usb_init 'usb start; if fatload usb 0 0x900000 kernel.bin; then setenv usb_device 0; elif fatload usb 1 0x900000 kernel.bin; then setenv usb_device 1; elif fatload usb 2 0x900000 kernel.bin; then setenv usb_device 2; elif fatload usb 3 0x900000 kernel.bin; then setenv usb_device 3; elif fatload usb 4 0x900000 kernel.bin; then setenv usb_device 4; else run pogo_bootcmd; fi;'

and verified with printenv.

2011-02-06: preparing a usb memory stick for the DockStar:

root@kg-v2# gpart create -s MBR da4
da4 created
root@kg-v2# gpart add -s 32M -t freebsd da4
da4s1 added
root@kg-v2# gpart add -t freebsd da4
da4s2 added
root@kg-v2# newfs_msdos /dev/da4s1
/dev/da4s1: 65416 sectors in 8177 FAT16 clusters (4096 bytes/cluster)
BytesPerSec=512 SecPerClust=8 ResSectors=1 FATs=2 RootDirEnts=512 Sectors=65520 Media=0xf0 FATsecs=32 SecPerTrack=63 Heads=255 HiddenSecs=0
root@kg-v2# bsdlabel -w /dev/da4s2
root@kg-v2# newfs -n /dev/da4s2a
/dev/da4s2a: 3790.9MB (7763852 sectors) block size 16384, fragment size 2048
    using 21 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
super-block backups (for fsck -b #) at:
 160, 376416, 752672, 1128928, 1505184, 1881440, 2257696, 2633952, 3010208, 3386464, 3762720, 4138976, 4515232,
 4891488, 5267744, 5644000, 6020256, 6396512, 6772768, 7149024, 7525280
root@kg-v2# tunefs -L kirkwoodroot /dev/da4s2a

Start filling it. First the kernel:

root@kg-v2# mount -t msdosfs /dev/da4s1 /mnt
root@kg-v2# cp /home/tingo/doc/Seagate/DockStar/FreeBSD/DOCKSTAR.bin /mnt/kernel.bin
root@kg-v2# umount /mnt

then install the world:

root@kg-v2# mount /dev/da4s2a /mnt
root@kg-v2# cd /mnt
tar xvf /home/tingo/doc/Seagate/DockStar/FreeBSD/8.1-RELEASE-p1.tar.gz

after that I just fixed the hostname, set up dhcp static ip via /etc/dhclient.conf and so on. Finally:

root@kg-v2# cd
root@kg-v2# umount /mnt

and you are ready to plug it into the DockStar.