OpenWrt Forum Archive

Topic: package policy

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

It seems to me that there is a need to develop a policy document which provides preferred guidelines on how packages should get/store settings.  Currently one can get/store settings in nvram and/or a file somewhere in the filesystem.  The problem arises when one package (lets say a "web-based configuration" package) stores settings in one location, and other packages look for setting in a different location, or hardcode the settings in their conffiles.  What I think would be ideal is if there were one central location where settings were stored, and all packages could expect to find the "master settings" there.  Of course there are some kinds of settings which are shared across many packages, and others which are specific only to a given package.  In that case, at least a list of those settings which should be centrally accessible should be decided on, so that those who are packaging software for openwrt can save/read from this location.

Yes, there might be concerns that doing this will permit one package to screw up all the rest if it changes a setting improperly.  Indeed this is a risk, but if there is a policy in place about how and when settings should be changed by a package, the package can be evaluated with respect to this policy and it can be determined whether or not the package would pose problems.

One example demonstrating the problem of not having a policy is with the /etc/dnsmasq.conf file.  It currently contains the following:

# no dhcp / dns queries from the wan
except-interface=vlan1

If, however, the user decides to configure the router so that the WAN is no longer vlan1, then dnsmasq no longer behaves exactly as it should unless this conffile is manually modified also.  If, however, the conffile got the WAN interface name from a predetermined (in the policy) location that all the programs used to determine the WAN interface, only one change would be necessary--to change this centralized setting.

One related project I saw was at the following url:

http://openwrt.org/CentralNvramMaps

This is a good start, but it doesn't replace having a policy document.  This is because if a piece of software isn't governed by a clear policy, then it could choose to get its data from the Central nvram maps structure, but it wouldn't necessarily have to.  And as soon as a package doesn't conform to the policy, then you run into the same problem illustrated above for dnsmasq.

Your thoughts and proposals are welcome.

The discussion might have continued from here.