PDA

Bekijk de volledige versie : uClibc is not found



MoD
02-01-2007, 07:33
I'm playing with my and kfurge's firmware and get a strange error. I followed kfurge tutorial (http://home.comcast.net/~kfurge/wl700ge.html) to add opt library.

LD_LIBRARY_PATH path is OK:

# echo $LD_LIBRARY_PATH
/lib:/usr/lib:/opt/lib

The libraries are there:

# ls /opt/lib -l
-rwxrwxrwx 1 root root 21412 Aug 12 15:17 ld-uClibc-0.9.28.so
lrwxrwxrwx 1 root root 19 Dec 31 13:05 ld-uClibc.so.0 -> ld-uClibc-0.9.28.so
lrwxrwxrwx 1 root root 9 Dec 31 13:05 libc.so -> libc.so.0
lrwxrwxrwx 1 root root 19 Dec 31 13:05 libc.so.0 -> libuClibc-0.9.28.so
-rwxrwxrwx 1 root root 11772 Aug 12 15:17 libcrypt-0.9.28.so
lrwxrwxrwx 1 root root 13 Dec 31 13:05 libcrypt.so -> libcrypt.so.0
lrwxrwxrwx 1 root root 18 Dec 31 13:05 libcrypt.so.0 -> libcrypt-0.9.28.so
-rwxrwxrwx 1 root root 7856 Aug 12 15:17 libdl-0.9.28.so
lrwxrwxrwx 1 root root 10 Dec 31 13:05 libdl.so -> libdl.so.0
lrwxrwxrwx 1 root root 15 Dec 31 13:05 libdl.so.0 -> libdl-0.9.28.so
lrwxrwxrwx 1 root root 13 Dec 31 13:05 libgcc_s.so -> libgcc_s.so.1
-rw-r--r-- 1 root root 221068 Aug 12 15:17 libgcc_s.so.1
-rwxrwxrwx 1 root root 3292 Aug 12 15:17 libintl-0.9.28.so
lrwxrwxrwx 1 root root 12 Dec 31 13:05 libintl.so -> libintl.so.0
lrwxrwxrwx 1 root root 17 Dec 31 13:05 libintl.so.0 -> libintl-0.9.28.so
-rwxrwxrwx 1 root root 66004 Aug 12 15:17 libm-0.9.28.so
lrwxrwxrwx 1 root root 9 Dec 31 13:05 libm.so -> libm.so.0
lrwxrwxrwx 1 root root 14 Dec 31 13:05 libm.so.0 -> libm-0.9.28.so
-rw-r--r-- 1 root root 1984 Aug 12 15:17 libnsl-0.9.28.so
lrwxrwxrwx 1 root root 11 Dec 31 13:05 libnsl.so -> libnsl.so.0
lrwxrwxrwx 1 root root 16 Dec 31 13:05 libnsl.so.0 -> libnsl-0.9.28.so
-rwxrwxrwx 1 root root 93596 Aug 12 15:17 libpthread-0.9.28.so
lrwxrwxrwx 1 root root 15 Dec 31 13:05 libpthread.so -> libpthread.so.0
lrwxrwxrwx 1 root root 20 Dec 31 13:05 libpthread.so.0 -> libpthread-0.9.28.so
-rwxrwxrwx 1 root root 1984 Aug 12 15:17 libresolv-0.9.28.so
lrwxrwxrwx 1 root root 14 Dec 31 13:05 libresolv.so -> libresolv.so.0
lrwxrwxrwx 1 root root 19 Dec 31 13:05 libresolv.so.0 -> libresolv-0.9.28.so
-rw-r--r-- 1 root root 1844 Aug 12 15:17 librt-0.9.28.so
lrwxrwxrwx 1 root root 10 Dec 31 13:05 librt.so -> librt.so.0
lrwxrwxrwx 1 root root 15 Dec 31 13:05 librt.so.0 -> librt-0.9.28.so
-rwxrwxrwx 1 root root 702460 Aug 12 15:17 libuClibc-0.9.28.so
-rwxrwxrwx 1 root root 5064 Aug 12 15:17 libutil-0.9.28.so
lrwxrwxrwx 1 root root 12 Dec 31 13:05 libutil.so -> libutil.so.0
lrwxrwxrwx 1 root root 17 Dec 31 13:05 libutil.so.0 -> libutil-0.9.28.so

but when I try to launch an application, there is an error:

# ./tcpdump
./tcpdump: not found

if I compile the libraries in /lib, everything is OK. Any ideas, why is it so?

hal2k1
02-01-2007, 08:12
I'm playing with my and kfurge's firmware and get a strange error. I followed kfurge tutorial (http://home.comcast.net/~kfurge/wl700ge.html) to add opt library.

LD_LIBRARY_PATH path is OK:


The libraries are there:


but when I try to launch an application, there is an error:


if I compile the libraries in /lib, everything is OK. Any ideas, why is it so?

In kfurge's tutorial, step #5 point 9 says to install a .profile file.


9. Within your .profile, add /opt/bin and /opt/lib to your PATH and LD_LIBRARY_PATH environment variables

The .profile file is:

#
# Bash initialization script
#

PS1="[\u@\h \W]$ "
PATH=/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH=/opt/lib:/shares/lib

export PS1 PATH LD_LIBRARY_PATH


This means that your user login should have LD_LIBRARY_PATH=/opt/lib:/shares/lib

When I check my LD_LIBRARY_PATH I get this:

$ echo $LD_LIBRARY_PATH
/opt/lib:/shares/lib

... which agrees with what I expected, and which does not agree with what you got.

Did you setup your .profile file as kfurge's tutorial suggested?

MoD
02-01-2007, 08:42
As I told, I'm playing with my and kfurge's firmware so, the real path to /opt can be different.

I have /etc/profile file, where I set the LD_LIBRARY_PATH variable. so far everyting is OK. I check it by:


# echo $LD_LIBRARY_PATH
/lib:/usr/lib:/opt/lib

My fresh idea is that I have to add the /opt/lib to ld.so.conf.

MoD
02-01-2007, 09:00
My fresh idea is that I have to add the /opt/lib to ld.so.conf.

still no luck :(

#cat /etc/profile
export PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
:/sbin:/bin
export LD_LIBRARY_PATH=/lib:/usr/lib:/opt/lib
export PS1="[\u@\h \W]\# "

# cat /etc/ld.so.conf
/lib
/opt/lib
/usr/lib

hal2k1
02-01-2007, 09:51
As I told, I'm playing with my and kfurge's firmware so, the real path to /opt can be different.

I have /etc/profile file, where I set the LD_LIBRARY_PATH variable. so far everyting is OK. I check it by:



My fresh idea is that I have to add the /opt/lib to ld.so.conf.

When I tried to look at /shares/lib, I see this:


ls -l /shares/lib
lrwxrwxrwx 1 root 0 9 Dec 29 13:19 /shares/lib -> /apps/lib

So /share/lib points to /apps/lib.

So when I look at /apps/lib, I get this:


$ ls -l /apps/lib
lrwxrwxrwx 1 1000 232 18 Jan 2 07:17 libMagick.so -> libMagick.so.6
.2.1
lrwxrwxrwx 1 1000 232 18 Oct 11 2005 libMagick.so.6 -> libMagick.so
.6.2.1
lrwxrwxrwx 1 1000 232 18 Oct 11 2005 libMagick.so.9 -> libMagick.so
.9.0.3
-rwxr-xr-x 1 1000 232 4365292 Oct 11 2005 libMagick.so.9.0.3
lrwxrwxrwx 1 1000 232 16 Oct 11 2005 libWand.so -> libWand.so.6.2.1
lrwxrwxrwx 1 1000 232 16 Oct 11 2005 libWand.so.6 -> libWand.so.6.2 .1
-rwxr-xr-x 1 1000 232 1783544 Jan 1 1970 libc-2.2.3.so
lrwxrwxrwx 1 1000 232 13 Oct 11 2005 libc.so -> libc-2.2.3.so
lrwxrwxrwx 1 1000 232 13 Oct 11 2005 libc.so.6 -> libc-2.2.3.so
-rw-r--r-- 1 1000 232 52276 Oct 11 2005 libcharset.a
-rw-r--r-- 1 1000 232 847 Oct 11 2005 libcharset.la
lrwxrwxrwx 1 1000 232 19 Oct 11 2005 libcharset.so -> libcharset.so .1.0.0
lrwxrwxrwx 1 1000 232 19 Oct 11 2005 libcharset.so.1 -> libcharset. so.1.0.0
-rw-r--r-- 1 1000 232 46207 Oct 11 2005 libcharset.so.1.0.0
-rwxr-xr-x 1 1000 232 45128 Dec 18 13:49 libgcc_s.so
lrwxrwxrwx 1 1000 232 11 Oct 11 2005 libgcc_s.so.0 -> libgcc_s.so
lrwxrwxrwx 1 1000 232 11 Oct 11 2005 libgcc_s.so.1 -> libgcc_s.so
-rw-r--r-- 1 1000 232 823 Oct 11 2005 libiconv.la
lrwxrwxrwx 1 1000 232 17 Oct 11 2005 libiconv.so -> libiconv.so.2.3 .0
lrwxrwxrwx 1 1000 232 17 Oct 11 2005 libiconv.so.2 -> libiconv.so.2 .3.0
-rw-r--r-- 1 1000 232 1112868 Oct 11 2005 libiconv.so.2.3.0
-rw-r--r-- 1 1000 232 102608 Oct 11 2005 libltdl.a
-rwxr-xr-x 1 1000 232 831 Oct 11 2005 libltdl.la
lrwxrwxrwx 1 1000 232 16 Oct 11 2005 libltdl.so -> libltdl.so.3.1.2
lrwxrwxrwx 1 1000 232 16 Oct 11 2005 libltdl.so.3 -> libltdl.so.3.1 .2
-rwxr-xr-x 1 1000 232 87299 Jan 1 1970 libltdl.so.3.1.2
-rwxr-xr-x 1 1000 232 612960 Jan 1 1970 libm-2.2.3.so
lrwxrwxrwx 1 1000 232 9 Oct 11 2005 libm.so -> libm.so.6
lrwxrwxrwx 1 1000 232 13 Oct 11 2005 libm.so.6 -> libm-2.2.3.so
-rwxr-xr-x 1 1000 232 118152 Jan 1 1970 libnsl-2.2.5.so
lrwxrwxrwx 1 1000 232 11 Oct 11 2005 libnsl.so -> libnsl.so.1
lrwxrwxrwx 1 1000 232 15 Oct 11 2005 libnsl.so.1 -> libnsl-2.2.5.so
lrwxrwxrwx 1 1000 232 15 Oct 11 2005 libogg.so -> libogg.so.0.5.2
lrwxrwxrwx 1 1000 232 15 Oct 11 2005 libogg.so.0 -> libogg.so.0.5.2
-rwxr-xr-x 1 1000 232 22332 Jan 1 1970 libogg.so.0.5.2
drwxr-xr-x 1 1000 232 68 Oct 11 2005 pkgconfig
-rw-r--r-- 1 1000 232 1107769 Oct 11 2005 preloadable_libiconv.so


Perhaps you need to include a path to /apps/lib as well?

MoD
02-01-2007, 11:29
/share/lib and /apps/lib are not important. I need to run uClibc and it is located in /opt/lib. OS does not recognice this path:(

d3viant
02-01-2007, 13:27
This probably shouldn't make any difference, but try putting /opt/lib at the start of your LD_LIBRARY_PATH - it searches through each one in order, and I am wondering if it's finding something that it thinks is uclibc before it reaches the real one in /opt/lib...

MoD
02-01-2007, 14:41
This probably shouldn't make any difference, but try putting /opt/lib at the start of your LD_LIBRARY_PATH - it searches through each one in order, and I am wondering if it's finding something that it thinks is uclibc before it reaches the real one in /opt/lib...

Thanks, I'll try. I'm wondering how did my old custom firmware worked that you tested :(

MoD
02-01-2007, 14:46
what was an interesting expierence for me with kfurge firmware was that the share became readonly and to reset it I had to reinstall the original firmware.

after that router crashed so that I had to extract .trx file and reflash the flash memory.

MoD
02-01-2007, 15:11
This probably shouldn't make any difference, but try putting /opt/lib at the start of your LD_LIBRARY_PATH - it searches through each one in order, and I am wondering if it's finding something that it thinks is uclibc before it reaches the real one in /opt/lib...

no luck :(

kfurge
02-01-2007, 19:28
If putting the libs into /lib worked, then you must be trying to execute a mipsel executable that's not from the optware distribution.

The optware executables are special because /opt/lib is hard-coded into them.

To confirm, put the exec on a linux box and do "strings tcpdump | grep lib" and see if /lib or /opt/lib pops out. If you don't see /opt/lib in there somewhere, the package executable is wrong.

- K.C.

MoD
02-01-2007, 22:37
If putting the libs into /lib worked, then you must be trying to execute a mipsel executable that's not from the optware distribution.

The optware executables are special because /opt/lib is hard-coded into them.

To confirm, put the exec on a linux box and do "strings tcpdump | grep lib" and see if /lib or /opt/lib pops out. If you don't see /opt/lib in there somewhere, the package executable is wrong.

- K.C.

I do not know how did you figure out that:) but it helped. Thanks, man!:) I wish I had more time to work on this firmware.

kfurge
03-01-2007, 23:07
Glad I could help. I wish I had more time too... I also wish I had another router to develop on. :-(

I'd like to totally gut the rotting slabs of Asus code from the router and replace them with the stock Broadcom code that they started with.

The tantalizing pieces of Broadcom code that still exist are pretty good and I know I could do a much better job than Asus did.

- K.C.