Unpacking the D-Link DNS-320 Sharecenter Pulse

A few days ago i received the new D-Link DNS-320 Sharecenter Pulse. In this Post i want to show a few pictures which were take while unpacking the device. The content of the Box offers the Device itself, two power plugs, a small power supply and a networking cable. Additionally there is a CD with useful tools and the manual on it.
D-Link DNS-320 1
If you want to install the HDDs, you simple slide the top of the NAS back and pull the HDDs down into the case:

To avoid confusion, D-Link has labeled the slots with “L” and “R”. At the front the USB-Port is hidden. Additionally there is a button which transfers the data on the USB-Stick to the NAS if pressed.

Further articles:

Updated Tutorials for the Installation of fun_plug 0.5 on the D-Link DNS-320 Sharecenter Pulse

DNS-320
A few days ago, i got the new D-Link DNS-320. Now i’ve tested the installation of Fonz fun_plug 0.5 on the device and found a few things which i added to the Tutorial for the Installation of Fonz fun_plug 0.5 and the Package Tutorial. Below you can find the summary:

  • Changed HDD Mountpoints. The HDD is now mounted in /mnt/HD/ and not in /mnt anymore. So the the File “fun_plug” needed to be changed to reflect that.
  • Changed store-passwd.sh
    The supplied store-passwd.sh doesn’t work with the DNS-320, but i already found how to store the data and posted a new store-passwd.sh
  • The internal rsync doesn’t work when syncing with the repositories. Specifically redirecting the called binary to /ffp/bin/ solved that issue. The error was:
    sh: xterm: not found
    rsync: connection unexpectedly closed (1899 bytes received so far) [generator]
    rsync error: error in rsync protocol data stream (code 12) at io.c(601) [generator=3.0.7]
    sh: xterm: not found

store-passwd.sh for the D-Link DNS-320 Sharecenter Pulse

The D-Link DNS-320 needs a different store-passwd.sh than the one supplied with Fonz fun_plug. Basically it is very simple if you look at the contents:

#!/ffp/bin/sh
 
echo "Saving Userdata to /usr/local/config/"
cp -f /etc/passwd /usr/local/config/
cp -f /etc/group /usr/local/config/
cp -f /etc/shadow /usr/local/config/
cp -f /etc/samba/smbpasswd /usr/local/config/

Run the following command to download it to the NAS:

wget http://wolf-u.li/u/172/ -O /ffp/sbin/store-passwd.sh

Then proceed with the installation of Fonz fun_plug.

Output of dmesg on the D-Link DNS-320

Here the output of dmesg on the D-Link DNS-320:

Linux version 2.6.22.18 (bill@SWTEST3) (gcc version 4.2.1) #22 Tue Aug 10 11:59:29 CST 2010
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
Machine: Feroceon-KW
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 32768
  DMA zone: 256 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 32512 pages, LIFO batch:7
  Normal zone: 0 pages used for memmap
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists.  Total pages: 32512
Kernel command line: root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB 0MB 0MB 0MB = 128MB total
Memory: 123776KB available (4028K code, 246K data, 124K init)
Calibrating delay loop... 796.26 BogoMIPS (lpj=3981312)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
 
CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 128MB
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e8000000, size 128MB
PEX0_IO ....base f2000000, size   1MB
INTER_REGS ....base f1000000, size   1MB
NFLASH_CS ....base fa000000, size   2MB
SPI_CS ....base f4000000, size  16MB
BOOT_ROM_CS ....no such
DEV_BOOTCS ....no such
CRYPT_ENG ....base f0000000, size   2MB
 
  Marvell Development Board (LSP Version KW_LSP_4.3.4_patch30)-- DB-88F6281A-BP  Soc: 88F6281 A1 LE
 
 Detected Tclk 166666667 and SysClk 200000000
