LDSO_RUNPATH enabled firmware

bzhou:

For optware, the big obstacle on MBWE is the lack of LDSO_RUNPATH in stock /lib/libuClibc-0.9.28.so
This is becoming more and more annoying as you often need to adjust /etc/ld.so.conf

In order to be able to enable LDSO_RUNPATH support in mbwe-bluering uclibc without taking drive(s) out I've created a custom firmware using WD sourcecode.
Additionally, I've also:

v1: enabled SSH, added tun kernel module, eddited /etc/profile and /root/.bashrc to add /opt/bin:/opt/sbin to PATH, disabled mionet (you can reenable it if needed) and set root password to 'welc0me'

v2: added gcc, updated hdparm to v9.15 and used temperature monitor scripts by kyyhkynen

v3: restored NFS, XFS, updated sysklogd to sane v1.5, added ipkg in /opt for those who don't have optware installed yet or wish to start afresh, disabled ntpd (added /etc/init.d/timeupdate.sh script, which is run by /etc/init.d/post_network_start.sh at start time and every day at 12 am by crond instead), added a cron structure like on most distros (/etc/cron.min /etc/cron.daily /etc/cron.hourly /etc/cron.monthly) and some more kernel modules (such as ipv6, fuse, isofs, udf, nls_*, xfs,..). Unfortunately, some modules (ipv6, ipip) won't work with the official kernel (look here for some details), so you have to upgrade kernel as well to use them, thus, just in case, the firmware comes in 2 versions: firmware.v3.ofkernel.sh (official 02.00.18 kernel) and firmware.v3.mykernel.sh (my custom kernel - compiled using WD sources and configs with more additionally enabled modules).
Since no more issues have been reported, both firmware.v3.ofkernel.sh and firmware.v3.mykernel.sh are deprecated and replaced with firmware.v3.sh after fixing the PowerButton bug. Made one more minor change: look here for the info.
The fuse module was built using the latest stable v2.7.4: http://sourceforge.net/projects/fuse, so, unlike the one from 2.6.17.14 kernel, it can be used with ntfs-3g for full ntfs write access (look here for details). ntfs-3g itself is available on optware.
Edited upgrade script to preserve some existing user settings: /etc/hosts.allow /etc/hosts.deny /etc/syslog.conf /etc/smb.conf /etc/lighttpd. If you want to restore the FW defaults, they can be found in /etc/fwdefaults/

Thanks frater, kevku and alephsmith for tips on improving this FW.
And thanks everyone for the feedback!

Known issues:

  • Ethernet connection speed indicator on the admin page is displaying a question mark(?)

Status: currently ignored

  • MBWE ignores power button with firmware.v3.mykernel for some reason

Status: fixed in firmware.v3


HowTo Install

The firmware is shared "as-is" without guarantee of any kind.
Upgrading a firmware can easily render your mbwe unusable if something goes wrong, so be cautious!
First of all, note that the most of your settings and data on the first partition will be lost, so make backups before the upgrade.
Also, if you have optware installed on the first partition, I suggest you move it to the data partition so that you don't have to back it up and restore every time you upgrade your firmware:

# su -
# mv -f /opt /shares/internal
# ln -s /shares/internal/opt /opt

At this point I use a free file hosting service (i.e. no direct link), so you'll have to do this to install the FW:
1. Download a firmware from here as firmware.sh to your public share root
2. Copy it to lighttpd server.document-root dir. Default is /usr/www/lib

# su -
# cp /shares/internal/PUBLIC/firmware.sh /usr/www/lib

3. Stop any processes that run on/acces fourth partition; if you have opt dir on fourth partition - stop all optware programs/daemons, the easiest way to do this is to remove the /opt link and reboot.
That's important! I had to restore from backups after trying to upgrade with mc running on /shares/internal/opt
4. We'll need lighttpd, so if it's unable to start, restore original /etc/lighttpd/lighttpd.conf (you can find one here). Don't forget to stop samba, make sure lighttpd is running and finally make firmware upgrade
# /etc/init.d/samba.sh stop
# /etc/init.d/lighttpd.sh restart
# export NAS_NBIN=/usr/www/nbin/
# cd /usr/www/nbin
# ./getandapplyfw.sh http://localhost/firmware.sh

You'll see something like "e2fsck 1.38 (30-Jun-2005)….[continued…]", which meens the firmware is being upgraded.
5. After upgrade process ends, access your drive via ssh as 'root' using 'welc0me' password. And change root password:
# passwd root

(6). Additional step for those who have optware installed in /shares/internal/opt:
# rm -rf /opt
# ln -s /shares/internal/opt /opt

7. Restore your backups and have fun.

Troubleshooting

You may get error like

./commonfuncs: line 14: /setupPaths.sh: No such file or directory

Fix: set necessary environment variables manually in /usr/www/nbin/commonfuncs:
uncomment the lines in the beginning of the file like this:
export SMB_PATH=...
export SMB_CONF=...
...
export OXSEMI_HOME=...
export PERL5LIB=...

Add a line like this:
...
export OXSEMI_HOME=...
export NETWORK_SETTINGS="/var/oxsemi/network-settings"
export PERL5LIB=...
...

And comment out this line:
#. $NAS_NBIN/setupPaths.sh

Best regards,
Alex

P.S. The support thread is here

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License