LDSO_RUNPATH
Forum » Forum / Optware » LDSO_RUNPATH
Started by: bzhoubzhou
On: 1215199573|%e %b %Y, %H:%M %Z|agohover
Number of posts: 12
rss icon RSS: New posts
LDSO_RUNPATH
bzhoubzhou 1215199573|%e %b %Y, %H:%M %Z|agohover

I see Fry's has MBWE 500GB on sale (July 4th 3-day sale) for $129. Really tempting.

I have a couple of NAS boxes already, so I'll probably pass. Unless someone want to donate me one via nslu2-linux.org :-). Seriously, people happy with optware should consider donate to nslu2-linux. That's how we can pull resource together.

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

I hope someone with the skill and determination can step up and fix this. I believe everything needed for this to happen is there. What's involved?

  1. Read carefully http://www.ismprofessional.net/pascucci/documenti/mybook/mybook-hacking-en.html
  2. Download WD GPL source
  3. Build cross toolchain with provided buildroot, see #1 for config
  4. Build uclibc with the cross toolchain, see #1 for config, make sure LDSO_RUNPATH is set to yes in uclibc config
  5. Test the new uclibc by replacing /lib/libuClibc-0.9.28.so

Before making the change, make a backup of that file of course; and be prepared to take the hard disk out to recover if it's not working.

-Brian
bzhou at nslu2 dash linux dot org

last edited on 1215209316|%e %b %Y, %H:%M %Z|agohover by bzhou + show more
unfold LDSO_RUNPATH by bzhoubzhou, 1215199573|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
alephsmithalephsmith 1220873429|%e %b %Y, %H:%M %Z|agohover

Hi Brian,

Well I have muddled my way through setting up the toolchain and have enabled LDSO_RUNPATH.

So essentially I pull the /libuClibc-0.9.28.so from the arm toolchain and copy it over to my MyBook? Sorry if I sound a little vague, this is about as in depth as I have ever gone with linux.

unfold Re: LDSO_RUNPATH by alephsmithalephsmith, 1220873429|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
bzhoubzhou 1220908188|%e %b %Y, %H:%M %Z|agohover

Hi alephsmith,

If you have built your own uClibc-0.9.28.so with LDSO_RUNPATH enabled, it should work by replacing /lib/libuClibc-0.9.28.so on you MBWE. As I said, be prepared to take the hard disk out and mount on another Linux PC to recover if it's not working. Wish you good luck.

From optware point of view, I'm more interested in the toolchain build procedure. If you can provide the procedure (either step-by-step or automated), I can work on a optware feed just for MBWE.

Best regards,

-Brian

unfold Re: LDSO_RUNPATH by bzhoubzhou, 1220908188|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
alephsmithalephsmith 1220914200|%e %b %Y, %H:%M %Z|agohover

OK. Seems to work fine.

The toolchain was relatively easy to build on Ubuntu (I had been struggling to get it to work on OS X for a while and finally gave up).

I haven't yet tried to build anything not included in the WD sources, however I don't think I'll run into any problems there.

I'll put together some instructions when I get a chance. Do you just need a step by step, or any other specific details? I would love to have an MBWE specific feed so I'm willing to bend over backwards for you :)

unfold Re: LDSO_RUNPATH by alephsmithalephsmith, 1220914200|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
bzhoubzhou 1220927312|%e %b %Y, %H:%M %Z|agohover

That's great news. So you can confirm that you no longer need to use ldconfig?

A step-by-step for the toolchain would be fine.

The goal is to achieve the following (assuming we already have optware/platforms/{toolchain,packages}-mbwe.mk) :

svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
cd optware; make mbwe-target
cd mbwe
make directories ipkg-utils
make toolchain
make hello-ipk    # or any package

The toolchain build happens at "make toolchain" stage using optware/platforms/toolchain-mbwe.mk, you can also see optware/platforms/toolchain-*.mk as example, esp. those using uclibc.

So, the more you can automate, the less work I need to do.

last edited on 1220927426|%e %b %Y, %H:%M %Z|agohover by bzhou + show more
unfold Re: LDSO_RUNPATH by bzhoubzhou, 1220927312|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
alephsmithalephsmith 1221026957|%e %b %Y, %H:%M %Z|agohover

OK. I just tired the following test. I removed both transmission and gettext packages.

After reinstalling them, I was unable to start transmission because it couldn't find libintl.so.3. ldconfig fixed this.

