Home NAS (Advanced) • Customize the Digitus DN-7013

Customize the Digitus DN-7013

 - 


The Digitus DN-7013 (also known as the Ovilink MU-5000FS or Sitecom LN-350) is a small server which can share the USB harddisks you can connect to it. The little device runs Linux and thus is moddable!

Specifications:
But first some specs about this device (yeah, it’s old I know!):
NAME: Digitus DN-7013 / Sitecom LN-350 / Ovilink MU-5000FS
CPU: Infineon ADMtek ADM5120 @ 175 MHz (MIPS 4Kc)
RAM: 32 MB (2 x 16 MB)
ROM: 4 MB
USB: 2x using the ALi M5273 (or with NEC chipset, this is another revision)
LAN: 1x RJ-45 10/100 Mbit integrated in SoC
LED: 1x power, 1x LAN and 1x HDD
OTHER: 1x 5V DC/2.5A power plug, 1x reset button and 1x mount/unmount/sync button on the rear side and 1x JTAG interface with 1x Serial interface on the mainboard

A dump of /cat/cpuinfo:
system type : ADM5120 rev 8, running at 175.000 MHz
machine : Cellvision NFS-101U/101WU
processor : 0
cpu model : MIPS 4Kc V0.11
BogoMIPS : 173.05
wait instruction : yes
microsecond timers : yes
tlb_entries : 16
extra interrupt vector : yes
hardware watchpoint : yes, count: 1, address/irw mask: [0x0fff]
ASEs implemented :
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

History:
The device was initially release between 2004 and 2006 by different brands under different names, but the mainboard and case stays the same, only the color of the device itself is changed. Due to this age, the Linux kernel found on the original firmware is 2.4!

Firmware:
This device has never been updated (FW 1.73) when newer firmware images were released, therefore it runs horribly in today’s browsers and totally whacks the device (you actually have to unplug and plug in the device from the power in order to use it again!).

From here I started searching for an alternative firmware that might be available and I stumbled upon the OpenWRT firmware image that is released specifically for this type of board, but in order to install this image, we have to use the serial connection that is available on board.

Preparing for flashing the new firmware:
First you need to download the appropriate image from the OpenWRT downloads section:
OpenWRT ADM5120 Downloads Page

There are multiple versions available (also for the other vendors, pick the one matching your vendor), but in general there are 2 kinds of images to choose from:
– JFFS2
– SquashFS
These both have their (dis)advantages, like the JFFS2 version formats the remaining (minus bootloader and kernel) JFFS2, and installs the base packages here. The SquashFS version has the base packages on a SquashFS partition, and the remaining space is formatted JFFS2. This writable partition is layered over the ro SquashFS partition. The advantage of the JFFS2 version is that the basesystem is really writable. When you upgrade a package, the room used by the old package is freed. The advantage of the SquashFS version is that you can put *much more* on the flashrom, due to the highly compressed filesystem.

We will have to use Minicom to upload the downloaded firmware, so in this case you have to download the “xmodem” type of firmware. In this post I use the JFFS version, which uses the overlay filesystem technique. You may choose the SquashFS firmware, but the installation steps will be different!

Establishing a serial connection:
The device has a internal serial connector, know as JP2, it’s layout is below:
1: +3.3V
2: RxD
3: TxD
4: GND

Connect the pins 2, 3 and 4 to your serial adapter (and also 1 if your adapter needs the +3.3V line) and connect it to your machine. In this case we have to upload the firmware image via this serial line, so we have to use Minicom, therefore a machine running Linux is a prerequisite.
You can use Minicom to connect at 115200 baud, 8 bits, 1 stop bit, no parity and software handshake.

(on my device, no serial header was present, I soldered an old 3-pin fan header onto the board in order to establish the serial connection)

Storage:
We are going to store the operating system on the external disk, since the 4MB flash ROM is way too small to install some nice packages onto the device and turn it into a real server. This disk (or USB stick) has to be formatted with the ext4 filesystem (ext2 and ext3 are not supported anymore in the OpenWRT kernel!).

Starting the firmware upgrade:
First, start Minicom and plug in the device, if everything is connected as it should, you have to be presented with:

NFS-101U Boot(V1.02):

This is the bootloaders command prompt, press the space bar 3 times (you have to be fast for this step, if you’re too late, the kernel will be started from flash and you have to start over) and another menu pops up:

Cellvision Bootloader (v1.02 02262003)
==================================
(a) Download vmlinuz to flash ...
(b) Exit

Please enter your key :

This is the actual boot menu where, as you can see, we can upload a firmware image which will be written to flash. Press A here and the following line appears:

Please enter your key : a
Downloading..........

