Access to Twonky Views folder

Hello, I would like to customize Media folder structure of DLNA (which is a terrible mess by default)

and I need access to /usr/local/twonky/resources/views/ folder.

I enabled ssh, and the only user I’m provided is sshd. When connected as sshd for some reason I don’t have write access to /views, I’m getting “Read only file system” message when trying to update any file in the folder or add a new one. I can write to other folders under twonky though.

Question - do I need “root” user to access the /views folder? If so, what is the default password?

Looks that welc0me doesn’t work.

Or, maybe I just need to disable Twonky temporary to update its files (not sure this is the case)?

No, you already have root access (sshd). The reason you do not have write access to the /views or anything under /usr/local/twonky/ is because that directory tree is under the read-only RAMdisk (root file system). It is a virtual drive mounted at boot-time with many important system-related files (primarily open-source GPL-licensed software). Hence you cannot touch anything under there. There is another directory, /usr/local/modules, where everything under it is read-only - this is where WD’s proprietary code is kept. There is a way to edit files in either of these directory trees - but that requires compiling the firmware from scratch (provided at WD’s downloads section under their website’s support section). To change files under the RAMdisk directory you have to modify the files in the RAMdisk part of source code ($HOME_DIR/firmware/ramdisk) and to change files related to /usr/local/modules you have to modify the code under $HOME_DIR/firmware/module.

I know this might sound complicated - and of course, by custom compiling the firmware you’d be voiding your warranty so this solution isn’t for everyone. But if you feel comfy with Linux, you can look at the instructions on how to compile the firmware inside the source code file.

Here’s some relevant info on the two filesystems:

/usr/local # df -h /usr/local/twonky/
Filesystem Size Used Available Use% Mounted on
%root% 54.2M 18.9M 32.5M 37% /


/usr/local # df -h /usr/local/modules/
Filesystem Size Used Available Use% Mounted on
/dev/loop0 89.1M 89.1M 0 100% /usr/local/modules


/usr/local # cat /etc/mtab
%root% / unknown rw 0 0
...
/dev/loop0 /usr/local/modules squashfs loop 0 0

Thnaks Cybernut1, I thought there would be easier solution just to remove few extra folder levels from twonky. I guess I leave it as is.

@Cybernut1

I have to bring up this topic again, because Twonky sort method by folder drives me insane.

It’s my fist post here, and I feel a little bit ashamed, that my fist question is, how to tweak the firmware. :confounded:

Cybernut1 wrote:

I know this might sound complicated - and of course, by custom compiling the firmware you’d be voiding your warranty so this solution isn’t for everyone. But if you feel comfy with Linux, you can look at the instructions on how to compile the firmware inside the source code file.

 

As far as I understood correctly you suggest to download latest WD Cloud EX2 GPL Source Code:

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

and modify  “…/firmware/module/crfs/twonky/resources/views/view-definitions.xml” directly

But what do I have to do, to get these changes in a valid firmware?

Due to release notes, there are the following steps:

  1. Introduction

  2. Install tool-chain

  3. How to build Kernel

  4. Open source modules list

  5. How to build Open source modules? For example: build attr-2.4.46

  6. Build the root file system

  7. Non-Open Source module: include all non-open source binaries

  8. Build the firmware

  9. Extract and setting HOME_DIR -> that’s the easy part.

But do I have to install tool-chain, build a Kernel, etc… or could I step directly to 6. 7. and 8. the get the same FW, then the official one, except for the changes, made to the Twonky config file?

Thanks in advice

… 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