macsat.com OpenWrt and ASUS WL Forum
January 08, 2009, 10:54:38 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Back to macsat.com
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Installing ipkg packages to /opt  (Read 4542 times)
0 Members and 1 Guest are viewing this topic.
jiel
Newbie
*
Offline Offline

Posts: 3


View Profile
« on: January 10, 2006, 22:37:06 PM »

I recently installed openWRT on an WL500g Deluxe.
I followed the tutorials to install an usb key. It worked fine . The usb key is placed at location /opt.
Additionally, I reserved 25 M of the usb key to a linux swap partition and activated it by modifying the proposed /etc/init.d/S11mount script as follows :

#!/bin/sh
# Which device needs to be mounted?
MOUNT_DEVICE0=/dev/scsi/host0/bus0/target0/lun0/part1

i=0
# Wait 15s, mount when ready, and continue if it dosnt get ready within 15s
while [ $i -le 15 ]
  do
  if [ -e $MOUNT_DEVICE0 ]
  then
    mount $MOUNT_DEVICE0 /opt/
    echo "Success: $MOUNT_DEVICE0"
    # JLM 10-01-2006 swapon
    swapon /dev/scsi/host0/bus0/target0/lun0/part5
    exit 0
  fi
  sleep 1
  i=`expr $i + 1`
done

And it works.

But, I have a problem when installing new packages to /opt : when I try to install packages through :
  ipkg -d opt install <name of package>
all element are installed in a new directory /opt/opt. Example for libs : /opt/opt/lib and not as expected /opt/lib.

can you help me and tell me what is wrong ?
 Smiley
Logged
macsat
Administrator
Sr. Member
*****
Online Online

Posts: 1,104



View Profile
« Reply #1 on: January 12, 2006, 07:57:52 AM »



Can you give me the content of your /etc/ipkg.conf file ?
Logged
jiel
Newbie
*
Offline Offline

Posts: 3


View Profile
« Reply #2 on: January 12, 2006, 22:03:08 PM »

After having make several tries yesterday evening, I think I understood my mistake. Please correct me, if I am wrong.

The package I targetted to installed are already "compiled" for an installation in the directory "/opt". I saw this when looking at the package contents on the site : http://ipkgfind.nslu2-linux.org/ (it is the samba 3.0xxx package). I didn't know this.
Having the instruction "dest opt /opt" in the ipkg.conf file, I tried to install samba with the following command :
ipkg -d opt install samba.

And of course the installation is made to "/opt" from above installation instruction + "/opt/bin/...." for example from the package compilation, which ends at /opt/opt/bin/.....

Is my understanding correct ?
Logged
macsat
Administrator
Sr. Member
*****
Online Online

Posts: 1,104



View Profile
« Reply #3 on: January 12, 2006, 22:13:39 PM »


This could be 100% correct.

If you have used destination /opt  for a package that installs to /opt/bin /opt/var and so on per default, the files would end up in /opt/opt/bin /opt/opt/var ....etc.

Did you use a package designed for Olegs firmware on an OpenWrt box?

"Normal" OpenWrt packages are compiled as to be installed in /  and hence the -d opt is needed for thoose.
Logged
jiel
Newbie
*
Offline Offline

Posts: 3


View Profile
« Reply #4 on: January 14, 2006, 15:49:25 PM »

In fact I took it from http://ipkgfind.nslu2-linux.org/; the package is precompiled with "/opt/...." installation target.
Thanks for your help; so I learned to take care what the installation target is.

Logged
Quest
Newbie
*
Offline Offline

Posts: 3


View Profile WWW
« Reply #5 on: April 03, 2006, 14:29:24 PM »

From the tutorial :
I havent been able to find where to tell OpenWRT to look in /opt/usr/lib so instead I have made a small script, that creates symlinks in /usr/lib for all files in /opt/usr/lib.
Download the script here and run it after running the ipkg -d opt install command on libs.


Add the following line to /etc/profile :
export LD_LIBRARY_PATH=/lib:/usr/lib:/opt/lib:/opt/usr/lib

This should do the trick  Smiley
Logged
VeNoM
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #6 on: July 13, 2006, 17:49:05 PM »

I installed lighttpd and other apps in /opt and it won't start on reboot.
I modified the path, libs and everything ...

Code:
root@WL-500gP:~# echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin


Jul 13 19:12:28 (none) user.info : starting /opt/etc/init.d/S50lighttpd
Jul 13 19:12:29 (none) user.info : : /opt/etc/init.d/S50lighttpd: 22: lighttpd: not found
Jul 13 19:12:29 (none) user.info : /opt/etc/init.d/S50lighttpd: 22: lighttpd: not found


Jul 13 19:12:37 (none) user.info : /opt/usr/bin/rrdtool: can't load library 'librrd.so.0'
Jul 13 19:12:37 (none) user.info : : /opt/usr/bin/rrdtool: can't load library 'librrd.so.0'

Jul 13 19:12:37 (none) user.info : /opt/usr/sbin/rrdcollect: can't load library 'librrd.so'
Jul 13 19:12:37 (none) user.info : : /opt/usr/sbin/rrdcollect: can't load library 'librrd.so'

Jul 13 19:12:28 (none) user.info : : starting /opt/etc/init.d/S49ulogd
Jul 13 19:12:28 (none) user.info : starting /opt/etc/init.d/S49ulogd


Logged
macsat
Administrator
Sr. Member
*****
Online Online

Posts: 1,104



View Profile
« Reply #7 on: July 27, 2006, 10:13:37 AM »


check the contents of :
Code:
/opt/etc/default/lighttpd

You might need to change a path to the config file in there, since you have it installed in /opt

Also in the top of:
Code:
/opt/etc/init.d/lighttpd

there is a couple of places where you need to prepend : /opt   to the paths.

Finally - as mentioned in my "install to /opt" tutorial, running my optlibs.sh script is needed after adding libraries to /opt



/macsat
Logged
ha
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #8 on: July 29, 2006, 20:02:27 PM »

I have same problem

1. /opt/etc/default/lighttpd

OPTIONS="-f /opt/etc/lighttpd.conf"


2. /opt/etc/init.d/lighttpd

#!/bin/sh

BIN=lighttpd
DEFAULT=/opt/etc/default/$BIN
LOG_D=/opt/var/log/$BIN
RUN_D=/opt/var/run
PID_F=$RUN_D/$BIN.pid
[ -f $DEFAULT ] && . $DEFAULT

case $1 in
 start)
  mkdir -p $LOG_D
  mkdir -p $RUN_D
  $BIN $OPTIONS
  ;;
 stop)
  [ -f $PID_F ] && kill $(cat $PID_F)
  ;;
 *)
  echo "usage: $0 (start|stop)"
  exit 1
esac

exit $?

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

English Steel 1.6 © Saxon North Technologies
Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.095 seconds with 25 queries.