Seagate FreeAgent Dockstar sous OpenWrt

De MicElectroLinGenMet.

(Retour Accueil ou Liste des articles)

Sommaire

Description

Page Seagate: http://www.seagate.com/www/fr-fr/products/network_storage/freeagent_dockstar/

De base, le FreeAgent DockStar est une station d'accueil pour disque USB Seagate Free Agent Go à relier au réseau.
C'est aussi un serveur "embarquée" à base de processeur Marvell comme le Sheevaplug, qui peux donc faire tourner un autre OS comme OpenWrt ou Debian ...
Actuellement en fin de vente, il était disponible à 15,50€ dans certaines boutiques.


Caractéristiques du FreeAgent DockStar:

  • Processeur ARM Marvell Kirkwood 1,2 GHz
  • 128Mo de RAM
  • 256Mo de mémoire Flash NAND, dont ~32Mo occupés par le système / firmware / booloader
  • 3 ports USB
  • 1 port mini-USB (le port du haut du dock est en fait un mini-USB mâle standard)
  • 1 port Ethernet Gigabit
  • Consommation annoncée: maximum 8W, selon le fonctionnement (et en incluant la consommation d'un HDD 2.5")
  • 8,6 x 8,5 x 3,8, cm (long. x larg. x haut.) / Poids : 0,50 kg


Format de la NAND:

	4 MTD partitions on "NAND 256MiB 3,3V 8-bit":
	0x000000000000-0x000000100000 : "u-boot"		size 00100000
	0x000000100000-0x000000500000 : "uImage"		size 00400000
	0x000000500000-0x000002500000 : "rootfs"		size 02000000
	0x000002500000-0x000010000000 : "rootfs_data"		size 0db00000


Connexion à l'OS d'origine du Seagate DockStar

Dockstar relié en direct sur un PC Linux (sur eth0 eee) pour éviter une mise à jour si connecté à Internet.

Si la LED clignote orange au boot cela indique que le FreeAgent Dockstar n'a pas booté correctement, cela peux signifier aussi qu'il n'a pas obtenu d'@IP !
Si pas de succès pour le joindre en IP, le "reseter" ou le relancer electriquement !


Configurer @IP du PC sur réseau du dockstar

# ifconfig eth0 169.254.1.0


Recherche @IP du dockstar

# nmap -e eth0 -sP 169.254.0.0/16
ou
# netdiscover  -r 169.254.0.0/16 -P
Currently scanning: 169.254.87.0/16   |   Our Mac is: 00:1e:8c:xx:xx:xx - 0

1 Captured ARP Req/Rep packets, from 1 hosts.   Total size: 60
_____________________________________________________________________________
  IP            At MAC Address      Count  Len   MAC Vendor
-----------------------------------------------------------------------------
169.254.36.83   00:10:75:xx:xx:xx    01    060   Maxtor Corporation


Connexion au dockstar

$ ssh root@169.254.36.83
root@169.254.36.83's password:					=> password = stxadmin 
-bash-3.2# uname -a
Linux Pogoplug 2.6.22.18 #57 Mon Aug 31 16:31:01 PDT 2009 armv5tejl unknown

-bash-3.2# ps
 PID  Uid        VSZ Stat Command
   1 root       3400 S   init
   2 root            SW< [kthreadd]
   3 root            SWN [ksoftirqd/0]
   4 root            SW< [events/0]
   5 root            SW< [khelper]
  46 root            SW< [kblockd/0]
  49 root            SW< [khubd]
  51 root            SW< [kmmcd]
  65 root            SW  [crypto]
  66 root            SW  [crypto_ret]
  71 root            SW  [pdflush]
  72 root            SW  [pdflush]
  73 root            SW< [kswapd0]
  74 root            SW< [aio/0]
 227 root            SW< [mtdblockd]
 228 root            SW< [nftld]
 262 root            SW< [kcryptd/0]
 308 root       3404 D   udhcpc -b Pogoplug
 310 root       3400 S   telnetd
 313 root       2100 S   /usr/sbin/dropbear
 315 root       3208 S   ntpd -g
 319 root       3208 S   ntpd -g
 337 root            SW< [xce]
 338 root       1696 S   /usr/local/cloudengines/bin/hbwd /usr/local/cloudengines/bin/hbplug
 339 root       2672 S   -sh
 340 root      11592 S   /usr/local/cloudengines/bin/hbplug
 480 root       2580 R   /usr/sbin/dropbear
 481 root       2676 R   -bash
 484 root       3404 R   ps

-bash-3.2# mount
rootfs on / type rootfs (rw)
/dev/root on / type jffs2 (ro)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw)
none on /tmp type tmpfs (rw)

-bash-3.2# free
             total         used         free       shared      buffers
  Mem:       126064        18820       107244            0            0
 Swap:            0            0            0
Total:       126064        18820       107244

-bash-3.2# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/mtdblock2           32.0M     14.9M     17.1M  47% /
none                     61.6M      4.0k     61.6M   0% /tmp

-bash-3.2# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00100000 00020000 "u-boot"
mtd1: 00400000 00020000 "uImage"
mtd2: 02000000 00020000 "root"
mtd3: 0db00000 00020000 "data"


Busybox du Dockstar

-bash-3.2# busybox
BusyBox v1.7.0 (2008-02-26 19:25:17 IST) multi-call binary
Copyright (C) 1998-2006  Erik Andersen, Rob Landley, and others.
Licensed under GPLv2.  See source distribution for full notice.

Usage: busybox [function] [arguments]...
  or: [function] [arguments]...

       BusyBox is a multi-call binary that combines many common Unix
       utilities into a single executable.  Most people will create a
       link to busybox for each function they wish to use and BusyBox
       will act like whatever it was invoked as!