MV Buttons Device Load
Marvell USB EHCI Host controller #0: c0fb3600
PEX0 interface detected no Link.
PCI: bus0: Fast back to back transfers enabled
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
Time: kw_clocksource clocksource has been installed.
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
checking if image is initramfs...it is not (no cpio magic); looks like an initrd
Freeing initrd memory: 1594K
cpufreq: Init kirkwood cpufreq driver
cpufreq: High frequency: 800000KHz - Low frequency: 200000KHz
cpufreq: Setting CPU Frequency to 800000 KHz
cpufreq: Setting PowerSaveState to off
XOR registered 1 NET_DMA over 4 channels
XOR 2nd invalidate WA enabled
cesadev_init(c00119d8)
mvCesaInit: sessions=640, queue=64, pSram=f0000000
Warning: TS unit is powered off.
MV Buttons Driver Load
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
squashfs: version 3.3 (2007/10/31) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) é 2001-2006 Red Hat, Inc.
SGI XFS with large block numbers, no debug enabled
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: 8250/16550 driver $Revision: 1.7 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 10240K size 1024 blocksize
loop: module loaded
Loading Marvell Ethernet Driver:
  o Cached descriptors in DRAM
  o DRAM SW cache-coherency
  o Single RX Queue support - ETH_DEF_RXQ=0
  o Single TX Queue support - ETH_DEF_TXQ=0
  o TCP segmentation offload enabled
  o LRO support supported
  o Receive checksum offload enabled
  o Transmit checksum offload enabled
  o Network Fast Processing (Routing) supported
  o Driver ERROR statistics enabled
  o Driver INFO statistics enabled
  o Proc tool API enabled
  o SKB Reuse supported
  o SKB Recycle supported
  o Rx descripors: q0=128
  o Tx descripors: q0=532
  o Loading network interface(s):
    o  register under egiga0 platform
    o egiga0, ifindex = 1, GbE port = 0
 
Warning: Giga 1 is Powered Off
 
mvFpRuleDb (c7d5d000): 1024 entries, 4096 bytes
Integrated Sata device found
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
scsi 0:0:0:0: Direct-Access     ATA      GB0500C4413           PQ: 0 ANSI: 5
scsi 1:0:0:0: Direct-Access     Seagate  ST3500630AS      3.AA PQ: 0 ANSI: 5
scsi 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: Attached scsi generic sg1 type 0
NFTL driver: nftlcore.c $Revision: 1.1.1.1 $, nftlmount.c $Revision: 1.1.1.1 $
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 854 at 0x06ac0000
Using static partition definition
Creating 6 MTD partitions on "nand_mtd":
0x00000000-0x00100000 : "u-boot"
0x00100000-0x00600000 : "uImage"
0x00600000-0x00b00000 : "ramdisk"
0x00b00000-0x07100000 : "image"
0x07100000-0x07b00000 : "mini firmware"
0x07b00000-0x08000000 : "config"
ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
ehci_marvell ehci_marvell.70059: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver
USB Universal Host Controller Interface driver v3.0
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
dm_crypt using the OCF package.
cpufreq: Setting CPU Frequency to 800000 KHz
cpufreq: Setting PowerSaveState to off
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
RAMDISK: Compressed image found at block 0
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 124K
sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 10 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 23 00 10 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
 sda: sda1 sda2 sda4
sd 0:0:0:0: [sda] Attached SCSI disk
sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 23 00 10 00
sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 23 00 10 00
sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
 sdb: sdb1 sdb2 sdb4
sd 1:0:0:0: [sdb] Attached SCSI disk
usbcore: registered new interface driver usblp
drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver
egiga0: mac address changed
egiga0: link down
egiga0: started
egiga0: link up, full duplex, speed 1 Gbps
ext3: No journal on filesystem on sda4
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
ext3: No journal on filesystem on sdb4
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
ext3: No journal on filesystem on sda2
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
ext3: No journal on filesystem on sdb2
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
Unable to find swap-space signature
NTFS driver 2.1.28 [Flags: R/O MODULE].
usbcore: deregistering interface driver usb-storage

Output of /proc/meminfo on the D-Link DNS-320

Here the output of cat cat /proc/meminfo on the D-Link DNS-320:

