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 /etc/mDNSResponderPosix.d. If you want to restore the FW defaults, they can be found in /etc/fwdefaults/

v3.1: fixed typos in the upgrade script to preserve /etc/lighttpd and /etc/mDNSResponderPosix.d correctly and fixed some rights/ownerships (look here for details)

v3.2: added cifs kernel module

v4: installed latest coreutils (v8.9) and util-linux (v2.19): look here for details.

v4.1:
1. Fixed the "refused to allocate pty" issue.
2. Fixed the cron structure: replaced busybox's run-parts with debianutils' one and fixed /etc/crontabs/root, so /etc/cron.min, /etc/cron.hourly etc. finally work properly.

v4.1.1: fixed the stock hotplugging to work with util-linux's mount

Thanks frater, kevku and alephsmith for tips on improving this FW.
Huge thanks to nl_amun for hosting firmware files.
And thanks everyone for the feedback!

Known issues:

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

Status: fixed in v3.1

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

Status: fixed in v3

  • Being unable to use the stock Web interface properly (look here for details)

Status: fixed in v3.1

  • There are some issues with the TeinturMan's Feature Pack Manager

Status: fixed in v4, look here for some details


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)
Thanks to nl_amun we finally have a direct link: from now on firmwares are hosted here. I'll still continue uploading them to mediafire, though, so that you have a mirror in case the server is down.
1. Download the firmware, unpack it and verify upgrade files' integrity

# wget http://classictrail.nl/mybookworld/ldso-runpath-enabled-fw/firmware.v4.1.1.sh # in case the server is down, you can download it from the mediafire mirror using you web explorer, save it to your public share and unpack from there
# sh firmware.v4.1.1.sh # this will unpack fw files to /var/upgrade
# cd /var/upgrade && md5sum -c md5sum.lst # this will verify md5 checksums

2. Stop samba and lighttpd, unmount the fourth partition and finally make firmware upgrade

# killall smbd nmbd lighttpd
# umount /shares/internal #in case this fails - stop any processes running on/accessing the fourth partition (e.g., do you have optware installed there?)
# /var/upgrade/upgrade1.sh # this will make some integrity checks and launch the upgrade

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

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

5. Restore your backups and have fun.

Troubleshooting

umount: /shares/internal: device is busy. (in step 3)

Sometimes /shares/internal can't be unmounted (step 3) despite no apparent usage of it:

# umount /shares/internal
umount: /shares/internal: device is busy.

First make sure that nothing access "/shares/internal" or "opt":

# ps aux | egrep "(/shares/internal)|(opt)"

You should only get back the grep command itself, nothing else (similar to this):

root      1172  0.0  0.9    656   296 pts/0    S+   22:28   0:00 grep -E (/shares/internal)|(opt)

If you got back more rows, try stopping or killing the processes for those other rows and try to unmount again.
If you still cannot unmount /shares/internal, try adding the -l option:

umount -l /shares/internal

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