Currently defined functions:
       [, [[, addgroup, adduser, adjtimex, ar, arp, arping, ash, awk, basename,
       bunzip2, bzcat, cal, cat, catv, chattr, chgrp, chmod, chown, chpasswd,
       chpst, chroot, chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond,
       crontab, cryptpw, cut, date, dc, dd, deallocvt, delgroup, deluser, df,
       dhcprelay, diff, dirname, dmesg, dnsd, dos2unix, du, dumpkmap, dumpleases,
       echo, ed, egrep, eject, env, envdir, envuidgid, ether-wake, expand, expr,
       fakeidentd, false, fbset, fdflush, fdformat, fdisk, fgrep, find, fold,
       free, freeramdisk, fsck, fsck.minix, ftpget, ftpput, fuser, getopt, getty,
       grep, gunzip, gzip, halt, hdparm, head, hexdump, hostid, hostname, httpd,
       hwclock, id, ifconfig, ifdown, ifup, inetd, init, insmod, install, ip,
       ipaddr, ipcalc, ipcrm, ipcs, iplink, iproute, iprule, iptunnel, kill,
       killall, killall5, klogd, last, length, less, linux32, linux64, linuxrc,
       ln, loadfont, loadkmap, logger, login, logname, logread, losetup, ls,
       lsattr, lsmod, lzmacat, makedevs, md5sum, mdev, mesg, mkdir, mkfifo,
       mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, mountpoint,
       mt, mv, nameif, nc, netstat, nice, nmeter, nohup, nslookup, od, openvt,
       passwd, patch, pidof, ping, ping6, pipe_progress, pivot_root, poweroff,
       printenv, printf, ps, pscan, pwd, raidautorun, rdate, readahead, readlink,
       readprofile, realpath, reboot, renice, reset, resize, rm, rmdir, rmmod,
       route, rpm, rpm2cpio, run-parts, runlevel, runsv, runsvdir, rx, sed,
       seq, setarch, setconsole, setkeycodes, setlogcons, setsid, setuidgid,
       sh, sha1sum, slattach, sleep, softlimit, sort, split, start-stop-daemon,
       stat, strings, stty, su, sulogin, sum, sv, svlogd, swapoff, swapon, switch_root,
       sync, sysctl, syslogd, tail, tar, taskset, tcpsvd, tee, telnet, telnetd,
       test, tftp, time, top, touch, tr, traceroute, true, tty, ttysize, udhcpc,
       udhcpd, udpsvd, umount, uname, uncompress, unexpand, uniq, unix2dos,
       unlzma, unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, vlock,
       watch, watchdog, wc, wget, which, who, whoami, xargs, yes, zcat, zcip


Fichier dmesg au boot du Pogoplug

-bash-3.2# dmesg
[    0.000000] Linux version 2.6.22.18 (bdietrich@brad-ux) (gcc version 4.2.1) #57 Mon Aug 31 16:31:01 PDT 2009
[    0.000000] CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053177
[    0.000000] Machine: Feroceon-KW
[    0.000000] Using UBoot passing parameters structure
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 32768
[    0.000000]   DMA zone: 256 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 32512 pages, LIFO batch:7
[    0.000000]   Normal zone: 0 pages used for memmap
[    0.000000] CPU0: D VIVT write-back cache
[    0.000000] CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
[    0.000000] CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
[    0.000000] Built 1 zonelists.  Total pages: 32512
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/mtdblock2 ro
[    0.000000] PID hash table entries: 512 (order: 9, 2048 bytes)
[    0.000000] Console: colour dummy device 80x30
[    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: 128MB 0MB 0MB 0MB = 128MB total
[    0.000000] Memory: 125824KB available (3588K code, 252K data, 120K init)
[    0.000000] Calibrating delay loop... 1192.75 BogoMIPS (lpj=5963776)
[    0.240000] Mount-cache hash table entries: 512
[    0.240000] CPU: Testing write buffer coherency: ok
[    0.240000] NET: Registered protocol family 16
[    0.240000]
[    0.240000] CPU Interface
[    0.240000] -------------
[    0.240000] SDRAM_CS0 ....base 00000000, size 128MB
[    0.240000] SDRAM_CS1 ....disable
[    0.240000] SDRAM_CS2 ....disable
[    0.240000] SDRAM_CS3 ....disable
[    0.240000] PEX0_MEM ....base e8000000, size 128MB
[    0.240000] PEX0_IO ....base f2000000, size   1MB
[    0.240000] INTER_REGS ....base f1000000, size   1MB
[    0.240000] NFLASH_CS ....base fa000000, size   2MB
[    0.240000] SPI_CS ....base f4000000, size  16MB
[    0.240000] BOOT_ROM_CS ....no such
[    0.240000] DEV_BOOTCS ....no such
[    0.240000] CRYPT_ENG ....base f0000000, size   2MB
[    0.240000]
[    0.240000]   Marvell Development Board (LSP Version KW_LSP_4.2.7_patch21_with_rx_desc_tuned)-- SHEEVA PLUG  Soc: 88F6281 A0 LE
[    0.240000]
[    0.240000]  Detected Tclk 200000000 and SysClk 400000000
[    0.240000] MV Buttons Device Load
[    0.240000] Marvell USB EHCI Host controller #0: c0537600
[    0.740000] PEX0 interface detected no Link.
[    0.740000] PCI: bus0: Fast back to back transfers enabled
[    0.740000] SCSI subsystem initialized
[    0.740000] usbcore: registered new interface driver usbfs
[    0.740000] usbcore: registered new interface driver hub
[    0.740000] usbcore: registered new device driver usb
[    0.740000] NET: Registered protocol family 2
[    0.750000] Time: kw_clocksource clocksource has been installed.
[    0.840000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.840000] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[    0.840000] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
[    0.840000] TCP: Hash tables configured (established 4096 bind 4096)
[    0.840000] TCP reno registered
[    0.870000] RTC has been updated!!!
[    0.870000] RTC registered
[    0.870000] Use the XOR engines (acceleration) for enhancing the following functions:
[    0.870000]   o RAID 5 Xor calculation
[    0.870000]   o kernel memcpy
[    0.870000]   o kenrel memzero
[    0.870000] Number of XOR engines to use: 4
[    0.870000] cesadev_init(c00116b4)
[    0.870000] mvCesaInit: sessions=640, queue=64, pSram=f0000000
[    0.870000] MV Buttons Driver Load
[    0.870000] squashfs: version 3.3 (2007/10/31) Phillip Lougher
[    0.870000] squashfs: LZMA suppport for slax.org by jro
[    0.870000] JFFS2 version 2.2. (NAND) é 2001-2006 Red Hat, Inc.
[    0.870000] io scheduler noop registered
[    0.870000] io scheduler anticipatory registered (default)
[    0.890000] Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
[    0.890000] serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
[    0.900000] serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
[    0.900000] RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
[    0.910000] Loading Marvell Ethernet Driver:
[    0.920000]   o Cached descriptors in DRAM
[    0.920000]   o DRAM SW cache-coherency
[    0.920000]   o Single RX Queue support - ETH_DEF_RXQ=0
[    0.930000]   o Single TX Queue support - ETH_DEF_TXQ=0
[    0.940000]   o TCP segmentation offload enabled
[    0.940000]   o Receive checksum offload enabled
[    0.940000]   o Transmit checksum offload enabled
[    0.950000]   o Network Fast Processing (Routing) supported
[    0.960000]   o Driver ERROR statistics enabled
[    0.960000]   o Driver INFO statistics enabled
[    0.960000]   o Proc tool API enabled
[    0.970000]   o Rx descripors: q0=128
[    0.970000]   o Tx descripors: q0=532
[    0.980000]   o Loading network interface(s):
[    0.980000]     o eth0, ifindex = 1, GbE port = 0
[    0.990000]     o eth1, ifindex = 2, GbE port = 1
[    0.990000]
[    1.000000] mvFpRuleDb (c7ed5000): 1024 entries, 4096 bytes
[    1.000000] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI
[    1.010000] Copyright (c) 1999-2006 Intel Corporation.
[    1.010000] e100: Intel(R) PRO/100 Network Driver, 3.5.17-k4-NAPI
[    1.020000] e100: Copyright(c) 1999-2006 Intel Corporation
[    1.020000]
[    1.020000] Warning Sata is Powered Off
[    1.030000] NFTL driver: nftlcore.c $Revision: 1.98 $, nftlmount.c $Revision: 1.41 $
[    1.040000] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
[    1.050000] Scanning device for bad blocks
[    1.150000] Using static partition definition
[    1.150000] Creating 4 MTD partitions on "nand_mtd":
[    1.160000] 0x00000000-0x00100000 : "u-boot"
[    1.160000] 0x00100000-0x00500000 : "uImage"
[    1.170000] 0x00500000-0x02500000 : "root"
[    1.170000] 0x02500000-0x10000000 : "data"
[    1.180000] ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
[    1.180000] ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
[    1.220000] ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
[    1.240000] ehci_marvell ehci_marvell.70059: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
[    1.240000] usb usb1: configuration #1 chosen from 1 choice
[    1.250000] hub 1-0:1.0: USB hub found
[    1.250000] hub 1-0:1.0: 1 port detected
[    1.370000] ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.370000] USB Universal Host Controller Interface driver v3.0
[    1.650000] usb 1-1: new high speed USB device using ehci_marvell and address 2
[    1.800000] usb 1-1: configuration #1 chosen from 1 choice
[    1.800000] hub 1-1:1.0: USB hub found
[    1.810000] hub 1-1:1.0: 4 ports detected
[    1.920000] usbcore: registered new interface driver usblp
[    1.920000] drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
[    1.930000] Initializing USB Mass Storage driver...
[    1.930000] usbcore: registered new interface driver usb-storage
[    1.940000] USB Mass Storage support registered.
[    1.950000] mice: PS/2 mouse device common for all mice
[    1.950000] i2c /dev entries driver
[    1.950000] Linux telephony interface: v1.00
[    1.960000] md: linear personality registered for level -1
[    1.960000] md: raid0 personality registered for level 0
[    1.970000] md: raid1 personality registered for level 1
[    2.140000] raid6: int32x1     97 MB/s
[    2.310000] raid6: int32x2    114 MB/s
[    2.480000] raid6: int32x4    122 MB/s
[    2.650000] raid6: int32x8    110 MB/s
[    2.650000] raid6: using algorithm int32x4 (122 MB/s)
[    2.650000] md: raid6 personality registered for level 6
[    2.660000] md: raid5 personality registered for level 5
[    2.660000] md: raid4 personality registered for level 4
[    2.670000] raid5: measuring checksumming speed
[    2.720000]    arm4regs  :  1084.000 MB/sec
[    2.770000]    8regs     :   754.800 MB/sec
[    2.820000]    32regs    :   900.000 MB/sec
[    2.820000] raid5: using function: arm4regs (1084.000 MB/sec)
[    2.830000] device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
[    2.830000] dm_crypt using the OCF package.
[    2.840000] sdhci: Secure Digital Host Controller Interface driver
[    2.840000] sdhci: Copyright(c) Pierre Ossman
[    2.850000] usbcore: registered new interface driver usbhid
[    2.850000] drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
[    2.860000] TCP cubic registered
[    2.860000] NET: Registered protocol family 1
[    2.870000] NET: Registered protocol family 17
[    2.870000] md: Autodetecting RAID arrays.
[    2.880000] md: autorun ...
[    2.880000] md: ... autorun DONE.
[    7.500000] Empty flash at 0x00de8e44 ends at 0x00de9000
[    7.660000] VFS: Mounted root (jffs2 filesystem) readonly.
[    7.660000] Freeing init memory: 120K
[    9.770000] eth0: link down
[    9.770000] eth0: started
[   11.390000] eth0: link up, full duplex, speed 100 Mbps
[   19.970000] fuse init (API version 7.8)
[   20.350000] ufsd: module license 'Commercial product' taints kernel.
[   20.510000] ufsd: driver loaded at bf040000 built on Aug  5 2009 15:35:26
[   20.510000] UFSD version 7.07 (Aug  5 2009, 15:29:19)
[   20.510000] NTFS read/write support included
[   20.510000] Hfs+/HfsX read/write support included
[   20.510000] $Id: ufsdvfs.c,v 1.226 2009/07/30 16:04:07 shura Exp $ (LBD=ON)
[   20.530000] tun: Universal TUN/TAP device driver, 1.6
[   20.540000] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[   20.560000] Cloud Engines XCE Init [Version: 1.0.0.20]
[   20.570000] XCE: CPU MEMORY MAP:
[   20.570000] XCE:   -- 0x00001000 - 0xbeffffff (3055 MB)  User Space Mappings
[   20.580000] XCE:   -- 0xbf000000 - 0xbfffffff (  16 MB)  Kernel module space
[   20.590000] XCE:   -- 0xc0000000 - 0xc7ffffff ( 128 MB)  Kernel direct-mapped ram
[   20.590000] XCE:   -- 0xc8800000 - 0xe7ffffff ( 504 MB)  Kernel vmalloc space
[   20.600000] XCE:   -- 0xe8000000 - 0xfeffffff ( 367 MB)  Kernel platform space
[   20.610000] XCE: Current GPIO State:
[   20.610000] XCE:  GPIO L OUT:    0xeff00000
[   20.620000] XCE:  GPIO L OE:     0xefffffff
[   20.620000] XCE:  GPIO L BLINK:  0x00000000
[   20.630000] XCE:  GPIO L POL:    0x00000000
[   20.630000] XCE:  GPIO L IN:     0xeff00080
[   20.630000] XCE:  GPIO H OUT:    0xfffeffff
[   20.640000] XCE:  GPIO H OE:     0xfffc3fff
[   20.640000] XCE:  GPIO H BLINK:  0x00000000
[   20.650000] XCE:  GPIO H POL:    0x00000000
[   20.650000] XCE:  GPIO H IN:     0x0002fffd
[   20.660000] XCE: Kernel thread starting PID: 337
[   20.660000] XCE:    -- 'wdog=off
[   20.660000] '
[   21.650000] XCE: BLPARAMS:   -- Loading properties [c7101f04].
[   21.660000] XCE: BLPARAMS: reading 2048 bytes @ a0000
[   21.670000] XCE: BLPARAMS: reading 2048 bytes @ a0800
[   21.670000] XCE: BLPARAMS: reading 2048 bytes @ a1000
[   21.680000] XCE: BLPARAMS: reading 2048 bytes @ a1800
[   26.860000] XCE:    -- 'led0=0'


Désactiver le logiciel du dockstar

Source: http://ahsoftware.de/dockstar/

Bloque les les mise à jour Internet

-bash-3.2# mount -o remount,rw /
-bash-3.2# chmod go+w /dev/null

Modifier fichier: /etc/init.d/rcS

-bash-3.2# vi /etc/init.d/rcS
...
#/etc/init.d/hbmgr.sh start			=> Ligne commentée
...
-bash-3.2# mount -o remount,ro /

Dockstar relié au lan

-bash-3.2# ip addr
1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 532
    link/ether 00:10:75:xx:xx:xx brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.24/24 brd 192.168.0.255 scope global eth0				=> @IP dhcp du LAN
    inet 169.254.36.83/16 brd 169.254.255.255 scope global eth0:0
2: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 532
    link/ether 00:00:00:00:00:81 brd ff:ff:ff:ff:ff:ff
3: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo



Installer OpenWrt

Voir maintenant la branche OpenWrt officielle pour le Dockstar.

Howto utilisé ci-dessous avant la version officielle: http://www.cs.cmu.edu/~ecc/dockstar-howto.html

Copie des binaires précompilées ur une clef USB

Binaires OpenWrt compilés par ecc (https://forum.openwrt.org/viewtopic.php?id=25603):

http://plugapps.com/os/pogoplug/uboot/blparam
http://www.cs.cmu.edu/~ecc/download/dockstar-uImage
http://www.cs.cmu.edu/~ecc/download/dockstar-rootfs
http://www.cs.cmu.edu/~ecc/download/MD5SUMS
dan@eee:~$ md5sum -c MD5SUMS
dockstar-rootfs: OK
dockstar-uImage: OK


Connecter la clef sur le Dockstart

-bash-3.2# dmesg|tail -20
[  174.770000] usb 1-1.4: new full speed USB device using ehci_marvell and address 3
[  174.870000] usb 1-1.4: configuration #1 chosen from 1 choice
[  174.880000] scsi0 : SCSI emulation for USB Mass Storage devices
[  174.880000] usb-storage: device found at 3
[  174.880000] usb-storage: waiting for device to settle before scanning
[  179.880000] scsi 0:0:0:0: Direct-Access              USB DISK Pro     1.17 PQ: 0 ANSI: 0 CCS
[  179.890000] sd 0:0:0:0: [sda] 123904 512-byte hardware sectors (63 MB)
[  179.900000] sd 0:0:0:0: [sda] Write Protect is off
[  179.900000] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  179.900000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  179.910000] sd 0:0:0:0: [sda] 123904 512-byte hardware sectors (63 MB)
[  179.920000] sd 0:0:0:0: [sda] Write Protect is off
[  179.920000] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[  179.920000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  179.930000]  sda: sda1
[  179.940000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  179.940000] sd 0:0:0:0: Attached scsi generic sg0 type 0
-bash-3.2# mount /dev/sda1 /mnt
-bash-3.2# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/mtdblock2           32.0M     14.9M     17.1M  47% /
none                     61.6M      4.0k     61.6M   0% /tmp
/dev/sda1                58.5M     10.5M     45.0M  19% /mnt


Affiche les paramètres u-boot d'origine avant modifications

-bash-3.2# ./blparam
baudrate=115200
loads_echo=0
ipaddr=169.254.254.253
serverip=169.254.254.254
rootpath=/mnt/ARM_FS/
netmask=255.255.0.0
run_diag=yes
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/mtdblock2 ro
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
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
ethaddr=00:10:75:xx:xx:xx
cesvcid=6UQX37NNJL85RGNQ5RKCBM5DDN
ceserialno=2GEP09HS
ceboardver=REDSTONE:1.0
bootcmd=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000

Rajout de paramètres u-boot

-bash-3.2# ./blparam arcNumber=2097
MTD: /dev/mtd0
     type:          4
     flags:         0x400
     size:          1048576
     erase size:    131072
     write size:    2048
     oob size:      64
  -- Adding parameter 'arcNumber=2097'
  ...
  -- Writing parameter 'arcNumber=2097'
Erasing 128 kb @ 0xa0000
Writing 2048 kb @ 0xbf800
***
*** BOOT LOADER PARAMETERS CHANGED -- REBOOT NECESSARY TO TAKE EFFECT!
***


-bash-3.2# ./blparam mainlineLinux=yes
MTD: /dev/mtd0
     type:          4
     flags:         0x400
     size:          1048576
     erase size:    131072
     write size:    2048
     oob size:      64
  -- Removing parameter 'mainlineLinux' from 'no' because 'mainlineLinux=yes'
  -- Adding parameter 'mainlineLinux=yes'
  ...
  -- Writing parameter 'mainlineLinux=yes'
Erasing 128 kb @ 0xa0000
Writing 2048 kb @ 0xbf800
***
*** BOOT LOADER PARAMETERS CHANGED -- REBOOT NECESSARY TO TAKE EFFECT!


Flash le kernel (uImage)

-bash-3.2# flash_eraseall /dev/mtd1
Erasing 128 Kibyte @ 3e0000 -- 96 % complete.
-bash-3.2# nandwrite /dev/mtd1 dockstar-uImage
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000
Writing data to block 80000
Writing data to block a0000
Writing data to block c0000

Flash le rootfs

-bash-3.2# flash_eraseall /dev/mtd2
Erasing 128 Kibyte @ 1fe0000 -- 99 % complete.
-bash-3.2# nandwrite /dev/mtd2 dockstar-rootfs
Writing data to block 0
Writing data to block 20000
Writing data to block 40000
Writing data to block 60000
Writing data to block 80000
Writing data to block a0000
Writing data to block c0000
Writing data to block e0000
Writing data to block 100000
Writing data to block 120000
Writing data to block 140000
Writing data to block 160000
Writing data to block 180000
Writing data to block 1a0000
Writing data to block 1c0000
Writing data to block 1e0000

Efface la partition mtd3

-bash-3.2# flash_eraseall /dev/mtd3
Erasing 128 Kibyte @ dae0000 -- 99 % complete.


Demontage clef et reboot

-bash-3.2# busybox umount /mnt
-bash-3.2# busybox reboot


Premier boot sur OpenWrt

dan@eee:~$ telnet 192.168.0.24
Trying 192.168.0.24...
Connected to 192.168.0.24.
Escape character is '^]'.
 === IMPORTANT ============================
  Use 'passwd' to set your login password			=> Pour activer SSH !
  this will disable telnet and enable SSH
 ------------------------------------------


BusyBox v1.16.2 (2010-07-24 21:32:22 EDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r22442) ------------------		=> Version ecc.
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#


root@dockstar:~# opkg list-installed  
base-files - 51-r22442
busybox - 1.16.2-1
dropbear - 0.52-5
e2fsprogs - 1.41.12-1
hotplug2 - 1.0-beta-2
kernel - 2.6.30.10-1
kmod-fs-nfs - 2.6.30.10-1
kmod-fs-nfs-common - 2.6.30.10-1
kmod-fs-vfat - 2.6.30.10-1
kmod-leds-gpio - 2.6.30.10-1
kmod-nls-base - 2.6.30.10-1
kmod-nls-cp437 - 2.6.30.10-1
kmod-nls-iso8859-1 - 2.6.30.10-1
ldd - 0.9.30.2-51
libblkid - 1.41.12-1
libc - 0.9.30.2-51
libevent - 1.4.13-2
libext2fs - 1.41.12-1
libgcc - 4.4.4-51
libiptc - 1.4.8-1
liblua - 5.1.4-6
liblzo - 2.03-3
libpopt - 1.7-5
libpthread - 0.9.30.2-51
librt - 0.9.30.2-51
libuci - 12012009.5-2
libuci-lua - 12012009.5-2
libusb - 0.1.12-2
libuuid - 1.41.12-1
libwrap - 7.6-1
lua - 5.1.4-6
luci-admin-core - 0.9+svn6221-1
luci-admin-full - 0.9+svn6221-1
luci-admin-mini - 0.9+svn6221-1
luci-app-initmgr - 0.9+svn6221-1
luci-cbi - 0.9+svn6221-1
luci-core - 0.9+svn6221-1
luci-http - 0.9+svn6221-1
luci-i18n-english - 0.9+svn6221-1
luci-ipkg - 0.9+svn6221-1
luci-lmo - 0.9+svn6221-1
luci-medium - 0.9+svn6221-1
luci-nixio - 0.9+svn6221-1
luci-sgi-cgi - 0.9+svn6221-1
luci-sys - 0.9+svn6221-1
luci-theme-base - 0.9+svn6221-1
luci-theme-openwrt - 0.9+svn6221-1
luci-theme-openwrtlight - 0.9+svn6221-1
luci-uci - 0.9+svn6221-1
luci-uvl - 0.9+svn6221-1
luci-web - 0.9+svn6221-1
mtd - 13
mtd-utils - 20090227-1
nfs-utils - 1.1.6-1
ntpclient - 2007_365-4
opkg - 528-1
portmap - 6.0-2
rsync - 3.0.7-1
uboot-envtools - 20081215-2
uci - 12012009.5-2
udevtrigger - 106-1
uhttpd - 12
usbutils - 0.86-2
zlib - 1.2.3-5


root@dockstar:~# cat /proc/cpuinfo 
Processor       : Feroceon 88FR131 rev 1 (v5l)
BogoMIPS        : 1192.75
Features        : swp half fastmult edsp 
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant     : 0x2
CPU part        : 0x131
CPU revision    : 1

Hardware        : Seagate DockStar
Revision        : 0000
Serial          : 0000000000000000


root@dockstar:~# ls -l /sys/devices/platform/leds-gpio/leds/
drwxr-xr-x    2 root     root             0 Aug  2 16:11 dockstar:green:health
drwxr-xr-x    2 root     root             0 Aug  2 16:24 dockstar:orange:misc



Compiler les images à partir de KAMIKAZE (trunk)

Forum: https://forum.openwrt.org/viewtopic.php?pid=114226#p114226


ecc a fourni sur (http://www.cs.cmu.edu/~ecc/download) son .config OpenWrt/kernel ainsi que les patches de patches pour le kernel:

OK, I've uploaded the patches correspponding to my pre-built images. 
The openwrt.config is ".config" in the top level; 
the other patches should apply to "trunk".  
Note that the kernel patches are actually "patches of patches" -- 
they modify the patches that the OpenWrt build system applies to the kernel source when first unpacking it.  
So you should apply these in a clean tree with no kernel (i.e. do "make target/linux/clean" first).


Installation de kamikaze trunk

$ svn co svn://svn.openwrt.org/openwrt/trunk/
$ cd trunk


Config + patches ecc

$ cp ~/Seagate-DockStar/OpenWrt_ecc/openwrt.config .config								=> .config

$ patch -p1 < ~/Seagate-DockStar/OpenWrt_ecc/0003-use-DHCP-by-default-for-DockStar-Ethernet-interface.patch 		=> Patche config. reseau
patching file package/base-files/files/etc/config/network

$ patch -p1 < ~/Seagate-DockStar/OpenWrt_ecc/0001-kernel-patches-for-Seagate-DockStar.patch  				=> Patche NAND et LED dockstar          
patching file target/linux/kirkwood/patches/001-openwrt_partition_map.patch
patching file target/linux/kirkwood/patches/005-dockstar_leds.patch
patching file target/linux/kirkwood/patches/006-dockstar_name.patch

$ patch -p1 < ~/Seagate-DockStar/OpenWrt_ecc/0002-default-kernel-config-for-Seagate-DockStar.patch 			=> .config kernel
patching file target/linux/kirkwood/config-default


Ajouts de packages dans feed

$ ./scripts/feeds list 						=> Affiche list des packages dispo.

$ ./scripts/feeds install -d y owserver owshell owfs
$ ./scripts/feeds install -d y setserial
$ ./scripts/feeds install -d y sqlite3-cli
$ ./scripts/feeds install -d y usbutils
$ ./scripts/feeds install -d y portmap
$ ./scripts/feeds install -d m ser2net

Config. et compilation

$ make menuconfig		=> Rajout driver usb-serial ftdi / cp210x / pl2303 inclus dans image.
$ make


Fichier .config kernel: build_dir/linux-kirkwood/linux-2.6.30.10/.config

$ make kernel_menuconfig	=> Rajout driver usb-serial ftdi / cp210x / pl2303 en modules.
$ make
...

Images et packages compilés

$ l bin/kirkwood/
total 9,4M
-rw-r--r-- 1 dan dan  187  5 août  23:11 md5sums
-rw-r--r-- 1 dan dan 2,5M  5 août  23:11 openwrt-kirkwood-rootfs.tar.gz
-rw-r--r-- 1 dan dan 6,0M  5 août  23:11 openwrt-kirkwood-squashfs.img
-rw-r--r-- 1 dan dan 879K  5 août  23:11 openwrt-kirkwood-uImage		=> kernel image
drwxr-xr-x 2 dan dan 4,0K  5 août  23:09 packages/
$ l build_dir/linux-kirkwood
total 7,6M
drwxr-xr-x  3 dan dan 4,0K  5 août  23:09 base-files/
drwxr-xr-x  9 dan dan 4,0K  5 août  23:08 fuse-2.8.4/
drwxr-xr-x 12 dan dan 4,0K  5 août  23:10 iptables-1.4.8/
drwxr-xr-x 26 dan dan 4,0K  5 août  23:11 linux-2.6.30.10/
drwxr-xr-x  3 dan dan 4,0K  5 août  23:10 mtd/
drwxr-xr-x 15 dan dan 4,0K  5 août  23:10 opkg-528/
drwxr-xr-x  3 dan dan 4,0K  5 août  23:10 packages/
-rwx------  1 dan dan 2,0M  5 août  23:11 root.squashfs*			=> rootfs image
-rw-r--r--  1 dan dan 879K  5 août  23:11 uImage
-rwxr-xr-x  1 dan dan 2,4M  5 août  23:11 vmlinux*
-rwxr-xr-x  1 dan dan 2,4M  5 août  23:11 vmlinux.elf*


$ l bin/kirkwood/packages/							=> Packages compilés
total 2,6M
-rw-r--r-- 1 dan dan  30K  5 août  23:07 base-files_51-r22468_kirkwood.ipk
-rw-r--r-- 1 dan dan 227K  3 août  12:01 busybox_1.16.2-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  91K  3 août  12:03 dropbear_0.52-5_kirkwood.ipk
-rw-r--r-- 1 dan dan 118K  3 août  12:05 e2fsprogs_1.41.12-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  13K  3 août  12:11 hotplug2_1.0-beta-2_kirkwood.ipk
-rw-r--r-- 1 dan dan  644  5 août  23:09 kernel_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  65K  5 août  23:09 kmod-fs-nfs_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  98K  5 août  23:09 kmod-fs-nfs-common_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  32K  5 août  23:09 kmod-fs-vfat_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 2,8K  5 août  23:09 kmod-leds-gpio_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 3,6K  5 août  23:09 kmod-nls-base_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 3,0K  5 août  23:09 kmod-nls-cp437_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 2,7K  5 août  23:09 kmod-nls-iso8859-1_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 7,3K  5 août  23:09 kmod-usb-serial-cp210x_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  19K  5 août  23:09 kmod-usb-serial-ftdi_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 9,2K  5 août  23:09 kmod-usb-serial-pl2303_2.6.30.10-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 5,5K  5 août  23:07 ldd_0.9.30.2-51_kirkwood.ipk
-rw-r--r-- 1 dan dan  20K  3 août  12:05 libblkid_1.41.12-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 211K  5 août  23:07 libc_0.9.30.2-51_kirkwood.ipk
-rw-r--r-- 1 dan dan  72K  3 août  12:05 libext2fs_1.41.12-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  20K  5 août  23:07 libgcc_4.4.4-51_kirkwood.ipk
-rw-r--r-- 1 dan dan  16K  3 août  12:12 libiptc_1.4.8-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  73K  3 août  12:13 liblua_5.1.4-6_kirkwood.ipk
-rw-r--r-- 1 dan dan 112K  4 août  23:13 libncurses_5.7-2_kirkwood.ipk
-rw-r--r-- 1 dan dan 177K  3 août  12:11 libow_2.7p21-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 6,6K  3 août  12:11 libow-capi_2.7p21-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  20K  5 août  23:07 libpthread_0.9.30.2-51_kirkwood.ipk
-rw-r--r-- 1 dan dan 110K  4 août  23:14 libreadline_5.2-2_kirkwood.ipk
-rw-r--r-- 1 dan dan 2,5K  5 août  23:07 librt_0.9.30.2-51_kirkwood.ipk
-rw-r--r-- 1 dan dan 261K  4 août  23:17 libsqlite3_3.7.0-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  18K  3 août  12:14 libuci_12012009.5-2_kirkwood.ipk
-rw-r--r-- 1 dan dan 6,3K  3 août  12:14 libuci-lua_12012009.5-2_kirkwood.ipk
-rw-r--r-- 1 dan dan  12K  5 août  23:08 libusb_0.1.12-2_kirkwood.ipk
-rw-r--r-- 1 dan dan 7,8K  3 août  12:05 libuuid_1.41.12-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  12K  5 août  23:08 libwrap_7.6-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 7,4K  3 août  12:13 lua_5.1.4-6_kirkwood.ipk 
-rw-r--r-- 1 dan dan 9,1K  3 août  12:13 mtd_13_kirkwood.ipk
-rw-r--r-- 1 dan dan  62K  3 août  12:14 opkg_528-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  27K  3 août  12:11 owftpd_2.7p21-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  12K  3 août  12:11 owhttpd_2.7p21-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  14K  3 août  12:11 owserver_2.7p21-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  15K  3 août  12:11 owshell_2.7p21-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  28K  5 août  23:11 Packages
-rw-r--r-- 1 dan dan 5,7K  5 août  23:11 Packages.gz
-rw-r--r-- 1 dan dan 7,6K  5 août  23:08 portmap_6.0-2_kirkwood.ipk
-rw-r--r-- 1 dan dan  24K  5 août  23:08 ser2net_2.7-2_kirkwood.ipk
-rw-r--r-- 1 dan dan 7,5K  3 août  12:11 setserial_2.17-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  89K  4 août  23:17 sqlite3-cli_3.7.0-1_kirkwood.ipk
-rw-r--r-- 1 dan dan 7,8K  3 août  12:14 uboot-envtools_20081215-2_kirkwood.ipk
-rw-r--r-- 1 dan dan 7,0K  3 août  12:14 uci_12012009.5-2_kirkwood.ipk
-rw-r--r-- 1 dan dan 8,9K  3 août  12:14 udevtrigger_106-1_kirkwood.ipk
-rw-r--r-- 1 dan dan  22K  3 août  12:15 uhttpd_12_kirkwood.ipk
-rw-r--r-- 1 dan dan 155K  5 août  23:09 usbutils_0.86-2_kirkwood.ipk
-rw-r--r-- 1 dan dan  38K  3 août  12:14 zlib_1.2.3-5_kirkwood.ipk


Rempli les images kernel/rootfs en multiple de 128K

$ dd if=bin/kirkwood/openwrt-kirkwood-uImage of=./dockstar-uImage bs=128k conv=sync
$ dd if=build_dir/linux-kirkwood/root.squashfs of=./dockstar-rootfs bs=128k conv=sync


Copie dans la racine du serveur tftp pour utilisation par u-boot

$ cp dockstar-uImage dockstar-rootfs /srv/tftp
$ l  /srv/tftp
total 2,9M
-rw-r--r-- 1 dan dan 2,0M  5 août  23:28 dockstar-rootfs
-rw-r--r-- 1 dan dan 896K  5 août  23:28 dockstar-uImage


Modifications du système

  • Config LED

Dans /etc/config/system rajouer:

config led
	option sysfs 'dockstar:green:health'
	option trigger netdev
	option dev eth0
	option mode 'link tx rx'

  • A suivre ...


Flasher les images compilées en utilisant la méthode ci-dessus


Installation des images OpenWrt à partir d'u-boot par la console série

Méthode: http://www.cs.cmu.edu/~ecc/dockstar-howto.html#serial


Ouverture du boitier

Info: http://www.yourwarrantyisvoid.com/2010/07/14/hardware-porn-seagate-dockstar-teardown/

Le boitier peux s'ouvrir facilement (il n'y a pas de vis) en insérant un outils entre les 2 parties et déclipsant la partie inférieure.
Ne pas oublier de déconnecter le câble de la mini-USB avant de forcer une ouverture complète.


Port console série

Info: http://www.yourwarrantyisvoid.com/2010/07/21/seagate-dockstar-add-an-accessible-serial-port/


Le port console série est disponible sur le mini connecteur 2x10:

      ---------------------
      | 9   7   5   3   1 | <
      | 10  8   6   4   2 |
      ---------------------
		RX  TX  GND


Test à partir d'un linux (débit 115200 8N1), le connecteur est repris d'un câble audio lecteur cdrom/carte mère,

Port console Dockstar relié au PC + un adaptateur USB-Serie



Port JTAG


  • JTAG connector

Source: http://plugapps.com/index.php5?title=File:DockStar_JTAG.png


Boot vu de la console série

dan@vesta:trunk$ picocom -b 115200 -d 8 -f n -p n /dev/ttyUSB0
picocom v1.4

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : ascii_xfr -s -v -l10
receive_cmd is : rz -vv

Terminal ready


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.30.10
   Created:      2010-07-31  14:08:28 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    903036 Bytes = 881.9 kB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK

Starting kernel ...							=> Boot sur image kernel

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.30.10 (ecc@stratocaster) (gcc version 4.4.4 (GCC) ) #10 Sat Jul 31 10:08:26 EDT 2010
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Seagate DockStar
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: console=ttyS0,115200 root=/dev/mtdblock2 ro
NR_IRQS:114
PID hash table entries: 512 (order: 9, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB = 128MB total
Memory: 127260KB available (2224K code, 193K data, 84K init, 0K highmem)
Calibrating delay loop... 1192.75 BogoMIPS (lpj=5963776)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 296 bytes
NET: Registered protocol family 16
Kirkwood: MV88F6281-A0, TCLK=200000000.
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.
Kirkwood: Gating clock using mask 0x1ac224
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
NET: Registered protocol family 1
squashfs: version 4.0 (2009/01/31) Phillip Lougher
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 248
io scheduler noop registered
io scheduler deadline registered (default)
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
console [ttyS0] enabled
Driver 'sd' needs updating - please use bus_type methods
MV-643xx 10/100/1000 ethernet driver version 1.4
mv643xx_eth smi: probed
net eth0: port 0 with MAC address 00:10:75:xx:xx:xx
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron NAND 256MiB 3,3V 8-bit)
Scanning device for bad blocks
Creating 4 MTD partitions on "NAND 256MiB 3,3V 8-bit":
0x000000000000-0x000000100000 : "u-boot"
0x000000100000-0x000000500000 : "uImage"
0x000000500000-0x000002500000 : "rootfs"
0x000002500000-0x000010000000 : "rootfs_data"
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1
orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000
orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
USB Serial support registered for pl2303
usbcore: registered new interface driver pl2303
pl2303: Prolific PL2303 USB to serial adaptor driver
usb 1-1: new high speed USB device using orion-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
rtc-mv rtc-mv: internal RTC not ticking
i2c /dev entries driver
cpuidle: using governor ladder
TCP cubic registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
Freeing init memory: 84K
Please be patient, while OpenWrt loads ...
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
switching to jffs2
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay
- init -

Please press Enter to activate this console. RPC: Registered udp transport module.
RPC: Registered tcp transport module.
Registered led device: dockstar:green:health
Registered led device: dockstar:orange:misc
eth0: link up, 100 Mb/s, full duplex, flow control disabled


BusyBox v1.16.2 (2010-08-03 11:59:46 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r22468) ------------------				=> Version perso.
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#


Boot avec arrêt sur u-boot

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 
CE>> 								=> prompt u-boot


  • Commandes disponibles dans u-boot
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
  • Parmètres u-boot
CE>> printenv
baudrate=115200
loads_echo=0
ipaddr=169.254.254.253
serverip=169.254.254.254
rootpath=/mnt/ARM_FS/
netmask=255.255.0.0
run_diag=yes
console=console=ttyS0,115200
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/mtdblock2 ro
ethmtu=1500
usb0Mode=host
nandEcc=1bit
ethact=egiga0
ethaddr=00:10:75:xx:xx:xx
cesvcid=6UQX37NNJL85RGNQ5RKCBM5DDN
ceserialno=2GEP09HS
ceboardver=REDSTONE:1.0
bootcmd=nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000
arcNumber=2097
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=yes
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

Environment size: 778/131068 bytes


Flash des images

  • Paramètres tftp
CE>> setenv serverip 192.168.0.4						=> Serveur disposant des images compilées (tftpd-hpa)
CE>> printenv serverip
serverip=192.168.0.4

CE>> setenv ipaddr 192.168.0.224
CE>> ping $(serverip)
Using egiga0 device
host 192.168.0.4 is alive


  • Charge uimage par tftp et flashage en NAND
CE>> mw 0x800000 0 0x100000							=> Rempli de '0' zone RAM à partir de 0x800000 et de taille 0x100000


CE>> tftpboot 0x800000 dockstar-uImage						=> Charge uimage par tftp
Using egiga0 device
TFTP from server 192.168.0.4; our IP address is 192.168.0.224
Filename 'dockstar-uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         ##################################################
done
Bytes transferred = 917504 (e0000 hex)						=> Les "bytes transferred" doivent être inférieur à 0x100000, sinon refaire la commande "mw" avec une taille supérieure.

CE>> nand erase 0x100000 0x400000						=> Efface partition uImage en NAND

NAND erase: device 0 offset 0x100000, size 0x400000
Erasing at 0x4e0000 -- 100% complete.
OK

CE>> nand write.e 0x800000 0x100000 0x100000					=> Ecrit la zone mémoire 0x800000 dans la partition NAND uImage

NAND write: device 0 offset 0x100000, size 0x100000

Writing data at 0x1ff800 -- 100% complete.
 1048576 bytes written: OK


  • Charge image rootfs par tftp et flashage en NAND
CE>> mw 0x800000 0 0x200000							=> Rempli de '0' zone RAM à partir de 0x800000 et de taille 0x200000

CE>> tftpboot 0x800000 dockstar-rootfs						=> Charge image rootfs par tftp
Using egiga0 device
TFTP from server 192.168.0.4; our IP address is 192.168.0.224
Filename 'dockstar-rootfs'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ##################################
done
Bytes transferred = 1835008 (1c0000 hex)					=> Les "bytes transferred" doivent être inférieur à 0x200000, sinon refaire la commande "mw" avec une taille supérieure.

CE>> nand erase 0x500000 0x2000000						=> Efface partition rootfs en NAND

NAND erase: device 0 offset 0x500000, size 0x2000000
Erasing at 0x24e0000 -- 100% complete.
OK

CE>> nand write.e 0x800000 0x500000 0x200000					=> Ecrit la zone mémoire 0x800000 dans la partition NAND rootfs

NAND write: device 0 offset 0x500000, size 0x200000
Writing data at 0x6ff800 -- 100% complete.
 2097152 bytes written: OK


CE>> nand erase 0x2500000 0xdb00000						=> Efface partition rootfs_data

NAND erase: device 0 offset 0x2500000, size 0xdb00000
Erasing at 0xffe0000 -- 100% complete.
OK


  • Rajout des paramètres u-boot
CE>> setenv arcNumber 2097							=> Pas nécessaire car déjà initialisées ci-dessus.
CE>> setenv mainlineLinux yes

CE>> saveenv
Saving Environment to NAND...
Erasing Nand...Writing to Nand... done


  • Relance OS
CE>> reset	 (ou on/off)


Problèmes rencontrés

Le flashage par u-boot retourne des erreurs sur mtdblock2 quelque soit l'image après le boot du kernel:

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.30.10 (dan@vesta) (gcc version 4.4.4 (GCC) ) #3 Tue Aug 3 22:05:07 CEST 2010
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Seagate DockStar
...
usbserial: USB Serial Driver core
usb 1-1: new high speed USB device using orion-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
rtc-mv rtc-mv: internal RTC not ticking
i2c /dev entries driver
cpuidle: using governor ladder
TCP cubic registered
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
end_request: I/O error, dev mtdblock2, sector 2
EXT3-fs: unable to read superblock
end_request: I/O error, dev mtdblock2, sector 2
EXT2-fs: unable to read superblock
end_request: I/O error, dev mtdblock2, sector 0
SQUASHFS error: squashfs_read_data failed to read block 0x0
SQUASHFS error: unable to read squashfs_super_block
VFS: Cannot open root device "mtdblock2" or unknown-block(31,2)
Please append a correct "root=" boot option; here are the available partitions:
1f00            1024 mtdblock0 (driver?)
1f01            4096 mtdblock1 (driver?)
1f02           32768 mtdblock2 (driver?)
1f03          224256 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)


Solution apportée par cette méthode:
Troubleshooting: http://www.cs.cmu.edu/~ecc/dockstar-howto.html#troubleshooting

Si problème de lecture sur rootfs aprés boot du kernel:

- Le noyau compilé doit supporter les pilotes USB storage and ext2.
- Formater une clef-usb en ext2 et y "détarer" le rootfs contenu dans le fichier: bin/kirkwood/openwrt-kirkwood-rootfs.tar.gz
- Copier aussi dans la clef le fichier image openwrt-kirkwood-rootfs.squashfs
- Dans u-boot paramètrer pour booter sur la clef:
	CE>> setenv bootargs_root root=/dev/sda1 rootdelay=10 rootfstype=ext2
	CE>> boot
- Une fois sur OpenWrt booté sur la clef, installé mtd-utils avec opkg ou si pas d'accès internet installé le package copié sur la clef au préalable: 
	# opkg update
	# opkg install mtd-utils
- Effacer la partition rootfs et reflasher l'image copiée sur la clef:
	# flash_eraseall /dev/mtd2
	# nandwrite /dev/mtd2 /openwrt-kirkwood-rootfs.squashfs
- Rebooter en espérant que cela soit bon cette fois ...


Configurer son système


Fichier /etc/hosts à renseigner


Clefs ssh

$ scp ~/.ssh/authorized_keys.client root@dockstar:/etc/dropbear/authorized_keys


Alias

Rajouts lignes:

root@dockstar:~# vi /etc/profile
alias l='ls -lhF'
alias ll='ls -lhF' 
alias df='df -hP'      
alias dm='dmesg | tail -20'
alias log='logread'    
alias logf='logread -f'


Mise à l'heure


  • Script init
root@dockstar:~# cat > /etc/init.d/rdate << EOF
#!/bin/sh
sleep 2					# Attend fin dhcp
if ! /usr/sbin/rdate -s vesta
then
       /usr/sbin/rdate -s ntp.unice.fr
fi
EOF


  • Lien à créer
root@dockstar:~# chmod +x /etc/init.d/rdate
root@dockstar:~# ln -s /etc/init.d/rdate /etc/rc.d/S99rdate


  • Timezone
root@dockstar:~# uci show |grep UTC
system.@system[0].timezone=UTC
root@dockstar:~# uci set system.@system[0].timezone="CET-1CEST,M3.5.0,M10.5.0/3"
root@dockstar:~# uci commit


Syslog vers serveur Debian

root@dockstar:~# uci set system.@system[0].log_ip=alix
root@dockstar:~# uci commit


Client/Serveur nfs


Packages installés

trunk$ ./scripts/feeds install -d y portmap
trunk$ ./scripts/feeds install -d y nfs-kernel-server nfs-utils
trunk$ ./scripts/feeds install -d y nfs-utils
trunk$ grep nfs .config
CONFIG_PACKAGE_nfs-kernel-server=y
CONFIG_PACKAGE_nfs-kernel-server-utils=y
CONFIG_PACKAGE_kmod-fs-nfs=y
CONFIG_PACKAGE_kmod-fs-nfs-common=y
CONFIG_PACKAGE_kmod-fs-nfsd=y
CONFIG_PACKAGE_nfs-utils=y

Montage client nfs

  • Lancer portmap
root@dockstar:~# /etc/init.d/portmap start
  • Montage nfs sur Dockstar
root@OpenWrt:~# mount -t nfs vesta:/usr/local/tampon /mnt


Serveur nfs

  • Disque USB monté pour partage nfs
root@dockstar:~# mkdir /mnt/freeagentgo
root@dockstar:~# mount /dev/sda1 /mnt/freeagentgo


  • Configuration nfs
root@dockstar:~# cat /etc/exports 
/mnt/freeagentgo        *(rw,all_squash,insecure,anonuid=1000,anongid=1000,sync,subtree_check)


Un "user" uid/gid 1000 est créé dans /etc/passwd pour que les fichiers apartiennent à l'utilisateur distant (le 1ier par défaut sous Debian).

root@dockstar:~# chown 1000.1000 /mnt/freeagentgo
root@dockstar:~# echo "dan:*:1000:1000:Dan:/tmp:/bin/false" >> /etc/passwd
root@dockstar:~# echo "dan:x:1000:" >> /etc/group
root@dockstar:~# exportfs -a
exportfs: Warning: /mnt/freeagentgo does not support NFS export.		=> Retourne ce messsage si pas de montage ext3 sur mnt/freeagentgo !
root@dockstar:~# /etc/init.d/nfsd start


Mise en veille disque USB

  • Mode manuel
root@dockstar:/tmp# sdparm --command=stop /dev/sda				=> Arrète le disque.
   /dev/sda: Seagate   FreeAgent Go      0142

La relance se fait dés un accés au répertoires du disque ou avec la commande:

root@dockstar:/tmp# sdparm --command=start /dev/sda


Compiler ces programmes sous OpenWrt trunk

Reprise du programme xpl-owfs pour le Wrt54gl sous OpenWrt: Acquisition senseurs 1-wire Wrt54gl par messages xPL.
Mais l'accès au bus 1-wire par owfs se fera en utilisant le librairie C de owfs: owcapi fourni par les packages owfs sous OpenWrt Kamikaze.

trunk$ ./scripts/feeds list | grep -i owfs
libow                                   OWFS - common shared library
libow-capi                              OWFS - C-API library
owfs                                    OWFS - fuse file system
owftpd                                  OWFS - ftp server
owhttpd                                 OWFS - http server
owserver                                OWFS - network server
owshell                                 OWFS - shell utilities

Le programme tournera sur le Dockstar en boucle pour envoyer les données d'un capteur 1-wire (la sonde DS18B20) par Xpl.


Préparation des sources

Les sources du programmes seront placées dans le répertoire trunk/package/xpl-owfs de cette façon:

trunk$ find package/xpl-owfs
package/xpl-owfs
package/xpl-owfs/Makefile
package/xpl-owfs/src
package/xpl-owfs/src/xpl-owfs.c
package/xpl-owfs/src/Makefile


Pour que le package/programme soit compilé, il doit être sélectionner dans menuconfig / "Utilities" si le Makefile contient "CATEGORY:=Utilities") ou faire:

$ echo 'CONFIG_PACKAGE_xpl-owfs=y'  >> .config


Lancer la compilation

$ make package/xpl-owfs/compile				=> ou make package/xpl-owfs/compile V=99 en plus verbeux					
 make[1] package/xpl-owfs/compile
 make[2] -C package/xpl-owfs compile


Résultat de la compilation

$ find . -name "xpl-owfs*"
./staging_dir/target-arm_v5te_uClibc-0.9.30.2_eabi/root-kirkwood/usr/bin/xpl-owfs
./build_dir/linux-kirkwood/xpl-owfs
./build_dir/linux-kirkwood/xpl-owfs/xpl-owfs.c
./build_dir/linux-kirkwood/xpl-owfs/xpl-owfs						=> Programme compilé
./build_dir/linux-kirkwood/xpl-owfs/ipkg-kirkwood/xpl-owfs
./build_dir/linux-kirkwood/xpl-owfs/ipkg-kirkwood/xpl-owfs/usr/bin/xpl-owfs
./build_dir/linux-kirkwood/xpl-owfs/xpl-owfs.o
./build_dir/linux-kirkwood/xpl-owfs/xpl-owfs.c~
./package/xpl-owfs
./package/xpl-owfs/src/xpl-owfs.c
./package/xpl-owfs/src/xpl-owfs.c~
./bin/kirkwood/packages/xpl-owfs_1_kirkwood.ipk						=> Programme packagé
$ file ./build_dir/linux-kirkwood/xpl-owfs/xpl-owfs
./build_dir/linux-kirkwood/xpl-owfs/xpl-owfs: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped


Source du programme et Makefiles

package/xpl-owfs/Makefile
package/xpl-owfs/src/Makefile
package/xpl-owfs/src/xpl-owfs.c



Test du programme sur le dockstar

Avec une interface 1-wire passive

Celle-ci sera reliée à un adapateur USB-série à chip pl2303 (pilote compilé dans image OpenWrt).


  • Copie du binaire, le package pourra être installé aprés mise au point.
$ scp ./build_dir/linux-kirkwood/xpl-owfs/xpl-owfs root@dockstar:/tmp
root@dockstar's password: 
xpl-owfs                                                                                                                          100% 9002     8.8KB/s   00:00    


  • Connexion de l'interface 1-wire passive sur USB-serie
root@OpenWrt:~# logread -f
Aug  6 22:12:01 OpenWrt user.info kernel: usb 1-1.4: new full speed USB device using orion-ehci and address 3
Aug  6 22:12:01 OpenWrt user.info kernel: usb 1-1.4: configuration #1 chosen from 1 choice
Aug  6 22:12:01 OpenWrt user.info kernel: pl2303 1-1.4:1.0: pl2303 converter detected
Aug  6 22:12:01 OpenWrt user.info kernel: usb 1-1.4: pl2303 converter now attached to ttyUSB0


  • Serveur owfs lancé:
root@OpenWrt:~# owserver --error_print 1 --error_level 5 -p 4304 -d /dev/ttyUSB0


  • Test lecture sonde DS18B20 avec commande owshell:
root@OpenWrt:~# owread /28.219ED7010000/temperature ; echo
    26.3125


  • Test programme xpl-owfs:
root@OpenWrt:/tmp# ./xpl-owfs &

Messages xPL reçus avec un xPL_Logger sur le PC Linux:

$ tail -f /var/log/xpl/xpl-logger.log | grep dockstar
06/08/2010 22:26:04 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.219ED7010000[temp]=23.2]
06/08/2010 22:27:06 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.219ED7010000[temp]=23.1]
06/08/2010 22:28:07 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.219ED7010000[temp]=23.2]
06/08/2010 22:29:08 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.219ED7010000[temp]=23.2]
06/08/2010 22:30:10 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.219ED7010000[temp]=23.4]


  • Vue du montage
