tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Making powerd=YES default



On Wed, 3 Aug 2011 08:20:27 +0200, Alan Barrett wrote:
On Tue, 02 Aug 2011, Jean-Yves Migeon wrote:
On 01.08.2011 18:57, Alan Barrett wrote:
I suggest making the contents of /etc/defaults/rc.conf be
machine-dependent.  [...]

So I came back to this idea, but implemented it a bit differently. See
the patch attached.

In essence, /etc/defaults/rc.conf includes an arch file (conditioned on
its presence), etc/defaults/rc.arch.conf. This file is found under
src/etc.MACHINE/rc.arch.conf.

At install time, if present, it's installed as a regular config file.

That's not an implementation of my idea.  My idea is to give the end
user a single /etc/defaults/rc.conf file.

Which is still the case, except that it parses an additional file. Yeah, we could endlessly debate on this :)

If merging file fragments at build time is too complex, then you
could make a decision at run time, since /etc/defaults/rc.conf is a
shell script:

    case "$(/sbin/sysctl -n hw.machine_arch)" in
    foo|bar|baz) powerd=YES ;;
    *)           powerd=NO ;;
    esac

I'd like to keep src/etc/defaults/rc.conf untouched from all sort of MD hooks/machinery. I am still looking at bsd.files.mk and some Makefile magic to make the whole thing work by generating a defaults/rc.conf from different fragments, but my current tries look still ugly.

--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index