Showing posts with label seagate. Show all posts
Showing posts with label seagate. Show all posts

Saturday, February 4, 2012

DLNA server for BlackArmor NAS

Today I was reading a couple of forums and bumped into a write up on the "BubbleUPnP - UPnP/DLNA Control Point and Renderer" application for Android that has both DLNA client and server support. The BubbleUPnP setup also has a Java based server mentioned in their section on NAS devices, such as the QNAP which is very similar to the BlackArmor NAS.

Earlier in my writing, I was reviewing a version of Java for the ARM that was called "Sun Java SE for Embedded".  It would allow for executing a Java application on the BlackArmor.  Up until now, I did not have a Java application to really motivate me to install and test this but the BubbleUPnP DLNA server might allow for my BlueRay Play, Roku and Android cell phone to play my movies directly off the BlackArmor NAS.

There is one problem which is getting the ffmpeg library compiled and running. This is described in the docs above for the QNAP NAS but I've not been successful at getting a working toolchain yet.  I may have to backtrack and see if I can just use the toolchain provided by Seagate to compile this newer version of ffmpeg.

Another issue is that the Java SE for Embedded is licensed strangely by Oracle. It cannot be redistributed and requires licensing costs if it is redistributed by a professional package.

So step one would be to compile the ffmpeg library and test it out.  I hope to try that out with the existing Seagate toolchain.  The next step would be to get the Java SE Embedded to run a basic HelloWorld application on the console.  After that, try to get the BubbleUPnP server running.

I'll see if I can get a couple hours together to work on this this coming week. It would be nicer to have an open source DLNA server but I'll take what I can get.  Since I'm talking about taking some time to compile C/C++ code anyway to get this working, I checked on open source DLNA servers and popped up something from eLinux that was interesting to read over.  It looks like MediaTomb, uShare, and Serviio are candidates that could replace the BubbleUPnP server if I get the compiler toolchain working.

We will just have to see how much time I can get together to play around with this.

Thursday, December 22, 2011

Seagate Black Armor NAS

Yeah it's been hectic at work and lots to do in domestic life as well so this hobby project hasn't gotten much attention. Christmas break is coming however and I'm planning on getting some time to work on it. I think most Open Source projects or hobbies get a boost over the holidays.

Merry Xmas & Happy New Year in case I don't get back here before the holidays.

Sunday, December 4, 2011

Newlib error during compile

Earlier I was working on the problem with compiling using the arm-elf-gcc on very basic programs.  After some work, I found the base problem is that the libc replacement from newlib are not being picked up at compile time and properly using the syscalls mechanism. Hardwired hacks to work around it produced an executable but something is still wrong with how the compiler was built.

I've distilled the error down to a single search.

Google Search: "/lib/libc.a(lib_a-exit.o): In function `exit':" "newlib/libc/stdlib/exit.c:65: undefined reference to `_exit'"

Several other people appear to have run into the same problem, so I'll be reading up on the problem and see what solutions exist.

Thursday, December 1, 2011

Toolchains compiled

Two full toolchains built and a third that I still think might be made to work.  The first is using older versions of everything and was mostly done as a test to get the build environment working against known sources that are known to build. Even this known build process required some effort to get working in a current OS environment. Those docs, notes and scripts will be coming in the near future.

So to outline what works and not, I give you the following.

Toolchain that comes from older versions of software and the docs from Tom Walsh:
  • binutils-2.19.1a.tar.bz2
  • gcc-4.3.2.tar.bz2 (with a patch from Tom)
  • newlib-1.16.0.tar.gz (with a patch from Tom)
  • insight-weekly-CVS-7.0.50-20091130.tar.bz2
Newest versions that compiled based on Tom's scripts:
  • binutils-2.22.tar.bz2
  • gcc-4.4.6.tar.bz2
  • newlib-1.19.0.tar.gz
  • insight-CVS-20111130.tar.bz2 (pulled from CVS head and required patching by me)
Newest versions that fails to compile in GCC in zlib:
  • binutils-2.22.tar.bz2
  • gcc-4.6.2.tar.bz2
  • newlib-1.19.0.tar.gz
  • insight-CVS-20111130.tar.bz2 (pulled from CVS head and required patching by me)
