[Initng] Suggestions for ifiles organization
Ismael Luceno
ismael.luceno at gmail.com
Sat Oct 27 02:53:33 CEST 2007
El Sat, 27 Oct 2007 01:42:40 +0200
Eric MSP Veith <eveith at wwweb-library.net> escribió:
> Heh, I just forgot the IMHO most important idea that came up. :-)
>
> What about different ifile branches, a generic one and one for each
> distro we are able to support. The generic branch would use boot-time
> configuration in /etc/initng/bootconf.d, configuration settings could
> be retrieved with a fast C program that is called from scripts. These
> generic calls would be distinctive and not very special, beeing
> easlily replaceable.
I think it's a good idea to have different branches. But I think this
isn't the time for the change, I prefer to make the transition after
the first release of initng-0.7.x if possible.
>
> I'm currently working on that C program (I call it "bootopt"),
> because I'm going to use it with my own ifiles branch. I'm going to
> stick with the Bernstein Way, which basically means that every option
> is a file. If a file existis, the option is set. If the option takes
> an argument, we read _one line_ from the file. Nobody can make any
> mistakes that way, syntax errors are gone forever.
>
> Bootopt takes the follwing switches:
>
> - -b (boolean) Exit with 0 if the option is set (the file exists)
> or 1 if not. Does not output anything.
> - -g (get) Prints out the option set (or nothing if the file is
> empty), returns 0 if the option is set, 1 otherwise. This is the
> standard behaviour.
> - -s (set) Sets the option to a specified value or to \"true\" if
> used in conjunction with -b.
>
> In the distro-specific ifiles, the bootopt call could either be
> directly replaced with the corresponding call (mostly including some
> shell script) that is used on this distro, or bootopt could evolve to
> a transparent layer for alot of configuration schemes.
>
> Again, tell me what you think. :-)
>
Well, the problem here is that it's very expensive to stat/read a lot of
small files in contrast to read only one file once, and it doesn't
helps with compatibility...
A better solution IMO, is to have a static script to config-file
mapping, so that we don't have to think about it, and actually avoid
supporting the distro configuration, also we can make a menu-based
configuration utility, maybe using dialog...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://jw.dyndns.org/pipermail/initng/attachments/20071026/6b4a0c14/attachment.pgp
More information about the Initng
mailing list