How to run a user boot script at MyCloud Gen2 (2.11.xx) devices

Look here: /mnt/HD/HD_a2/Nas_Apps/WDCrack/start.sh

1 Like

It just says “#!/bin/sh” - sorry, I am pretty new to this field hence confused still.

1 Like

ah, sorry:
/mnt.HD/HD_a2/Nas_Apps/chroot/start.sh

For WDCrack need only init.sh.

Note:
init.sh - Run only once, when device boot.
start.sh/stop.sh - when user switch “Enable/Disable this app” button in webgui.

1 Like

Hi @Bennor

Thank you very much.
I already reed more or less all that discussion.
As you said, there is the possibility to brink the wd, and so I prefer to ask all my questions about my doubts before to make mistakes and damages :wink:

I understood these steps:

1a - replace the existing os with a clean debian installation through the walkthrough you suggested me.
About this I have a question: transmission and minidlna are already installed into this os? because I don’t need transmission and I prefer plex than minidlna. there are others app already installed?
1b - start at every reboot the new os with the suggestions by @Fox_exe
Question about this step for @Fox_exe . Is wdcrack for gen2 firmware compatible with this new os?
2a - install the apps. In my case plex.
Which kind of plex source I must take? the 4.xx firmware version?
I don’t understand the walkthrough to install correctly plex.
I need to install other apps to mycloud?

Thanks a lot.

D

1 Like

Did you read this conclusion from someone who has installed Plex?

They concluded the MyCloud hardware isn’t up to running Plex.

Do you have any experience installing Linux operating systems and packages? The OS changes proposed in those threads aren’t simple, and most of the guides assume good familiarity with Linux and associated disk file systems. They’re really not for the inexperienced user.

Why do you want to replace twonky?

1 Like

Hi.
I missed that comment :confused:

I use linux but I’m not so able with the shell.

I want to replace twonky just because it isn’t updated.
Into my mycloud there is the version 7, that has many features missing.
i have a twonky 8 key and i use it with my old mybooklive and i’m very happy.
but with my cloud the version 7 don’t give me the same results (for example with subtitles and mkv files).

if I will be able to update twonky to the 8 version into mycloud i’m also very happy!
it will be the perfect solution, if possible.

I found very easy the installation of the wdcrack app by @Fox_exe, my hope was to find the same way to update twonky

1 Like

What version of Twonky are you running on MyCloud? Mine is 7.2.9-6

Subtitles seem to be supported; certainly reported success in my FAQ thread:

This also discusses updating Twonky on the MyCloud, and points to a discussion thread:

2 Likes

There are other features I need, for example chromecast support.
Also for me the subtitles doesn’t work if included into the mkv file, and some video codec aren’t supported.
only srt external files work.

so…
i reed the discussion you linked, and i tried this guide, but i found a problem:

/etc/init.d/twonky stop
/etc/init.d/twonky start

these commands don’t work. i think these are for a gen1 mycloud, not gen2 (like mine).

I’m able to replace the twonky folder with an update version, but when i try to start the service, it doesn’t work, even via the gui or via ssh.
second problem, i can’t launch the new twonky at every reboot.

I’m sure there is a way to do all these steps in an easy way. but I’m not so able to create myself the solution.
As I wrote above, I tried to understand the wdcrack app. if I’m not wrong, it can replace at every reboot some files with a personalized version.
This is, in my opinion, the way.
I can replace the files manually, but I’m not able to make an automatic script and most of all, I didn’t find a way to launch correcty the twonky services after the update.

1 Like

I tried doing this but it didn’t work…basically created a folder in /mnt/HD/HD_a2/Nas_Progs/chroot and added the content of “chroot-debian.sh” file to start.sh and saved; however, it is still not working :frowning:

Can someone please help me on this? I am trying for a while now to set this up but my bad mind could not find a solution yet.

1 Like

No problems using Chromcast with a My Cloud on my end. You need to make sure the app your using to access the My Cloud supports Chromecasting. The WD My Cloud app for Android does support casting from the My Cloud to Chromecast.

On the subtitle issue with MKV files may be a problem with the app or client playing the video and not necessarily the My Cloud. It depends on how the client is accessing the My Cloud. Is it using a file manager type connection or using DLNA (via the Twonky media server).

One may be able to stop/start the Twonky media server by turning the Media Streaming option in the My Cloud Dashboard > Settings > Media section on or off. Or one can access the Twonky adminstration page at http://wdmycloud:9000, select the Advanced menu option and there is a Restart Server button at the bottom of that page.

1 Like

I’ll try to use the wdcloud app with the chromecast.

the subtitle problem is not caused by the client player (samsung link of my tv) because with my “old” booklive and twonky8 it works better then with my new mycloud and twonky 7.