Interface 1-wire passive sur USB-serial reliée au Dockstar
Vue rapprochée


Avec une interface 1-wire/USB DS9490R

Recompiler les packages owfs

owfs n'est pas compilé par défaut avec support USB pour gérer l'interface 1-wire/USB DS9490R.
Message obtenu au lancement de owserver:

Aug 15 14:12:57 dockstar daemon.info OWFS[1622]: DEFAULT: ow_opt.c:OW_ArgUSB(995) USB support (intentionally) not included in compilation. Check LIBUSB, then reconfigure and recompile.  


  • Modifier Makefile package owfs
$ vi feeds/packages/utils/owfs/Makefile 
...
PKG_CONFIGURE_OPTS:= \
               --enable-zero \
               --enable-usb \						=> rajout support USB.
               --disable-parport \
...



  • Compiler packages owfs
$ make package/owfs/clean package/index					=> clean package feeds owfs				
$ make package/owfs/compile package/index				=> compile package feeds owfs
make[1] package/owfs/compile
make[2] -C package/libtool host-compile
make[2] -C package/libtool compile
make[2] -C feeds/packages/libs/libusb compile
make[2] -C package/fuse compile
make[2] -C feeds/packages/utils/owfs compile
make[1] package/index
$ make package/owfs/install package/index				=> Copie binaires dans build_dir.


