OpenWrt Forum Archive

Topic: Creating package for Linksys upnp binary

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi folks,

I've started writing a upnp guide in the wiki documents for OpenWRT.  I now need to create an .ipk package for the upnp daemon so I can help folks get that easily installed onto their router.  I understand there is already a package created by yani for the Linux-IGD upnp daemon, but personally I don't like the implementation compared to the simplicity of the Linksys one and would like to offer an alternative.

Ok, so now a couple of questions:

1. Since the source code is provided with the GPL tarball from Linksys, does this not need to go into the "non-free" package directory.
2. Once the package is complete (and tested properly) can we add it to the package database so that "ipkg install upnp" will just work?
3. Is anyone willing to provide a little assistance to a skilled, yet inexperience package n00b like me to get the package built.

If you're worried about my abilities in case you decide to help me, I can tell you that I'm technically highly skilled and work in IT security.  I just haven't done any coding for, well, years.  So if you give me a little nudge in the right direction, I will probably put back a lot more than you need to put in.

Thanks folks,

Kaldek

(Last edited by kaldek on 21 Sep 2005, 04:40)

kaldek wrote:

Hi folks,

I've started writing a upnp guide in the wiki documents for OpenWRT.

I have seen this, nice.

kaldek wrote:

I now need to create an .ipk package for the upnp daemon so I can help folks get that easily installed onto their router.  I understand there is already a package created by yani for the Linux-IGD upnp daemon, but personally I don't like the implementation compared to the simplicity of the Linksys one and would like to offer an alternative.

Ok, so now a couple of questions:

1. Since the source code is provided with the GPL tarball from Linksys, does this not need to go into the "non-free" package directory.

Exactly. It has a "AS-IS" license statement on top of the files I have checked. So take all files, make a directory upnp-0.1 and put a tgz anywhere online.

kaldek wrote:

2. Once the package is complete (and tested properly) can we add it to the package database so that "ipkg install upnp" will just work?

May be. Make a package and send it to the developer mailinglist: openwrt-devel@openwrt.org


kaldek wrote:

3. Is anyone willing to provide a little assistance to a skilled, yet inexperience package n00b like me to get the package built.

We have some documentation you should read. It is a really simple task, no need to know any programming skills.
http://downloads.openwrt.org/docs/build … ation.html
http://wiki.openwrt.org/BuildingPackagesHowTo

kaldek wrote:

If you're worried about my abilities in case you decide to help me, I can tell you that I'm technically highly skilled and work in IT security.  I just haven't done any coding for, well, years.  So if you give me a little nudge in the right direction, I will probably put back a lot more than you need to put in.

Thanks folks,

Kaldek

cheers wbx

Thanks wbx, I've downloaded the SDK and I'm now on my way.  Looks to be a heap of fun, only problem is trying to make myself do actual "work" during business hours rather than toying with OpenWRT (and to a lesser extent, OpenSlug).

Results are a'comin',

Kaldek

P.S. Sorry about not doing enough digging and finding the Package Build HOWTO before posting for assistance. :-/

Thank you for the wiki kaldek, very well written.

I tried the "Linksys" version some time ago, but using the Linksys libshared.so made the wifi unavailable.

Regards,

Tanguy

tanguy15 wrote:

I tried the "Linksys" version some time ago, but using the Linksys libshared.so made the wifi unavailable.

It did?  Hmmm, it didn't affect my wi-fi at all, so that's odd.  What release were you using at the time?  I've had the following combinations:

Whiterussian RC1 - nas 0.9 and upnp from firmware 4.00.7
Whiterussian RC2 - nas 0.9 and upnp from firmware 4.00.7
Whiterussian RC2 - nas 3.9 and upnp from firmware 4.00.7

All of those combinations above have worked.  Is it possible that your upnp binary was from an older firmware release?  This is important, because I may need to add this as a disclaimer in the wiki.  upnp also needs to install a replacement libshared.so and libnetconf.so.

EDIT: I've just checked the files list for the nas-3.9 package, and it does not contain either libnetconf.so or libshared.so.  libnetconf.so is not included in WhiteRussian (and is therefore not the problem), but I don't know if the nas binary or the wireless driver needs libshared.so.  nas may well use libshared.so because it's included in the OpenWRT firmware and therefore not included in the package files.

It might well be that you need the right versions of libshared.so in order to support both nas and upnp.

Can anyone provide a fairly accurate idea of which programs aside from upnp make use of libshared.so?  If not I'll have to dig this out of the source code I suppose.

Kaldek

(Last edited by kaldek on 22 Sep 2005, 01:46)

Well folks, I have built the package.  I didn't use any of the SDK in the end, because I basically already had the binaries and everything else needed.  I didn't need to actually compile anything, so I just rolled my own IPK file based on the info I sniffed out here: http://www.uk-dave.com/tutorials/zaurus/ipkg.php

I'll see how the masses like the package before I do anything silly like submit it to the package tree.  I think I'll also pull out the latest binary from firmware 4.20.07 and see if it's any different.

Kalde