at the end, i can how to switch on/off the twonky when the version 7 starts, but if i replace the folder as suggested in the guide you linked, it doesn’t start. for this reason i search the ssh way to start/stop twonky.

1 Like

Ok. i made some tests.

I tried the chromecast via some apps.

first of all i installed wdmycloud app and i found a video file into the mycloud. it can be played through a video app (default video or vlc) but not connected within the chromecast.
the mycloud app doesn’t have an icon to connect the android device with the chromecast, instead youtube has it and works correctly.
i tried directly with vlc and also haven’t any results.
at the end i tried the trial version of bubbleupnp. it works, but only for mkv files. avi not supported. i tried with the “onthefly” conversion but the video is very low and the audio missing. also the conversion is only for 20 minutes.

there are other apps i can try?

@Fox_exe
are you interested to find a solution to the update of twonky?
I think that only to replace the original folder with the new files doesn’t work (for mycloud gen2).
i compared the file from the version 7 and version 8 and i found many differences.
also the position of files is very different compared to the guide for mycloud gen1.
in my opinion we need to stop/uninstall/block or something else the version 7 of twonky and to install the version 8 through a personalized app like yours.
is it possible in your opinion?

1 Like

Im not interested upgrade anything in official firmware bacause its pice of s**t.
Maybe i build few mod for OMV. But better - Full-worked Synology DSM (But here need some C++ coding…)

1 Like

Try Ex Explorer (Support chromecast streaming, include video/audio player, Samba support, and many other things)

1 Like

hi @Fox_exe.

i tried es file explorer+ chromecast plugin but it doesn’t cast the files. it start the connection to the chromecast and it get stuck.
also i tried:
plex --> i must buy the app before test it! incredible!
localcast --> starts the mkv and mpg files but not avi and some audio get stuck. (same as bubbleupnp)

other ideas?

about twonky. i not totally agree with you about how much twonky s**ks.
i use the version 8 from the first release with satisfation.
do you have an easy alternative? plex/bubbleupnp/minidnla compatible with gen2 mycloud?

i tried the software you suggested me to create my own app but i couldn’t start the program.

thanks.
bye.

1 Like

I’m pretty sure Fox is talking about the WD MyCloud firmware. Much of his excellent work has been porting alternative operating systems to the MyCloud hardware platform.

I’m not sure if he’s including Twonky in that…

1 Like

@cpt_paranoia, you’re right. maybe @Fox_exe was talking about the firmware and not about twonky.

in any case, my goal is to find a fully functional and updatable media server, to follow the new features and new files.
my needs only are: to watch avi and mkvs (someone with subs) via a smart tv and via a chromecast.
now i can’t do anything of this easilly.

1 Like

Hi there,
If you have a Gen2 device (something like DL2100, EX2100, DL4100, EX4100) with Firmware 2.xx.xx, look at this post:

Using this guide you will be able to generate your own custom Firmware with your preferred twonky Version inside.

Best regards and good luck…

1 Like

Slight improvement for the script

  1. Use sed to remove boot-script from crontab
  2. Add sleep
#! /bin/sh

CRONTAB=/var/spool/cron/crontabs/root
CONFIG=/usr/local/config
BOOTRUN=/tmp/bootscript-run

# Remove boot-script from crontab and
# recover crontab
sleep 60
cd $CONFIG
crontab -l > crontab.orig
sed -i '/boot-script/d' crontab.orig
cp crontab.orig $CRONTAB

# don't run twice
if [ -f $BOOTRUN ]; then exit 0
fi
touch $BOOTRUN


# boot code comes here

# root profile
cp profile.local $HOME/.profile

# other user jobs
2 Likes

Great job! I follow the instruction and it does run my script after reboot on my EX2!
I also add the same mechanism as preventing re-entry to prevent brick – hope it will work as my boot code does not meet issue so far.


CRONTAB=/var/spool/cron/crontabs/root
CONFIG=/usr/local/config
BOOTRUN=/tmp/bootscript-run

# Remove boot-script from crontab and
# recover crontab
cd $CONFIG
crontab -l > crontab.orig
# my modification 1: 
#   do not modify the original info,
#   to allow to compare two results later
sed '/boot-script/d' crontab.orig > crontab
cp crontab $CRONTAB

# don't run twice
if [ -f $BOOTRUN ]; then exit 0
fi
touch $BOOTRUN

# my modification 2: 
#    save a file in same folder as config.xml
ANTIBRICK=${CONFIG}/antibrick.lastbootfailed
if [ -f ${ANTIBRICK} ]; then exit 0
fi
touch ${ANTIBRICK}

# boot code comes here

# my modification 3: 
#  Boot code finishes successfully, 
#  so remove ANTIBRICK flag
rm ${ANTIBRICK}