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


#11

Hi @Fox_exe.
Thank you very much for your help!
I used your guide and wdcrack and my first problem is solved! Fantastic!

Now I have some questions for you.

1 - How can I create/modify apps?
2 - How can I update the version of twonky that saves itself every reboot? (config included if possible).
3 - What is the apkg.sign file?
4 - There are some commands that I can use at every reboot to optimize the system?

Thanks a lot

D


#12
  1. Download “Third party app GPL sources” from WD website. There is mksapkg tool for build WD App package
  2. Make “App” (Use any of GPL “sources” as base).
  3. apkg.sign & apkg.xml automatically generated by mksapkg tool, based on apkg.rc data
  4. Hmm… If you found something usefyl - add it to init.sh in any app (This file executed firs after reboot / while OS boot)

For unpack compiled apkg (app) use 7zip (He can automatically skip header info).
About fil structure inside app:

  • apkg.rc - Main file, info about this app
  • before_apkg.sh - Script, run before apkg install
  • preinst.sh - Preinstall script, exec before install.sh, but after before_apkg.sh
  • init.sh - exec every time, when OS start.
  • Install.sh & remove.sh - install/remove scripts
  • start.sh & stop.sh - For control app (exec when user change “enable this app” checkbox in web gui)
  • web/desc.xml - localisation file / app info (For web gui)
  • web/app_name.png - app icon for web gui
  • web/index.html - App web page for control.

#13

There i a builtin feature of the gen2 that will run a mfg_start on reboot. If a mounted USB is named mfg_WDMYCLOUD and contains a file called fun_plug. You can see this code in /usr/ocal/modules/script/system_init.

RAC


#14

Hi @Fox_exe.

1 - Ok, found it.
2 - my first problem. I installed the tar.gz under ubuntu, but I didn’t find how to launch the program. also, there isn’t a source for twonky or other dlna in it.
3 - Ok understood
4 - I asked if there is already a list of tested useful command to insert into the init.sh file (for example in your wdcrack :slight_smile: )

I have some problem to use the same login id twice. So I must change every time. There is a way to send a private message into the forum?

Bye


#15

is there a possibility to change townky with another dlna server? for example plex or minidlna.


#16

Yes but it typically involves using SSH to modify or replace the existing My Cloud OS with an alternate OS. Use the forum search feature, magnifying glass upper right, to find other discussions on using alternate media servers and other features. Here are several past discussions:

https://community.wd.com/t/wd-mycloud-gen2-chroot-transmission-and-minidlna/148686

https://community.wd.com/t/app-minidlna-original-patched-for-firmware-v4-10-2015/94354

https://community.wd.com/t/clean-os-debian-openmediavault-and-other-firmwares/93714

https://community.wd.com/t/using-plex-media-server-with-my-cloud/94429/13

Note: Such modifications are NOT supported by WD and if one isn’t careful they can “brick” their My Cloud rendering it inoperable and requiring an “unbrick”.


#17

I was able to run the debian chroot services via the package and guide provided by FOX_EXE - thank you very much FOX_EXE. :smiley:

However, now am trying to run this chroot services automatically after every restart…I followed the guide above but still unsure I am doing the right job…

Can someone please guide me through this?

Basically, I have the chroot executable (.sh) file placed in /mnt/HD/HD_a2/chroot and need this to auto run after every restart.


#18

In simple - Create /etc/init.d/** script and enable it via update-rc.d.

Ps: Chroot start script just runs all scripts from /etc/rc3.d/


#19

I am sorry, I believe I have confused you :frowning:…I want to know the procedure to auto run the following command, “/mnt/HD/HD_a2/chroot/chroot-debian.sh start”, everytime WD MY Cloud Gen2 starts or reboot.


#20

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


#21

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


#23

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.


#24

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


#25

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?


#26

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


#27

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:


#28

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.


#29

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.


#30

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.


#31

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.