Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 2014 13:27:37 +0800
From:      =?UTF-8?B?5pyx5rGf?= <mail.jiang.cn@gmail.com>
To:        Walt Ford <walt.ford@yahoo.com>, freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Overhaul the config system with Lua
Message-ID:  <CAA_8tFrE2FA2=w-b77a_5jcoVv_yWGr=Vg5xzCnsMX30MpDMkw@mail.gmail.com>
In-Reply-To: <20140315001820.GB5765@nbu>
References:  <CAA_8tFojhn66ZkaR_Bxzv3fMzbuc6o2J9fYe4-pW6X0skgA8=Q@mail.gmail.com> <20140315001820.GB5765@nbu>

next in thread | previous in thread | raw e-mail | index | archive | help
Walt,

Your experience is very helpful to me. Can you provide more detail about
your work? And I can learn something from your work.


2014-03-15 8:18 GMT+08:00 Walt Ford <walt.ford@yahoo.com>:

> On Sat, Mar 15, 2014 at 01:11:03AM +0800, =E6=9C=B1=E6=B1=9F wrote:
> > I want to overhaul the config system with Lua, and it will be my GSoC
> 2014
> > project. Here is the
> > proposal<
> https://docs.google.com/document/d/1azZm8WHBiT_oaQ1fEhUWGiYWyn4hvwxEkMXqf=
1aR00g/edit?usp=3Dsharing
> >
>
> That's an excellent project.  I've had Lua in my own base system for
> years and have converted the rc system to use it at various times,
> along with some base utilities.  I've been considering posting a
> Kickstarter project to finally finish it all, but Lua isn't the most
> popular language, and FreeBSD isn't the most popular OS.
>
> The main goal of my work was to present a more uniform userland.
> Everybody hacks on the kernel, but userland gets a little ignored.
> There's not much uniformity between command-line options, interactivity,
> color, scriptability, layout, and naming of utilities, and Lua was a grea=
t
> fit to clean it up.
>
> I even got it to the point of generating utilities on its own.  When
> Robert Watson imported audit(2) it was able to crawl the headers and
> generate a utility in the style of top(1) that showed the most active
> audit record types as colorized output like gstat(8).  Lua could get to
> the point where it automatically generates entire applications with
> uniform command-line options, interactivity, color, and scriptability, ju=
st
> based on kernel subsystem definitions in header files plus a little glue.
>
> Unfortunately, I've never had the time or money to finish it all.  That
> audit utility is dated 2007.
>
> > I will create a wiki in my site soon. Please let me know if you have an=
y
> > good ideas about the new config system. They will not be a part of my
> GSoC
> > project, however, I will do this work continuously after GSoC.
>
> I converted a lot of FreeBSD to Lua, but never config(8).  Some build
> issues
> to figure out how to solve are:
>
>         * the differences and sloppiness in how userland and kernel optio=
ns
>           are handled
>                 kernel options are manually documented in sys/conf/option=
s*
>                     and have no man page
>                 share/examples/etc/kern.conf doesn't exist
>                 userland options are documented in tools/build/options an=
d
>                     the man page, src.conf, is generated using a shell
> script
>                 share/examples/etc/src.conf doesn't exist
>                 share/examples/etc/make.conf is manually updated and ofte=
n
>                     out-of-date
>
>         * generate GENERIC config files
>                 currently things are copied and pasted for every arch
>                 would need to account for DEFAULTS
>
>         * automatic generation of OptionalObsoleteFiles.inc
>                 must be manually updated and has never been complete
>                 a make target could build twice with and without option
> then
>                     find the missing files
>                 probably a better job for jenkins and make, but Lua could
>                     help
>
> I'm sure there are other ways to improve the build system as a whole usin=
g
> Lua, as long as you don't confine yourself to reimplementing config(8)
> only.  The information about options currently stored in
> tools/build/options
> and sys/conf/options should really be part of config(8), along with the
> architecture information necessary to generate documentation or source
> files
> automatically.
>
> Lua would make a great kernel language as well, another one of the projec=
ts
> I started and haven't had time to play with.
>
> --
> Walt
>



--=20
Jiang Zhu
mail.jiang.cn@gmail.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAA_8tFrE2FA2=w-b77a_5jcoVv_yWGr=Vg5xzCnsMX30MpDMkw>