[PACKAGE] Entware, the ultimate repo with about 2000 packages

Entware is a package manager with about 2000 packages for embedded devices.
This application is like the swiss army knife of embedded devices.

This installer gives you the latest version of Entware, the next generation branch of the former Optware.
It creates a folder /shares/Volume_1/entware and mounts it to /opt
The folder is hidden from samba (which is good).
It also creates /etc/profile with the updated path on boot.
Warning: when you uninstall this app, all entware packages will be gone.

The MyCloud NAS has a lot of outdated packages… Entware gets you up to speed.
Some example projects:

  • recent ssh for better security
  • setup dev toolchain with git, a nice editor, gcc, python3, …
  • tvheadend, transmission, rsync, …
  • cuberite minecraft server
  • php7 + Owncloud
  • Install a full debian chroot thanks to the full featured busybox

DOWNLOAD
Old download link

Source on github

Change log

2017-07-28 - v0.3 public release
2017-07-31 - v0.4 added /opt/etc/init.d/ support
2017-08-01 - v0.5 fixed issue with mounting /opt on boot
2017-08-05 - v0.6 fixed reboot and no longer deletes all entware apps on app upgrade/removal. Added /etc/profile for more ssh comfort.
2017-10-05 - v0.9 reboot finally works as intended. Cleaned up /etc/profile

2018-05-17 - v1.3 transition to new entware repo. Added persistent home dir support. Support the whole My Cloud range.

Warning: use this package at your own risk / responsibility.

2 Likes

Example: Transmission 2.92

I’d not run this together with the version in the WD app store but you could change the port in the transmission settings.
SSH into your box and type the following commands:

Refresh opkg packages

opkg update

Show transmission related packages

opkg list | grep transmission

Install the daemon and the basic web interface

opkg install transmission-daemon-openssl transmission-web

Start transmission with a link to the configuration dir.

transmission-daemon --config-dir /opt/etc/transmission

Transmission will start automatically on reboot of your box, as there is a boot script added in /opt/init.d/
You could also disable/enable Entware in the WD app store to activate the boot script.
You should modify the download dir to a more suitable location.

More advanced example: Cuberite

Cuberite is a lightweight minecraft server. Let’s build it from the sources!

Instructions of the official guide at https://book.cuberite.org/#1.2

mkdir cuberite
cd cuberite
sh -c "$(wget -O - https://compile.cuberite.org)"

The default WD wget fails here. Get a more recent one!

opkg install wget

Run the command again and check the output.
You need gcc, g++, git, make and cmake

opkg install gcc make git git-http

The gcc package includes both gcc and g++ and a handy environment script.
You need git-http for the ca-certificates to access https repos.
As the WD /bin/sh doesn’t have calc support, we need a better shell: install busybox.

opkg install busybox

Sometimes you must change the shebang (first line) to use the full featured shell instead.

nano /opt/lib/git-core/git-submodule
(change the first line to point to /opt/bin/sh, not /bin/sh) 

Cmake is not present in Entware… we need to get it manually!
Get a recent link to a linux 64bit binary from the website.

mkdir -p /opt/share/cmake
cd /opt/share/cmake
wget https://cmake.org/files/v3.9/cmake-3.9.0-Linux-x86_64.sh
sh cmake-3.9.0-Linux-x86_64.sh
(press spacebar to scroll through the license agreement)
(accept the agreement with Y)
(do not create sub dir with N)

Create a link to the new binary in the /opt/bin directory

ln -s /opt/share/cmake/bin/cmake /opt/bin

Alternatively you could’ve built cmake… but no need to go that deep.

Let’s install cuberite now. Get back to the desired install dir.

cd cuberite

Save the install script

wget https://compile.cuberite.org -O install.sh

Prepare the compiling environment as explained here and start the install.

source /opt/bin/gcc_env.sh
sh install.sh

Now go do the dishes and feed the cat while you wait for the compile job to finish.

Finally it says “Cuberite awaits you at xxx/cuberite/Server/Cuberite”.
Start the server with this path!

cuberite/Server/Cuberite --help
cuberite/Server/Cuberite

For configuration of the server, look here: https://book.cuberite.org/#2

Edit: if you have issues compiling with cmake, try this in the cuberite repo dir:

mkdir build && cd build
source /opt/bin/gcc_env.sh
cmake -DCMAKE_CXX_FLAGS="$CFLAGS $LDFLAGS" -DCMAKE_C_FLAGS="$CFLAGS $LDFLAGS"
make

Hello,

Thanks for sharing.

Hope this helps other users.

I’m currently fixing the reboot behavior.
You may get slow boot behavior and this message in the WD web interface:

Power was lost from the system. Performing file system consistency check. Please wait.

This happens when you have installed busybox (which you should :))… it creates an new reboot command that doesn’t go through all the cleanup steps of the WD shutdown. Best to rename it

mv /opt/sbin/reboot /opt/sbin/reboot-fast

It should be fixed in the upcoming v0.06 release.

EDIT: please let me know if you still have reboot issues.

How do you install it? via the busybox terminal? from the webapp?

You can install this package via the WD web interface in the applications section.
But you’ll use it mainly over SSH.

I’m releasing a EX2100 / EX4100 version one of these days.

Hi @rickyringring, how the hell did I not come across this years ago? Git it to work. Finally updated an app that’s way too old on WD’s server and looking forward to learning to set-up OpenVPN as a daemon.

Yes. Renaming symlink from reboot to another name (reboot-fast) worked. I had the same will-refuse-to-reboot issue and your tip fixed that.

One can only hope that in a future WD firmware update that WD don’t put anything else into /opt as you put your own there and re-establish the wd symlink. Without uninstalling Entware to find out, did WD only have the wd symlink within /opt?

