Trying to change opkg.conf path using OPKG_CONF_DIR

907 views
Skip to first unread message

dynek

unread,
Feb 8, 2011, 8:09:12 AM2/8/11
to opkg-devel
Hello,

I looks possible to set the OPKG_CONF_DIR environment variable to
change the path where the opkg.conf file is located. I am using
opkg_576-1_ar71xx.ipk and have tried it but can't get it to work:

root@router:/tmp# export OPKG_CONF_DIR="/mnt/opt/etc/opkg.conf"
root@router:/tmp# opkg update
Collected errors:
* opkg_conf_load: Couldn't stat /etc/opkg.conf: No such file or
directory.
root@router:/tmp# export OPKG_CONF_DIR="/mnt/opt/etc/"
root@router:/tmp# opkg update
Collected errors:
* opkg_conf_load: Couldn't stat /etc/opkg.conf: No such file or
directory.

Would anybody have an idea ?

Thank you for your time!

Camille Moncelier

unread,
Feb 8, 2011, 8:20:26 AM2/8/11
to opkg-...@googlegroups.com
Hi dynek,

> I looks possible to set the OPKG_CONF_DIR environment variable to
> change the path where the opkg.conf file is located. I am using
> opkg_576-1_ar71xx.ipk and have tried it but can't get it to work:
>

> Would anybody have an idea ?

I dont think you can set the OPKG_CONF_DIR variable, but you should be
able to use:

opkg --offline_root=/tmp update


--
Camille Moncelier
http://devlife.org/

If Java had true garbage collection, most programs would
delete themselves upon execution.

Sergey 'Jin' Bostandzhyan

unread,
Feb 8, 2011, 8:33:46 AM2/8/11
to opkg-...@googlegroups.com
Hi,

On Tue, Feb 08, 2011 at 02:20:26PM +0100, Camille Moncelier wrote:
> > I looks possible to set the OPKG_CONF_DIR environment variable to
> > change the path where the opkg.conf file is located. I am using
> > opkg_576-1_ar71xx.ipk and have tried it but can't get it to work:
> >
> > Would anybody have an idea ?
>
> I dont think you can set the OPKG_CONF_DIR variable, but you should be
> able to use:
>
> opkg --offline_root=/tmp update

actually, setting OPKG_CONF_DIR does work for me.

For various reasons I need two separate opkg configurations in my rootfs,
I am using OPKG_CONF_DIR to point opkg to the alternative conf files and I
had to add a patch to separate the lib directories as well.

When accessing my "separate" opkg configuration I use a shell script as a
wrapper:

OPKG_CONF_DIR="/etc/opkg-add-ons" OPKG_LIB_DIR="/usr/lib/opkg-add-ons" opkg $@

The OPKG_LIB_DIR comes from my patch, but OPKG_CONF_DIR is stock and does
work for me (currently with revision 599, it was working with older revs as
well)

Kind regards,
Jin


Camille Moncelier

unread,
Feb 8, 2011, 8:40:09 AM2/8/11
to opkg-...@googlegroups.com
> actually, setting OPKG_CONF_DIR does work for me.
>
> For various reasons I need two separate opkg configurations in my rootfs,
> I am using OPKG_CONF_DIR to point opkg to the alternative conf files and I
> had to add a patch to separate the lib directories as well.
>
My mistake; I just took a quick look at it, on the web interface, I
should have looked further. Anyways.

> Maybe I don't get it but in http://code.google.com/p/opkg/source/browse/trunk/args.c?spec=svn524&r=8
> I can see getenv("OPKG_CONF_DIR").
> It's been removed in the latest versions ?
getenv("OPKG_CONF_DIR") is still here:
http://code.google.com/p/opkg/source/browse/trunk/libopkg/opkg_conf.c#451

You are looking at rev #8 which is prehistoric :) I just re-read your
mail and I think I foud your problem :)

export OPKG_CONF_DIR="/mnt/opt/etc/opkg.conf"

should be

export OPKG_CONF_DIR="/mnt/opt/etc"

dynek

unread,
Feb 8, 2011, 8:53:35 AM2/8/11
to opkg-devel
> export OPKG_CONF_DIR="/mnt/opt/etc/opkg.conf"
>
> should be
>
> export OPKG_CONF_DIR="/mnt/opt/etc"

I tried that and it didn't work but now it does :-/
I'm installing opkg on a WiFi router (WNDR3700) and I know it requires
a reboot to take some stuff into account. Might be it.

Now problem is it checks *.conf :-) Should I create a directory with
only opkg.conf inside ?

Camille Moncelier

unread,
Feb 8, 2011, 4:30:29 PM2/8/11
to opkg-...@googlegroups.com
On Tue, Feb 8, 2011 at 2:53 PM, dynek <pbro...@gmail.com> wrote:
> Now problem is it checks *.conf :-) Should I create a directory with
> only opkg.conf inside ?

It would help, yes. :-)

Reply all
Reply to author
Forward
0 new messages