4

I have a number of custom packages that I'm building under OpenWRT that I'd like to add to a custom feed so I can have IoT devices pull updates for these custom packages.

I've looked through all of the OpenWRT docs and done several google searches without finding any details. Where can I find documentation, a tutorial, or an example of creating the files required for a custom feed?

Chris Morgan
  • 1,117
  • 11
  • 26

1 Answers1

2

See the OpenWRT official doc:

Router configuration

Configure the OpenWRT router to know about the new custom feed location; In /etc/opkg.conf add something like this

# customfeeds
src/gz custompackages http://s3.amazonaws.com/mycustompackages-orwhatever

You will also need to accept your custom signing key assuming you do package signing.

wget http://s3.amazonaws.com/mycustompackages/public.key
opkg-key add public.key

Server files needed

Now you need to setup the HTTP server, I've successfully an S3 bucket for a while.

  • Packages.gz - compressed version of Package
  • Packages - uncompressed version of Packages
  • Packages.sig -
  • custom_public.key -
  • yourpackage.ipk - the actual ipk package file to be installed

How to create the files

  • You can create the ipk file using ipkg-build; I've used this version
  • You can create the Packages index file using ipkg-make-index.sh script. (I've used this one)
  • Get Packages.gz by gzipping the Packages file
  • Use usign to create the Private/Public keys for Package signing
  • Also use usign to create the Packages.sig file

Sample script

This sample assumes your private key is private.key

ipkg-build mypackage .
mv mypackage.ipk packages/
cd packages
../ipkg-make-index.sh . > Packages
usign -S -m Packages -s ../keys/private.key -x Packages.sig
gzip -fk Packages
preezzzy
  • 568
  • 4
  • 21
  • Hi @preezzzy. How are you building usign for local use? Manually? I would have imagined there was a way to build from the OpenWRT package. – Chris Morgan Sep 12 '19 at 01:32
  • @ChrisMorgan - Yes I am building usign manually on my development machine. (Ubuntu) – preezzzy Sep 12 '19 at 18:19
  • Hi @preezzzy. I'm still working to automate this, sorry for my slow responses. Is there any reason to be able to preserve old versions of packages? It seems like this is unnecessary, the packages directory could be rebuilt with the latest versions, the only downside is that clients could only upgrade, not downgrade. Thoughts? – Chris Morgan Oct 01 '19 at 01:32