The issue in GCC is well documented (if you know what you are looking for) as a bug in the "--enabled-multilib" during the build. The zlib library that is packaged with the GCC source fails to build in a cross-compiled configuration. Who knew that GCC packages their own copy of zlib in the GCC sources? There appear to be a couple of solutions which might fix the problem. The first is to just use the native zlib from the host system and pass in "--with-system-zlib" but that feels like a hack instead of a fix. The other is to revert a change in GCC that is documented in a couple of places (Bug45174 and Bug43328). This is a bug in the "configure" phase of the standard "configure;make;make install" but shows up in the "make" stage. So, I'll revisit this as time permits and see about getting the latest GCC 4.6 series working.

The more exciting thing is that it looks like both GCC versions that compiled will compile code to an intermediate state.  That is not proof that it generates a working executable but it is a step in the right direction.

For the GCC 4.3.2 version here is a test showing it compiling a quick test.
$ cat > test.c
int main (){return 0;}
Ctrl-D
$ ./arm-elf-gcc -Os -S test.c
$ cat test.s

        .file   "test.c"

        .text
        .align  2
        .global main
        .type   main, %function
main:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        mov     r0, #0
        bx      lr
        .size   main, .-main
        .ident  "GCC: (GNU) 4.3.2"

For the GCC 4.4.6 version here is a test showing it compiling a quick test.
$ cat > test.c
int main (){return 0;}
Ctrl-D
$ ./arm-elf-gcc -Os -S test.c
$ cat test.s

        .file   "test.c"
        .text
        .align  2
        .global main
        .type   main, %function
main:
        @ args = 0, pretend = 0, frame = 0
        @ frame_needed = 0, uses_anonymous_args = 0
        @ link register save eliminated.
        mov     r0, #0
        bx      lr
        .size   main, .-main
        .ident  "GCC: (GNU) 4.4.6"

While this is good news, it is not an ARM executable. My followup post will not be so upbeat.

Wednesday, November 2, 2011

Black Armor status

So my list of things to figure out keeps growing but I don't seem to get any time to work on them.

1. UPS software setup
2. DLNA server functionality
3. USB Hub issue to figure out so I can run the UPS and Printer together.
4. Serial Port hack (new)

I also want to get the serial port hack working which requires some physical work disassembling the NAS and maybe some soldering work to build a serial converter. The major work is already done by another guy on http://crapnas.blogspot.com but I'd have to follow along. There also appears to be a shortcut with an old Nokia USB cell phone cable that might be worth checking out.

Maybe next weekend I'll get some time. Project is just not getting cycles but I'm still thinking about it.

Tuesday, October 25, 2011

USB Ports on NAS

So I'm working on the UPS addition and forgot I use that USB port for my printer sharing. So time to do some reading on USB hubs and the Black Armor NAS 110. The printer is important and the UPS is important.  I wonder if I can mix my peanut butter and chocolate.

Even stranger, there is a USB port on the front of the box but that is special purposed for just USB Memory backups only.

So I have several paths here to check.

Saturday, October 22, 2011

Black Armor: A ToDo List - UPS and DLNA

I have two new quick projects that I need for my Black Armor NAS 110 in the immediate future.

First I need the UPS functionality for this device as I'm taking power hits at my residence and my old UPS' are just way too old and not working to keep the NAS running after a power blip. I bought an APC Back-UPS ES BE550G 550 VA 330 Watts at CostCo with one of their specials. The Black Armor NAS documentation said it only works with APC UPS so I thought I was okay but with further reading in the forums they say results vary with APC devices. So time to see if my new APC UPS will work with the built-in software or if the software needs improvements. So I hope to have a smart UPS running but just the dumb UPS functionality without a shutdown mode will have to do if I cannot get it working. The smart UPS depends on apcupsd 3.12.2 according to a post.


$ /usr/sbin/apcupsd --version
apcupsd 3.12.2 (18 January 2006) redhat


Next on the list is to figure out how functional the streaming media works on the device.  This will hopefully be more straight forward than the UPS. Family time will be vastly improved if I can get the DVD collection running off this device. DLNA is an interesting subject and my BlueRay player hooked to my TV may be able to play movies off the NAS. That would be optimal.

Wednesday, October 19, 2011

Black Armor NAS Information


Here is the beginning of a dump of information on the Black Armor device from the Linux kernel and environment.  From this I learned the processor type and features. I also got some pointers to cross-compiler options used. These will all be important later.