Configuration dépot local opkg

Inspiré de l'article: OpenWrt sur Acme Fox de Linux-Mag HS n°47


  • Config Dockstar
root@dockstar:~# vi /etc/opkg.conf
src/gz packages http://vesta/dockstar		=> Pointe sur serveur local ou se trouve les packages compilés OpenWrt trunk (trunk/bin/kirkwood/packages)
dest root /  
dest ram /tmp                
lists_dir ext /var/opkg-lists
option overlay_root /overlay


  • Config. Apache serveur local pour accés packages
# cat /etc/apache2/conf.d/openwrt_dockstar.conf 
Alias /dockstar /repertoire/dockstar-sdk/trunk/bin/kirkwood/packages

<Directory /repertoire/dockstar-sdk/trunk/bin/kirkwood/packages>
        Options +FollowSymLinks
        AllowOverride All
        order allow,deny
        allow from localhost 127.0.0.1
        allow from 192.168.0.0/24
</Directory>


Installer les nouveaux packages owfs
  • Supprime les anciens packages owfs + lib
root@dockstar:~# opkg list-installed | grep ow
libow - 2.7p21-1
libow-capi - 2.7p21-1
owftpd - 2.7p21-1
owhttpd - 2.7p21-1
owserver - 2.7p21-1
owshell - 2.7p21-1
root@dockstar:~# opkg remove ow*
root@dockstar:~# opkg remove libow-capi
root@dockstar:~# opkg remove libow


  • Réinstalle les nouveaux compilés