uh. :[

I think it's time to add a section to the BuildingPackagesHowto for programs that have nothing to compile (scripts only or binary only).

wbx wrote:

uh. :[

Is that a bad "uh" or a good "uh"? 

Seriously, I would have compiled the Linksys source code....if I had any idea what the heck I was doing.  My compile experience is limited to typing "emerge <package>" in Gentoo.  It's one of the major items on my list of things to learn. 

Trust me, if I could teach myself how to grab source code from anywhere and compile it into binary files, I'd be bouncing off the walls with joy.  Right now though I am unfortunately still much more of a tool user than a tool builder.  Or perhaps just a tool.

Kaldek

(Last edited by kaldek on 22 Sep 2005, 11:49)

Kaldek,

The libshared.so is provided by the nvram package. I used the Whiterussian RC2 and the binaries from the latest Lynksys release (I don't remember exactly which one, some time in August)

tanguy15 wrote:

Kaldek,

The libshared.so is provided by the nvram package. I used the Whiterussian RC2 and the binaries from the latest Lynksys release (I don't remember exactly which one, some time in August)

OK, I just downloaded the nvram package and did some comparisons.  Whilst the nvram "package" is not installed in Whiterussian, all the files from that package are installed in the base OpenWRT firmware image (makes sense since you need it).  The libshared.so file in the nvram package is identical to the one included with OpenWRT.  So that's our baseline for upnp.

Adding my upnp package replaces libshared.so with the version from the Linksys 4.00.7 firmware.  This libshared.so library works with both upnp and Whiterussian RC2 firmware.  So, I think we can safely say that we're unlikely to see any conflicts with the nvram package.

Unfortunately, it still doesn't answer our problems about wi-fi breaking in your instance.  I suppose it's so long ago now that you wouldn't be able to dig up information on what broke - the bad thing about that is that we now have a doubt.  I hate doubt when you can't use proof to remove it. sad

Kaldek

(Last edited by kaldek on 23 Sep 2005, 05:42)

I'm going to give it another try tonight with my 54GS and Whiterussian RC3. Keep you informed.

tanguy15 wrote:

I'm going to give it another try tonight with my 54GS and Whiterussian RC3. Keep you informed.

Yeah I need to really upgrade to RC3, too.  I've got a busy weekend now though, so I may not get a chance to do it.  Maybe Saturday night, if my wife doesn't need the Internet badly. smile

Kaldek

I do confirm that the wifi doesn't work with the libshared.so extracted from WRT54GSV2.0_3.37.6_US and Whiterussian RC3.

By the way, the method explained in the FAQ to extract the binaries doesn't work with the latest firmwares, because it's not possible to grep 'Comp' anymore. Any suggestion for a new way to extract the files ?

Cheers,

Tanguy

tanguy15 wrote:

I do confirm that the wifi doesn't work with the libshared.so extracted from WRT54GSV2.0_3.37.6_US and Whiterussian RC3.

Alright, I've updated the uPnP wiki page to say that wifi might break.  However, that libshared.so you're using is ANCIENT.  Please go and download & install my IPK package for upnp and tell me if that works, because I have extracted a much newer binary from a *much* newer firmware.

tanguy15 wrote:

By the way, the method explained in the FAQ to extract the binaries doesn't work with the latest firmwares, because it's not possible to grep 'Comp' anymore. Any suggestion for a new way to extract the files ?

See this thread: http://forum.openwrt.org/viewtopic.php?id=1884

Kaldek

Kaldek,

I tried your package, and ....it works now for the wifi. Well done and thank you.

I followed the procedure to extract the binaries, but unfortunately, my Ubuntu Hoary doesn't support squashfs.

Tanguy

tanguy15 wrote:

Kaldek,
I tried your package, and ....it works now for the wifi. Well done and thank you.
Tanguy

No - thank you!  It's good that we track these bugs down. smile  I've installed RC3 now, and discovered that the nvram package is included in OpenWRT by default.  Because of that, my install must use the "-force-overwrite" option when installing upnp onto RC3.  The document now reflects this.

Also I have extracted the latest binary from firmware 4.20.07.  I've tested this on RC3 and it works - it's available here: http://members.optusnet.com.au/edwardlu … mipsel.ipk

Cheers,

Kaldek

(Last edited by kaldek on 25 Sep 2005, 12:53)

does upnp need a newer version of libshared.so?

May be we can update this in CVS HEAD.

wbx wrote:

does upnp need a newer version of libshared.so?

May be we can update this in CVS HEAD.

Yeah, it needs the libshared.so from the newer Linksys firmware.  I'm currently using the latest one from 4.20.07 (for the WRT54G).  Based on the MD5 hashes calculated, the libshared.so image is still changing from revision to revision.  I haven't tried running a comparison of the source code between them of course.

I suppose the decision on whether or not to include it in Whiterussian depends on the expected penetration of folks running upnp, and the possible ramifications of the continuous use of my Linksys binary version.  If it won't hurt other applications, perhaps it is just best to include the newer version in Whiterussian.  At least that way any problems may cause with other apps will probably be found earlier.

Kaldek

The discussion might have continued from here.