Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: thealy on October 26, 2011, 09:09:10 AM

Title: LD_LIBRARY_PATH environment variable
Post by: thealy on October 26, 2011, 09:09:10 AM
I have a question regarding setting the LD_LIBRARY_PATH environment variable in Tinycore

At the command line if I do the following :-

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/lib
$ echo $LD_LIBRARY_PATH
/mnt/nfs/lib
$ osgversion
OpenSceneGraph Library 3.0.1
$
(as required)

However, after a reboot :-

$ osgversion
Osgversion: error while loading shared libraries: libOpenThreads.so.12.: cannot open shared object file: No such file or directory
$

If I enter the $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/lib line again the application can find the library folder and work okay (for that bash session only).

I added the line:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/lib ; export LD_LIBRARY_PATH
to the file :
/home/tc/.bashrc
then added
source /home/tc/.bashrc
to
/opt/bootlocal.sh

but on a reboot I still have to re-enter $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/lib at the command line for the application to work (or use source /opt/bootlocal.sh at the command line).   

I have used the OpenSceneGraph extension on another Tinycore boot option (just a different tce folder) and this works okay but its 2.8.x and I require the OpenSceneGraph 3.x libraries. 

My question is :

How can I ensure that LD_LIBRARY_PATH environment  variable is reloaded after a reboot with the correct path to the library ?


System info:
I am using a diskless SBC that boots via a server (DHCP/tftpboot/nfs) and the mydata.tgz is saved to a nfs folder.
Boot codes used are:
Initrd=tinycore.gz nfsmount=10.0.0.254:/nfsroot tftplist=10.0.0.254:/tce/tcz.lst tce=nfs/temp/tce BOOT_IMAGE=bzImage

Regards,

Terry
Title: Re: LD_LIBRARY_PATH environment variable
Post by: Rich on October 26, 2011, 09:20:00 AM
Hi thealy
You could try adding the  export  line to  /home/.profile
Title: Re: LD_LIBRARY_PATH environment variable
Post by: thealy on October 26, 2011, 09:42:50 AM
Thanks for the reply.

I assumed you meant the /home/tc/.profile file and not a new file in /home/.profile ?     if so I have added to the end of the /home/tc/.profile file :-

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/lib
export LD_LIBRARY_PATH

saved a backup and rebooted, but the LD_LIBRARY_PATH path is not set.


Regards

Terry



 


Title: Re: LD_LIBRARY_PATH environment variable
Post by: gerald_clark on October 26, 2011, 10:47:59 AM
Users do not share the environment of the init process, so adding the line to bootlocal.sh accomplishes nothing.
I would recommend adding your lines to /home/tc/.ashrc .
Title: Re: LD_LIBRARY_PATH environment variable
Post by: thealy on October 26, 2011, 11:38:52 AM
Thanks Gerald adding LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/mnt/nfs/lib ; export LD_LIBRARY_PATH  to the end of the /home/tc/.ashrc file worked for me.

Thanks again for all the help.
 
Regards,

Terry