MemTotal:       125632 kB
MemFree:          9324 kB
Buffers:         17040 kB
Cached:          76964 kB
SwapCached:          0 kB
Active:          50308 kB
Inactive:        49620 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Dirty:              12 kB
Writeback:           0 kB
AnonPages:        5940 kB
Mapped:           6812 kB
Slab:            13964 kB
SReclaimable:     4364 kB
SUnreclaim:       9600 kB
PageTables:        420 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:     62816 kB
Committed_AS:    37288 kB
VmallocTotal:   516096 kB
VmallocUsed:       972 kB
VmallocChunk:   515120 kB

Output of /proc/cpuinfo on the D-Link DNS-320

Here the output of cat cat /proc/cpuinfo on the D-Link DNS-320:

Processor       : ARM926EJ-S rev 1 (v5l)
BogoMIPS        : 796.26
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

Firmwareupgrade Procedure for NAS-Devices with fun_plug

Configuration interface for upgrading firmware
This procedure allows you to upgrade (or downgrade) the version of the firmware running on the NAS. Although backups are always nice (if you have that option), the data stored on the NAS is not affected. Similarly, any servers (daemons) running under fun_plug are also unaffected (although they are temporarily turned off and later turned on again).

Note that this somewhat elaborate procedure is needed if you are running fun_plug. If you do not have fun_plug installed, or it is no running, you can should use the simpler instructions provided by Conceptronic with the firmware file.

Checking the firmware version