$ uname -a
Linux NAS3 2.6.22.18 #1 Thu Aug 26 12:26:10 CST 2010 v0.0.8 armv5tejl unknown
$ cat /proc/cpuinfo
Processor       : ARM926EJ-S rev 1 (v5l)
BogoMIPS        : 794.62
Features        : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant     : 0x2
CPU part        : 0x131
CPU revision    : 1
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 16384
I assoc         : 4
I line length   : 32
I sets          : 128
D size          : 16384
D assoc         : 4
D line length   : 32
D sets          : 128


Hardware        : Feroceon-KW
Revision        : 0000
Serial          : 0000000000000000
$ cat kmsg
<5>Linux version 2.6.22.18 (root@jasonDev.localdomain) (gcc version 4.2.1) #1 Thu Aug 26 12:26:10 CST 2010 v0.0.8
<4>CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
<4>Machine: Feroceon-KW
<4>  Marvell Development Board (LSP Version KW_LSP_4.2.7_patch21_with_rx_desc_tuned)-- MONO  Soc: 88F6192 A1 LE
dmesg
... way too much stuff ...

Tuesday, October 18, 2011

Rsync on Black Armor NAS 110

I figured out something simple but neat on the Black Armor NAS 110 (BA-NAS110) device.  It has rsync a powerful file-system replication tool from UNIX.

Caveats are that in order to do this you must have root on the device and a ssh connection with the command line. I'll write a friendly doc on how to get 'root' later. (Just search for Hajo Noerenberg's work on the subject sans the friendly write up if you want to do it now.)

So, the BA-NAS110 is capable of using rsync from the command line to replicate its data to another NAS or Linux system if you have root on the system. Getting it setup was simple enough but knowing that the rsync daemon and client were on the systems was the trick.

You have to create a rsyncd.conf file since there isn't one pre-built. Syntax is common to the typical rsync 3.0.4 version.

Hosting system
$ id
(root)
$ cat /root/rsyncd.conf

pid file = /var/run/rsyncd.pid


[rsyncftp]
path = /shares/Public
comment = rsyncftp

$ rsync --daemon --config=/root/rsyncd.conf

Client system (could be another BA-NAS110 or Linux)
$ id
(root)
$ rsync --progress --stats -v -t -r rsync://admin@/rsyncftp/* /shares/Public
  ... watch the good times roll ...

Note: Add the "-n" option to rsync on the client side for the initial test connection to put it in test mode without data copy.  Remove "-n" when you actually want to copy data.

The transfer speed between two BA-NAS110 devices across a dedicated switch is about 6-8MB/s. I've read some comments about performance on these devices being dogs and that there tweaks that might help.

I don't have my toolchain setup for compiling native apps yet but getting all my data copied out of my old device to my new one was a pretty important step to playing around with the older one.  So I figured someone else might benefit from this bit of lore.

Sunday, September 25, 2011

Seagate Black Armor 110 NAS

I found something fun.

The Seagate NAS (Network Attached Storage) that I've been using at my house is running an embedded Linux. A NAS is a big network hard drive you can share between computers.  I got a root account on it and have found a whole world of fun that could be done in there.  Root is the master administrative account for UNIX systems that let you do extra things beyond the normal.

First steps is getting a functional toolchain and then build some trivial tools.  The goal would be to have a full set of GNU tools available in a package format for people to use.  I want to publish a full working OpenSSH with scp support and rsync for this thing as a starting point. Maybe add some features for NFS. Just digging around on this thing reminded me how much I enjoy hacking on hardware.

A starting point is this gentleman who cracked open the hardware:
http://crapnas.blogspot.com/

The Seagate Support Forums are surprisingly useful:
http://forums.seagate.com/t5/BlackArmor-NAS-Network-Storage/bd-p/BlackArmorNAS

Hajo Noerenberg's work gives us root access and details on image format:
http://www.noerenberg.de/hajo/pub/seagate-blackarmor-nas.txt
http://www.noerenberg.de/hajo/pub/

Debian Lenny installed on 220 NAS:
http://forums.seagate.com/t5/BlackArmor-NAS-Network-Storage/Install-Debian-GNU-Linux-5-0-7-Lenny-on-the-Blackarmor-220-NAS/td-p/79422

I don't think I want a full Linux install but just extend the existing environment with additional tools that are useful.  A full platform and OS would be too much hassle. Besides, someone else already has that glory.

I'll post more if I get time to wack on this.