root@dockstar:~# opkg update
Downloading http://vesta/dockstar/Packages.gz.
Inflating http://vesta/dockstar/Packages.gz.
Updated list of available packages in /var/opkg-lists/packages.
root@dockstar:~# opkg install owserver
root@dockstar:~# opkg install owshell owhttpd libow-capi


Test owfs avec l'interface USB DS9490R
  • Connexion de l'interface 1-wire DS9490R
Aug 24 14:53:09 dockstar user.info kernel: usb 1-1.4: new full speed USB device using orion-ehci and address 3
Aug 24 14:53:09 dockstar user.info kernel: usb 1-1.4: configuration #1 chosen from 1 choice


  • Lancement du serveur owfs
root@dockstar:~# owserver --error_print 1 --error_level 0 -p 4304 -u

Log:

Aug 24 14:54:05 dockstar daemon.notice OWFS[1691]: CONNECT: ow_ds9490.c:USB_next(548) Adapter found: 001/003  
Aug 24 14:54:05 dockstar daemon.info OWFS[1691]: DEFAULT: ow_ds9490.c:DS9490_sub_open(482) Opened USB DS9490 adapter at 001/003.  
Aug 24 14:54:05 dockstar daemon.notice OWFS[1691]: CONNECT: ow_ds9490.c:DS9490_detect_found(361) Good DS1421 tag found for 001/003  
Aug 24 14:54:05 dockstar daemon.info OWFS[1691]: DEFAULT: ow_ds9490.c:DS9490_detect_found(368) Set DS9490 001/003 unique id to 81 E1 BC 2C 00 00 00 B8  


  • Lecture bus 1-wire