Now we have to select the firmware image that we want to upload, so open up the upload menu within Minicom by pressing CTRL + A, then press S and select xmodem. Now browse to the folder where the firmware image is residing and first press SPACE, then press ENTER.
If all goes well, a transfer menu will be shown that is now uploading the firmware image to the device (sometimes an unkown error may appear, just try the file upload again, this may fail several times before it works, don’t give up!) and will take up to 2 minutes to complete.
When the transfer is complete, press any key to return to Minicom and the bootloader will start programming the downloaded firmware image to flash and will take up to 2 minutes.

Once it’s finished, you’ll be left at the initial menu:

Cellvision Bootloader (v1.02 02262003)
==================================
(a) Download vmlinuz to flash ...
(b) Exit

Please enter your key :

Press B and let the device boot the new firmware image, you are now finished installing the new firmware onto the device, now we have to configure it.

Configure the network:
First thing to do is setting up the network, this can be confusing as the ADM5120 has 5 ethernet ports available (router based chip), but we only will be using eth0. Let’s configure the network card by opening up it’s configuration file:
vim /etc/config/network
Remove all the contents from the file and paste the content below in it:
config interface loopback
option ifname "lo"
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
config interface lan
option ifname "eth0"
option proto static
option ipaddr 192.168.0.77
option netmask 255.255.255.0
option gateway 192.168.0.1

Make sure to replace the IP address with the actual IP address you wish to assign! Save the settings and issue the following commands:
/etc/init.d/network stop
ifconfig eth0 down
/etc/init.d/network start

Now we have to fix the resolving settings, open the following file:
vim /overlay/etc/resolv.conf
And replace everything with:
nameserver IP-ADDRESS
Where IP-ADDRESS is the IP of your resolving machine, mostly your router. Save the settings and try to update the opkg’s file list:
opkg update
If that reports no errors, your network is working fine, else if you receive the wget error, something about your settings is not right and should be checked again.

Install software:
We have to install some software packages in order to make use of the USB harddisk, issue the following command:
opkg install kmod-fs-ext4 kmod-usb2 kmod-usb-core kmod-usb-ohci kmod-usb-storage block-mount kmod-scsi-core kmod-nls-base
We have just installed the needed kernel modules for using ext4 partitions and USB storage devices. This should be finished within a minute. When finished, reboot the machine with the “reboot” command.

Prepare and using the harddisk:
When the device is started, plug in the USB drive you have prepared and issue the following command:
vim /overlay/etc/config/fstab
Place the following content in the file:
config mount
option target /home
option device /dev/sda1
option fstype ext4
option options rw,async
option enabled 1
option enabled_fsck 0
option is_root 1

I assume that the plugged in drive is the first one, so use sda, else use sdb. We now have set up the new overlay filesystem (the disk) which the firmware will use from now on. Save the settings and again reboot the machine. Also, don’t mind the /home mounting point, as it will be ignored when the overlay takes place.

Now the boot process will take a bit longer, because the root filesystem has to be moved to the USB drive and depends on the speed of the used drive.

If the settings are applied correctly you will see something like this:
[ 19.636000] scsi 0:0:0:0: Direct-Access SanDisk Cruzer 1.10 PQ: 0 ANSI: 2
[ 19.660000] sd 0:0:0:0: [sda] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB)
[ 19.680000] sd 0:0:0:0: [sda] Write Protect is off
[ 19.692000] sd 0:0:0:0: [sda] No Caching mode page present
[ 19.696000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 19.728000] sd 0:0:0:0: [sda] No Caching mode page present
[ 19.736000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 19.768000] sda: sda1
[ 19.788000] sd 0:0:0:0: [sda] No Caching mode page present
[ 19.796000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 19.800000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[ 39.996000] EXT4-fs (sda1): recovery complete
[ 40.004000] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
switching to external rootfs
- init -

Please press Enter to activate this console.

If no errors occur below the word “- init -“, you have succesfully moved the root filesystem to your USB drive and can be seen using the command:
df -h
Which will result in something like:
root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 7.4G 311.5M 6.8G 4% /
/dev/root 1.3M 1.3M 0 100% /rom
tmpfs 14.5M 1.8M 12.6M 13% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sda1 7.4G 311.5M 6.8G 4% /overlay
overlayfs:/overlay 7.4G 311.5M 6.8G 4% /

As you can see, the reported size matches the USB drive (Sandisk Cruzer 8GB) size I used.

But we are not finished yet! Because of the move, some parts have been reset from flash to disk. Now you have to repeat the networking steps in order to get a working network connection. Once you have done that, you are finished.

Know issues:
There are some things that do not seem to work anymore, like the LAN and HDD leds, these will be dimmed all the time. Also the mount and reset buttons have lost it’s functionality. There seems to be some kernel modules available for the adm5120 CPU, but at this point, I was not able to make the leds work.

Author:Jeffrey Langerak

Leave a Reply

Your email address will not be published. Required fields are marked*

*

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.