Access to Twonky Views folder

… I thought that can’t be that difficult, so I gave it a try.

So I could share my notes with you, perhaps it could safe some minutes for someone. :smileyvery-happy:

Preparation** :**

I’m on a windows maschine, so I need a linux box fist:

Oracle VM Virtualbox

Link: https://www.virtualbox.org/wiki/Downloads

Debian GNU/Linux 6.0.6 alias squeeze

Size (compressed/uncompressed): 1.8 GBytes / 5.16 GBytes

Link: http://downloads.sourceforge.net/virtualboximage/debian_6.0.6.vdi.7z

First put enable the user ‘debian’ to do sodu commands, because the the scripts will use them.

Therefore open a terminal:

debian@debian:~$ su
Password: ***
root@debian:/home/debian# visudo

and add permission:

# User privilege specification
root ALL=(ALL) ALL
debian ALL=(ALL) ALL

after that you can exit root and go on with the debian user.

This image has Guest Additions ready installed, so you can easy share folders between Host und VM.

Just define a Shared folder [e.g. c:\vm_share] on your Host System and create a folder in your Guest System [e.g. /tmp/vm_share] and mount it like this:

debian@debian:~$ mkdir /tmp/vm_sharedebian@debian:~$ sudo mount -t vboxsf vm_share /tmp/vm_share

Last thing, before we start, is to download and install a missing util.

pax à p ortable a rchive e x change (missing in the VM)

Link: https://packages.debian.org/de/sid/i386/pax/download

debian@debian:~$ sudo dpkg -i pax_20120606-2_i386.deb

Now the actual work

Download latest WD Cloud EX2 GPL Source Code:

Link: http://support.wdc.com/product/download.asp?groupid=906&sid=220&lang=en

… and extract (may take a long while).

Note: You need to copy the file to local folder, witch is not the Shared Folder, because tar can’t create symbolic links on NFS. (e.g. /home/debian/tmp)

I copy & paste from Release Notes now:

1. Introduction
    This file will show you how to build the WDMyClound EX2 firmware.
    1.1 # tar zxvf WDMyCloud_EX2_GPL_v1.05.25_20141110.tar.gz
    1.2 # cd WDMyCloud_EX2_GPL_v1.05.25_20141110
    1.3 # export HOME_DIR=pwd

Do your changes to Twonky Config
(in my case, I like to change the sort order for Music in the byFolder view)

debian@debian:~$ vi $HOME_DIR/firmware/module/crfs/twonky/resources/views/view-definitions.xml

replace:

<container name='byfolder' id='music/folders' class='object.container.storageFolder' createClass='object.item.audioItem.musicTrack'>
<container buildon='res' createClass='object.item.audioItem.musicTrack' class='object.container.storageFolder' />

  with:

<container name='byfolder' id='music/folders' class='object.container.storageFolder' createClass='object.item.audioItem.musicTrack'>
<container buildon='res' albumart='1' sortcriteria='+pv:numberOfThisDisc,+upnp:originalTrackNumber,+dc:title' createClass='object.item.audioItem.musicTrack' class='object.container.storageFolder' />

You can skip steps 2 to 6, as long as you don’t want to do more changes to the firemware. So go on with 7.

7. Non-Open Source module: include all non-open source binaries
    7.1 # cd $HOME_DIR/firmware/module
    7.2 # ./create_image.sh
    7.3 # cp -f my-image.cfs …/merge/image.cfs

8. Build the firmware
    8.1 # cd $HOME_DIR/firmware/merge
    8.2 make sure image.cfs, merge, uImage, uP.bin, uRamdisk are in the merge folder
    8.3 # ./merge
    8.4 WD-NAS-firmware will be created
    8.5 Update firmware with web UI

Cheers