root@dockstar:~# owdir
/28.A05FD7010000		=> Sonde DS18B20
/81.E1BC2C000000
/bus.0
/settings
/system
/statistics
/structure
/simultaneous
/alarm


Lecture senseur 1-wire:

root@dockstar:~# owread /28.A05FD7010000/temperature ; echo
     23.9375


Programme xpl-owfs: lecture 1-wire avec libowcapi et xpl:

27/08/2010 23:28:53 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.6]
27/08/2010 23:29:54 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.8]
27/08/2010 23:30:55 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.8]
27/08/2010 23:31:56 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.9]
27/08/2010 23:32:57 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.8]
27/08/2010 23:33:58 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.9]
27/08/2010 23:34:59 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.8]
27/08/2010 23:35:59 [xpl-trig/sensor.basic: domos-owfs.dockstar -> * - 28.A05FD7010000[temp]=34.8]


  • Vue en focntionnement
Dockstar + Interface 1-wire USB DS9490R + disque Freeagent Go
Interface 1-wire USB DS9490R + une sonde reliée au Dockstar


Branche OpenWrt officielle pour le Dockstar

Le Docstar est maintenant porté par le développement d'OpenWrt.

Voir


Liens ressources

Dock station Dockstar pour disque Free Agent Go, USB, Seagate (à 15€50 au plus bas):
http://www.topachat.com/pages/detail2.php?cat=peripheriques&rubrique=w_dock&ref=in10038678&origine=aff

Disque compatibles avec le dock: Seagate FreeAgent Go: http://www.ldlc.com/fiche/PB00096036.html

Seagate Dockstar, le plug computer pas cher: http://forum.hardware.fr/hfr/OSAlternatifs/Hardware-2/seagate-dockstar-computer-sujet_71314_1.htm


OpenWrt:


Debian:


Autres Linux:


Hardware:




5/8/2010