This got me thinking, is uClib being built with my modified config. There is a second .config file called uClibc.config-locale and I have a feeling that this is being used, not the file I modified. I will try to rebuild the tool chain and see.

last edited on 1221028292|%e %b %Y, %H:%M %Z|agohover by alephsmith + show more
unfold Re: LDSO_RUNPATH by alephsmithalephsmith, 1221026957|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
alllexxalllexx 1239463437|%e %b %Y, %H:%M %Z|agohover

Hi Brian,
I've built the toolchain with LDSO_RUNPATH support and replaced the original libuClibc-0.9.28.so with cross-compiled one.

Using username "root".
root@192.168.1.206's password:
-bash: '/lib/libc.so.0' is not an ELF file
id: '/lib/libc.so.0' is not an ELF file
/bin/hostname: '/lib/libc.so.0' is not an ELF file
[root@WDStorage ~]# mc
mc: '/lib/libc.so.0' is not an ELF file #but did run ok
[root@WDStorage ~]# rm /etc/ld.so.conf
[root@WDStorage ~]# ldconfig
ldconfig: can't read header from /lib/libuClibc-0.9.28.so, skipping
[root@WDStorage ~]# mc
mc: can't load library 'libglib-2.0.so.0'

so, it appears that libuClibc-0.9.28.so alone is not sufficient to get LDSO_RUNPATH support right.
any ideas?
Alex
last edited on 1239463509|%e %b %Y, %H:%M %Z|agohover by alllexx + show more
unfold Re: LDSO_RUNPATH by alllexxalllexx, 1239463437|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
bzhoubzhou 1239463930|%e %b %Y, %H:%M %Z|agohover

I'm not sure, the "can't read header from /lib/libuClibc-0.9.28.so, skipping" message seems to indicate that the new libuClibc-0.9.28.so is corrupted.

unfold Re: LDSO_RUNPATH by bzhoubzhou, 1239463930|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
alllexxalllexx 1239465545|%e %b %Y, %H:%M %Z|agohover

My uClibc configuration is identical to http://www.ismprofessional.net/pascucci/documenti/mybook/config/mybook-uClibc-1.1.config with the sole exception of enabling LDSO_RUNPATH support, so I have not a single clue about how to solve this problem

UPD: Yeah, it really got corrupted somehow. Now it's the same as what alephsmith reported, even though it's certain that uClibc was compiled with LDSO_RUNPATH enabled

last edited on 1239466067|%e %b %Y, %H:%M %Z|agohover by alllexx + show more
unfold Re: LDSO_RUNPATH by alllexxalllexx, 1239465545|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
alllexxalllexx 1239466249|%e %b %Y, %H:%M %Z|agohover

Perhaps, I should replace ld-uClibc-0.9.28.so as well?

UPD: I'll have to connect the drives to my linuxbox to try this out and now I'm a bit short on time, so it will have to wait a few hours

last edited on 1239466600|%e %b %Y, %H:%M %Z|agohover by alllexx + show more
unfold Re: LDSO_RUNPATH by alllexxalllexx, 1239466249|%e %b %Y, %H:%M %Z|agohover
Re: LDSO_RUNPATH
alllexxalllexx 1239511634|%e %b %Y, %H:%M %Z|agohover

Replaced ld-uClibc-0.9.28.so and have a dead MyBook now. It loosk like restore procedure is my only option as restoring original files doesn't help

unfold Re: LDSO_RUNPATH by alllexxalllexx, 1239511634|%e %b %Y, %H:%M %Z|agohover
LDSO_RUNPATH - solved
alllexxalllexx 1239776280|%e %b %Y, %H:%M %Z|agohover

After all, I did manage to get LDSO_RUNPATH support right. It's pretty convinient not having to add all those lib dirs to ld.so.conf and "ldconfig"-ing:). To sum up, I messed up and the MyBook was unable to construct RAID on md1 (I have only one SATA USB suite, so had to deal with both drives separately).
Here are the libs http://rapidshare.com/files/221509857/lib.tar.gz.html
Note that you have to connect the drive(s) to your PC to rewrite the original ones in /lib. Don't forget to make backups and don't blame me if you screw your MBWE

Brian, are you still interested in the toolchain?

last edited on 1239785167|%e %b %Y, %H:%M %Z|agohover by alllexx + show more
unfold LDSO_RUNPATH - solved by alllexxalllexx, 1239776280|%e %b %Y, %H:%M %Z|agohover
New post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License