Package install needs to add repo

I'm developing a package for distribution and one tester found that he did not have the openwrt/kmods repo installed. What is the best way for my package install to test that a repo is available and to add if not?

Do I script a search of /etc/opkg/distfeeds.conf and add it not found? Or is there a better/preferred method? How could I even do this for any architecture that may be encountered?

Likely custom feeds not distfeeds

This is targeted to be an official package, so that is why I was thinking distfeeds.conf.

Are you over complicating the check? Your package will depend on the kmod (I assume) and install will either succeed or fail based on whether it can be found and installed.

So your install instructions could cover this if needed.

The earliest you could run any “script” is preinst and I think that still won’t fire if a dependency is missing.

1 Like