Vaibhav Singh

Blog - vaibhavsingh.com

Tinkering with embedded linux on a WD MyBook NAS

Here is the deal, I have a Western Digital MyBook 1TB NAS. It runs a trimmed version of Linux, called BusyBox. For the past two weeks I’ve been busy hacking and customizing it.

Linux MyBookWorld 2.6.17.14 #1 PREEMPT Fri Jan 18 10:40:25 GMT 2008 armv5tejl GNU/Linux

Recently after upgrading to latest firmware version 2.00.18, I found that gcc was missing. I started following this guide to restore gcc. But, as darn Murphy would have it, I didn’t read the whole thing and just executed
find / -name *gcc*mv /lib/libgcc.* /tmp which was a huge mistake.

The guide directed to delete files only in the /usr folder! But, I moved or deleted items from /lib!

Now, none of the commands were working, cp, mv, wget, ls, ln.

I tried the following as a trial fix:

The Solution

Finally, I hit the pay dirt. The following fixed my cp command and I was able to restore the missing files!

LD_LIBRARY_PATH=/tmpLD_PRELOAD=/tmp/libgcc_s.so.1
export LD_LIBRARY_PATH LD_PRELOAD

Just remember not to reboot the device once you did the screw up. Wait, sweat it out. I said to a colleague at office, “Its Linux, of course it can be FIXED without rebooting!”. Long live *nix!

PS: now, I am scared to reboot after fixing it, all hell might break loose!

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top