OpenWrt Forum Archive

Topic: ipkg mirror setup

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

Hi all,
For the past few days I've been exploring openwrt. I've been experimenting mostly with the non-wireless part of it before attaching it to my antenna mast.

I was thinking about setting a (non-Internet) mirror of all the packages availiable at different sources in one single location for a wireless metropolitan network in Athens, Greece since there are many others using either Linksys 54G or GS.

a. How is it possible? A simple rsync tool probably does not do the trick since the "Packages" should contain tha data of all packages. Do I need to run the toolchain on the mirroring box in order to produce the file? I've Googled a bit, with no luck though...

b. May I do it? (since most of the developpers hang around) Should I contact everyone on person?

Thanks for the wonderful firmware, keep up the good work

Sure you can. You just need to take great care that you follow the license that the authors of the software used. The authors of the software in most of the packages you are referring to really have nothing to do with OpenWRT and do not hang out here. The only people that do hang out here are people who have created the packagages of that software (didn't write the actual code but compiled that code and bundled it up into the ipkg format).

For instance, I created a net-snmp ipkg and have it available on my site. I did not write net-snmp, I just compiled it and created an ipkg for it. net-snmp is licensed under the BSD license. You must follow the terms of the license. Many other things are licensed under the GPL. In the case of the GPL if you offer the binary packages then you must also offer the source along with whatever options and changes you made to that source to build your binary.

Please do not overlook the licenses that the authors of the software placed on the software if you do create a mirror. It's a small price to pay but it is the only reason the OpenWRT project even exists.

I've attached my small python script to mirror selected packages from existing ipkg feeds. Just edit the sourceList and packageList variables at the top of the script to select the packages and feeds you're interested in, the repos variable for where you want the files to go, you'll need to create a subdirectory 'upstream' under that dir to cache package lists, and point the ipkgIndex variable to where ipkg-make-index (from the ipkg utils, ftp://ftp.handhelds.org/packages/ipkg-utils/) is installed. packageList can optionally include a prefered feed to get the package from, otherwise it just takes the package from the first feed in sourceList that offers it.

Once that's all done, run it whenever you want to update your mirror, it'll check all the sources you have listed, update the package list cache for any that have changed, and download any packages you've listed that have changed.

One warning though, I've only used it on linux, and since so far I've just been using it for my own purposes, I haven't added any error handling. If one of your listed feeds is down, the script will probably just die. At some point I'll probably clean it up and make it solid enough for production use, but until then, caveat downloader. I hope it'll be useful, but I disclaim all responsibility. If it breaks your computer, deletes your files, scares your cat and kicks your dog, that's just too bad.

The discussion might have continued from here.