entware does for sure give good skope to upgrade binaries and install scripts that persist across reboots.

Thank-you. :slight_smile:

For people who are not sure and don’t wish to brick their WD NASs, is there a robust step-by-step guide on downloading the entware sources, compiling anything that needs to be compiled, using mkapkg correctly to make a WD installable package for the last step of uploading to the apkg to the NAS to upgrade the installed entware app?

The disclaimer clearly states: use this at your own responsibility / risk.
WD support won’t help you unbrick whatever you break.

That said, have a look at the entware / openwrt github pages and wiki’s.
You may also be interested in my synocommunity fork which does exactly what you’re asking for: compile packages from source into a WD NAS binary.

Yep. In know about the use at your own risk bit. If a firmware update is needed I can copy the entware folder, remove entware, apply the update and then reinstall entware and copy files back to where they were.

Entware directory persists through firmware upgrade.

1 Like

I think two symlinks are not re-created on installation of entware. The WD created /opt folder is.

root@ZEUS /opt # ls -al
drwxr-xr-x    2 root     root             0 Feb 19 11:38 .
drwxrwxr-x   18 root     root             0 Feb 19 11:39 ..
lrwxrwxrwx    1 root     root            18 Feb 19 11:38 firefly -> /usr/local/firefly
lrwxrwxrwx    1 root     root            27 Feb 19 11:38 perl5.10 -> /usr/local/modules/perl5.10
lrwxrwxrwx    1 root     root            25 Feb 19 11:38 wd -> /usr/local/modules/opt/wd

firefly and perl5.10 are missing. I guess easy enough to recreate manually using ln?

root@ZEUS entware # ln -s /usr/local/firefly firefly
root@ZEUS entware # ln -s /usr/local/modules/perl5.10 perl5.10

Also if new busybox is installed then the /opt/sbin/reboot symlink needs to be renamed again or the NAS will not shut-down or reboot.

End result …

root@ZEUS root # ls -al /opt
drwxr-xr-x   13 root     root          4096 Feb 19 11:49 .
drwxrwxr-x   19 root     root             0 Feb 19 12:03 ..
drwxr-xr-x    2 root     root          4096 Feb 17 09:18 bin
drwxr-xr-x    8 root     root          4096 Dec 23 08:36 etc
lrwxrwxrwx    1 root     root            18 Feb 19 11:48 firefly -> /usr/local/firefly
drwxr-xr-x    2 root     root          4096 Dec 23 08:36 home
drwxr-xr-x   34 root     root          4096 Feb 17 09:05 include
drwxr-xr-x    6 root     root          4096 Dec 23 08:36 lib
lrwxrwxrwx    1 root     root            27 Feb 19 11:49 perl5.10 -> /usr/local/modules/perl5.10
drwxr-xr-x    2 root     root          4096 Feb 13 21:04 root
drwxr-xr-x    2 root     root          4096 Feb 19 11:57 sbin
drwxr-xr-x    7 root     root          4096 Feb 17 09:17 share
drwxrwxrwx    4 root     root          4096 Feb 17 09:12 tmp
drwxr-xr-x    4 root     root          4096 Dec 23 08:36 usr
drwxr-xr-x    6 root     root          4096 Dec 23 08:36 var
lrwxrwxrwx    1 root     root            25 Feb 13 21:04 wd -> /usr/local/modules/opt/wd
root@ZEUS root #

Entware’s Busybox reboot is normally blocked during installation by

ln -sf ${APKG_PATH}/sbin/reboot /opt/sbin/reboot 

I was not using/missing firefly and perl, but yeah, they should be symlinked during in install.sh.
Feel free to send in a merge request on github.

If only I had the time to do all of this. :frowning:
I’m an absolute newbie to Git, I’ve never compiled anything on Linux or the DL NAS. When I got to learn and know how to commit a change to Git, get the latest entware package, compile everything correctly and then make the package file for manual installation into the NAS, I would.

The entware package I obtained from https://wdcommunity.com/ which is version 1.05.

I have noticed a typo within ./bin/reboot that would prevent clean.sh from being called when /opt/bin/reboot is called. Will this be the fix to issue https://community.wd.com/t/package-entware-the-ultimate-repo-with-about-2000-packages/213711/5?

That’s okay, I really appreciate all the help :slight_smile:
I just asked for a MR to keep track of contributions.

You don’t need to worry about compiling / packaging, this is just a little script fix.
It has no impact as the original reboot will stop / clean all the installed applications anyway.
I think it’s even better to remove the whole line as it may cause problems in the clean.sh of other apps depending on entware.

I think I’ve versioned the entware package to 1.0 when I considered the reboot issue fixed…
But it’s a bit more complicated. See also https://github.com/WDCommunity/wdpksrc/issues/2
As long as you provide start-stop scripts in /opt/etc/init.d the reboots should be fine.

Hello,

I see this link is a bit old, but I just discovered it. I’m unhappy with the lack upgrades for the built in apps on my PR4100. I found the https://wdcommunity.com/ link a while back, but I didn’t know what Entware was until this thread, so I decided to give it a try.

It install’s, but I can’t do anything with it. The configure button is grayed out. Entware is v1.05 and my firmware version is 2.31.149. Is Entware to old to install?

Thanks

Daryl

For WD applications, the configure button redirects you to the web interface of that particular application.
As there is no web interface for Entware, the button is grayed out.
You can only interact with Entware packages via SSH with the opkg command. Some of my other packages require Entware because the OS3 firmware has outdated/missing packages (e.g. python).

I’ve got a Mono and FFmpeg package now but they also don’t have a web interface, so the button will be grayed out too.

I don’t seem to have the opkg command. How can install the opkg command?

/opt/bin/opkg

When you login over ssh after installing entware, it will use the bundled /etc/profile with opkg in the PATH