You can tell which firmware version you are running by using a web browser:

  • browse to the CH3SNAS using an IP address (default is http://192.168.0.20) or a network name (maybe http://CH3SNAS)
  • If this brings you to a web page you created yourself, you are likely running fun_plug and have the lighttpd HTTP server running on port 80 and need to use port 81 to reach the configuration screen (e.g. using http://192.168.0.20:81). If you don’t know what funplug is, you are not using it and you can ignore this comment.
  • login as admin
  • Then go to: ”Configuration” >> ”Tools” >> ”Firmware”

This should get you to the screen shown in the picture.

Downloading firmware versions

An overview of the current stable version, any more recent beta (or “Release Candidate”) versions, or older versions can be found here.
The page contains links to sites where the firmware can be downloaded. After downloading the required version you will need to unzip or unrar it.

Installation if you don’t use funplug

If you are not running fun_plug, you can simplify things by following the instructions in the PDF readme file supplied with the downloaded firmware rather than following the fancier instructions below which assume you may be running various special servers and running with special settings.
So, in the following, we assume that you are running fun_plug.

Temporarily reactivate Telnet

If you are running funplug, it is likely that you enabled ssh (Secure Shell) and disabled telnet for security reasons. After the reboot, all modifications to /etc/passwd and /etc/group are gone, which is why we need to temporarily reactivate telnet to ensure that we can login after the upgrade:

  • run ssh (e.g. using PuTTY)
  • activate the telnet daemon so you can easily login later:
    cd /ffp/start
    ls -al telnetd.sh
    chmod a+x telnetd.sh
    ls -al telnetd.sh

    This means that on the next reboot telnet should be enabled.

Notes on CH3SNAS Firmware 1.05 regarding the fan

If you are upgrading from a pre-1.0.5 firmware version to version 1.0.5 or later, you may decide to replace the special fan control script “fanctl” from Fonz (see the fan control tutorial) with the standard fan control feature built into the Conceptronic firmware.

Which option is better? The firmware version 1.0.5 has a very simple fan control algorithm. The fan only runs when the internal temperature is 43°C or higher. This is a bit high. Furthermore, the fan speed does not depend on the temperature: the fan is either on or off. Fonz’ solution instead increases the fan speed as the temperature rises. This avoids the fan repeatedly turning on and off when the fan needs to spin, but doesn’t need to run at full speed.

If you decide to try the firmware’s solution, you can deactivate Fonz’ control program using:

cd /ffp/start
sh fanctl.sh status
ls -al fanctl.sh
chmod a-x fanctl.sh
ls -al fanctl.sh

The 2nd line reports whether the fanctl utility is running. The chmod a-x causes the special fan script to be disabled on the next reboot.

Temporarily disable funplug

Rename the file fun_plug to fun_plug.bak to deactivate ffp on the next boot. You can easily do this using e.g. Windows Explorer or using the command shell:

cd /mnt/HD_a2
ls fun_plug*
mv fun_plug fun_plug.bak
ls fun_plug*

Saving settings

Write down any special configurations you have set up in the system.

The main place to look is in the ”Advanced” tab of the Configuration web page. Write down a reminder to set any particular settings such as ”’users”’ who have access, ”’groups”’ you may have created, ”’ftp access”’ you may have given to groups, etc. If you forget to reconfigure these, you will find out later when e.g. an ftp account doesn’t work. Unfortunately there is no simple way to save these settings and later reload them: you will, for example, have to reenter or define new passwords.

The other setting worth saving is any non-default IP address or network name of your CH3SNAS.

Installing new firmware

Update the firmware via the web interface (see picture above). During the update, you will get a progress bar. Then, after confirmation, the CH3SNAS will reboot.

Next reset the CH3SNAS firmware settings to the factory defaults (the new firmware may interpret settings stored in Flash memory differently that the previous version). This step is mandatory to ensure correct operation!

  • Open the configuration page
  • Goto: Tools >> System >> Restore To Factory Default Settings

This will cause another reboot during which the IP address, group/user information, user privileges will be lost. Your browser may not find the device again if you use a non-default name. Try the default “http://CH3SNAS/” or using Conceptronic’s “Easy Search Utility” to find your NAS in the network.

Basic configuration

At this point, the administrator password is empty, so you can log onto the Config web page as admin with an empty password. Then you need to run Setup >> Run Wizard to get the basic settings correct again. These include

  • the admin password
  • timezone and daylight savings time setting
  • IP address (if set to static)
  • the network workgroup
  • the network name of the CH3SNAS

This will lead to a restart after which you will also be able to see the CH3SNAS under its original name on the network and the stored data should be accessible.

Fun_plug

At this point you cannot access the CH3SNAS via either telnet or ssh because an out-of-the-box CH3SNAS does not enable either daemon:

  • rename fun_plug.bak back to fun_plug using SAMBA (e.g. using Windows Exporer)
  • reboot the CH3SNAS (e.g. using the Configuration page: Tools >> System >> Restart).
    Note that before the reboot, your Config page is on port 80. It may be on port 81 after the reboot. From this point on telnet should work again.
  • Login with telnet and set the root password again using this procedure. This ends with running store-passwd.sh to save the password information.
  • deactivate telnet again (first be sure ssh is running!) using an ssh session on PuTTY:
    cd /ffp/start
    ls -al telnetd.sh
    chmod a-x telnetd.sh
    ls -al telnetd.sh
    sh telnetd.sh stop

    The final line stops the telnet daemon, so from this point on you (only) have access via the much more secure ssh.

User settings

You can now redefine any required user- and group settings (e.g. for ftp users).

Note that after updating the firmware, the NAS will spend a few hours reindexing the hard disks (searching for movies and audio-files) for the itunes and UPnP-services. You can stop this activity by deactivating the respective services.

Compiling Software for the Fonz fun_plug

This tutorial is for advanced users only!

Fonz provides many pre-compiled packages for the NAS in his repository, but obviously cannot provide every package which someone out there might need. So to help users compile and link packages themselves, Fonz has created a complete software environment for building packages for the NAS device.

This ffpbuildenv environment consists of a few scripts and a standardized process for building software packages. It runs on the NAS itself, rather than requiring special cross-compilation tools on a PC. This helps guarantee full compatibility with the target system and ensures that the environment is familiar to developers with a Linux background.

The following tutorial builds on Fonz’s work, but also contains procedures and descriptions by Uli. User PeterH did his usual testing and polishing routine on this text.

Contents

Preparations

Setup a fun_plug and install ALL packages available as described in the linked tutorial.

Setup

ffpbuildenv can best be installed on one of the hard disks:

mkdir /mnt/HD_a2/ffpbuildenv
cd /mnt/HD_a2/ffpbuildenv
svn co svn://inreto.de/svn/dns323/funplug/trunk .

These steps create a new directory on drive /mnt/HD_a2/ and copy the required files from Fonz’ repository using the [http://en.wikipedia.org/wiki/Subversion_(software) Subversion] version control system.

General Use

Chrooting to the build environment

To get a well-defined environment, you chroot to this directory using a script appropriately called chroot.sh:

cd /mnt/HD_a2/ffpbuildenv/
sh chroot.sh
cd /mnt/HD_a2/ffpbuildenv/source/

It makes the ffpbuildenv look like the root directory of the file system, at least for the current process. Note that the chroot step creates a new command shell running within your current command shell: if you later exit from the that shell, you end up back in the original shell.

Downloading the distribution file

cd /mnt/HD_a2/ffpbuildenv/source/
./Make.sh -F <PACKAGENAME>

Compiling a package

cd /mnt/HD_a2/ffpbuildenv/source/
./Make.sh <PACKAGENAME>

The compiled and packaged archive is placed in /mnt/HD_a2/ffpbuildenv/packages/ then. Errors are logged to /mnt/HD_a2/ffpbuildenv/build-logs/--.log

Setting up a package

If you take a look into the directory of a package, you will see several files. In the following text, I will describe lighttpd if not stated otherwise.

Required files

PR

Tells the Revision of the compiled package. E.g. if you compiled a package, forgot to include something and want to redo the package, e.g. the third version of php-5.2.6: php-5.2.6-3.tgz

1

PV

This is the version of the source code, e.g. lighttpd-1.4.20.tar.bz2

1.4.20

SRC_URI

Link to the source-file. You can use the following variables:

  • $PV – Packageversion – Value from above
  • $PN – Packagename – Value from above
  • $P – Concated Variable: “Packagename-Packageversion” ($PN-$PV)
http://www.lighttpd.net/download/lighttpd-$PV.tar.bz2

This will result in http://www.lighttpd.net/download/lighttpd-1.4.20.tar.bz2

Optional files

DESC

Describes the package. If present, it is shown during installation.

Lighttpd is a secure, speedy, compliant, and very flexible web-server
which is designed and optimized for for high-performance environments.
With a small memory footprint compared to other web-servers, effective
management of the CPU-load, and advanced feature set (FastCGI, SCGI,
Auth, Output-Compression, URL-Rewriting and many more) lighttpd is the
perfect solution for every server that is suffering load problems.
[pkgsrc]

HOMEPAGE

This is the general homepage of the program.

http://www.lighttpd.net/

doinst.sh

This file gets executed during the installation of a compiled package. Here you can add additional commands, like adding system accounts or printing additional information.

This file is not needed in lighttpd, the code below is from sudo

def()
{
        if [ ! -r "$1" ]; then
                mv $1.new $1
        elif cmp -s $1 $1.new; then
                rm $1.new
        fi
}
 
def ffp/etc/sudoers

configure.sh

This file is used for configuring the source code with other commands than ./configure. If it is not available ./configure with the optional configure_args (see below) will be run in the source directory.

This file is not needed in lighttpd, the code below is from openssl

    ./config \
        --prefix=$CPREFIX \
        --openssldir=$CSYSCONFDIR/ssl \
        zlib shared

configure_args

These arguments are used, if there is no configure.sh available in the directory. Only the part after ./configure is included!

--libdir=$CPREFIX/lib/$P
--program-prefix=""
--with-openssl
--with-pcre
--with-zlib

destdir.sh

Optional

This file is used for “make” on the source code. If it is not available,

make DESTDIR=$D install

will be used in the source directory.

This file is not needed in lighttpd, the code below is from screen

    make DESTDIR=$D install
    mkdir -p $D$CPREFIX/etc
    install -m 0644 etc/etcscreenrc $D$CPREFIX/etc/screenrc

destdir-*.sh

Additional actions like moving or adding files. * can be replaced by etc or whatever, they all are run after compilation.

This is the content of destdir-etc.sh:

mkdir -p $D$CPREFIX/etc/examples
cd $X/etc/examples
install -m 0644 -o root -g root \
        lighttpd.conf lighttpd.conf-with-php \
        $D$CPREFIX/etc/examples

start-*.sh

These files get installed into the directory “/ffp/start/” during the installation. These contain a starter file.

This is the content of start-kickwebs.sh:

#!/ffp/bin/sh
 
# PROVIDE: kickwebs
# REQUIRE: LOGIN
# BEFORE: lighttpd
 
. /ffp/etc/ffp.subr
name="kickwebs"
start_cmd="kickwebs_start"
stop_cmd=:
 
kickwebs_start()
{
        echo "Kicking webs ..."
        killall webs
}
 
run_rc_command "$1"

This is the content of start-lighttpd.sh:

#!/ffp/bin/sh
 
# PROVIDE: lighttpd
# REQUIRE: LOGIN
 
. /ffp/etc/ffp.subr
 
name="lighttpd"
command="/ffp/sbin/lighttpd"
lighttpd_flags="-f /ffp/etc/lighttpd.conf"
required_files="/ffp/etc/lighttpd.conf"
 
run_rc_command "$1"

Walk-through

Install an editor (like nano), you will need one for editing the above files.

This walk-through will show you how to compile nano.

We start by changing to the correct directory:

>cd /mnt/HD_a2/ffpbuildenv/source/

Now we create the directory and change to it:

mkdir nano
cd nano

We open http://www.nano-editor.org/ for the latest stable version, which is 2.0.9. Open the file PV for the package version:
And enter 2.0.9.

Reset PR, we do this process for the first time. Open PR:
And enter 1.

Now we search for the [http://www.nano-editor.org/download.php download-url]. Is there a consistent way of numbering the releases? The example of nano shows us this numbering:

http://www.nano-editor.org/dist/v2.0/nano-2.0.6.tar.gz
http://www.nano-editor.org/dist/v2.0/nano-2.0.7.tar.gz
http://www.nano-editor.org/dist/v2.0/nano-2.0.8.tar.gz
http://www.nano-editor.org/dist/v2.0/nano-2.0.9.tar.gz

Do you see the similarity?
If so, then we can substitute the version by using $PV:

http://www.nano-editor.org/dist/v2.0/nano-$PV.tar.gz

If not, you need to enter the url manually:

http://www.nano-editor.org/dist/v2.0/nano-2.0.9.tar.gz

Pull this URL to SRC_URI.

Now we fulfilled the requirements for compiling, but nano will fail in some sections with these settings due to missing libraries (spellchecker). So we need to add some configure arguments using configure_args:

--enable-nanorc
--enable-color
--enable-multibuffer
--disable-speller

Now everything is set for compiling. Now we chroot to the respective directory:

sh /mnt/HD_a2/ffpbuildenv/chroot.sh
cd /mnt/HD_a2/ffpbuildenv/source/

And run the download:

./Make.sh -F nano

And run the compilation:

./Make.sh nano

This will take a while. If you get you prompt back and the line above states “OK.” everything went fine and you will find the final package in /mnt/HD_a2/ffpbuildenv/packages/. Otherwise, you should check the log:

tail /mnt/HD_a2/ffpbuildenv/build-logs/nano*log

Installation of phpMyAdmin on Fonz fun_plug

What is phpMyAdmin

Quote from Wikipedia:

phpMyAdmin is an open source tool written in PHP intended to handle the administration of MySQL over the World Wide Web. It can do various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements; or managing users and permissions.

The installation on the NAS-Device requires a working lighttpd with php and the MySQL-Database server. Please follow the respective tutorials for the installation of these.

Download and unpacking

Check the homepage of phpMyAdmin for the current version and download it. As of 13-Dec-2010, this latest non-beta version is 3.3.8.1:

cd /srv/www/pages/
wget http://switch.dl.sourceforge.net/sourceforge/phpmyadmin/phpMyAdmin-3.3.8.1-all-languages.tar.gz
tar -zxf phpMyAdmin-3.3.8.1-all-languages.tar.gz
rm phpMyAdmin-3.3.8.1-all-languages.tar.gz
mv phpMyAdmin-3.3.8.1-all-languages phpmyadmin

Now you have a directory called phpmyadmin in the webroot of your lighttpd.

Configuring

Now we need to add a configuration-file for phpmyadmin. We use nano for this:

cd /srv/pages/phpmyadmin/
nano config.inc.php

Simply copy the content below to this file:

<?
/* Servers configuration */
$i = 0;
/* Server localhost */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'http';
?>

Errors and Remarks

  • The auth_typehttp” was chosen as cookie is extremely slow without the php-extension mcrypt which is not compiled into the current php-versions
  • If you get an error with the code #2002, you have to change the host to “127.0.0.1” and add a comment in the file my.cnf of mysql on the line skip-networking
  • If you get the error The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results, you have to enable the mbstring-extension in the php.ini of your NAS.

Finally

Now you should see phpmyadmin under http://CH3SNAS/phpmyadmin (substitute CH3SNAS with the network-name of your NAS-Device).
For further information consider reading the documentation online.

Firmware Versions of the Conceptronic CH3SNAS

1.05b05

At present, this version is probably the final 1.05 Firmware. This may change.

Fixes

  • UPnP Server does not allow single quote ‘ in foldernames
  • Special characters like “!” in password could not be used anymore

1.05b04-r160

Offically released!

Fixes

  • Due to some changes internally the UPnP server could not restart in certain situation. This UPnP Server is supporting XBOX360 as well as PlayStation 3
  • When a new disks already has an partition inside, the formatting failed in certain cases.

1.05b3

Beta Firmware, not officially released!

New Features

  • Support for XBOX360.
  • Displays the uptime in one of the menus.
  • Support for certain Hitachi drives

Fixes

  • Improved the imprecise counter of disk formatting.
    Note: make sure there are no old partition at all on the HDD (especially when using a previously used HDD. If a partition exists, the format can fail almost immediately after starting the formatting.)
  • LAN speeds is always providing speed: 0 (see SETUP – LAN in User Interface)
  • Email alert issue: unable to send email with some SMTP server.
  • UPnP AV server can play MKV video, but can’t play VOB and HD DivX video.
  • Schedule download function failure.
  • FTP function failure.

Other Notes

  • Unified the error message wordings between UserInterface and EasySearch Utility.

1.05b1

The zip file is called CH3SNAS_FW_UPD_v1.05b1.zip, but the “b1” does not mean it is a beta version: the version has been officially released by Conceptronic.

New Features

  • Support for 1.5TB hard disks
  • Updated fan script (fan stops when internal temperature drops below 43°C).
    Note that a more sophisticated solution is available for users runing fun_plug. This fun_plug-based solution is, however, not supported by Conceptronic.
  • RAID migration: Normal to RAID 1
  • Add .info domain support for email alerts.
  • Password supports more special characters (except these five : @ : / \ %)

Fixes

  • FTP server supports Korean and Turkish code pages now
  • 1st HDD was unable to sleep
  • Time drift issue: the clock time always increased by 1 hour after every reboot when daylight savings time was activated.
  • Removed the Auto Refresh Timer. It uses Inotify for UPnP AV and iTunes Server auto refreshing.

Other Notes

Note on 1.5 TB HDD support: make sure the hard disk is EMPTY and has no partitions or what-so-ever ..

Known Bugs

  • Email alerts not working
  • uptime” shows the wrong value
  • Current speed of the network is always shown as 0
  • Underscores are no longer accepted in passwords
  • Creating Folders in the webinterface is no longer possible

1.04RC6

This is a Release Candidate rather than a formal release.

1.04RC5

This is a Release Candidate rather than a formal release.

1.04RC4

This is a Release Candidate rather than a formal release.

1.04RC3

This is a Release Candidate rather than a formal release.

1.04RC2

This is a Release Candidate rather than a formal release.

1.04RC1

This is a Release Candidate rather than a formal release.

1.03

This is a formal release.

Exit mobile version