From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 15 05:27:38 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8DE45648 for ; Sat, 15 Mar 2014 05:27:38 +0000 (UTC) Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com [IPv6:2607:f8b0:400c:c01::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B82DE71 for ; Sat, 15 Mar 2014 05:27:38 +0000 (UTC) Received: by mail-ve0-f177.google.com with SMTP id sa20so3598868veb.36 for ; Fri, 14 Mar 2014 22:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WgXS+pvexEhu1sY1OBIVIix6hI52TTuGK1/wQt0flOQ=; b=PkhbGEEgPIg0Yq6u1vXfF5CeVyw/lwAhcoCKw/ZMKpG7g56Lc3zwAMfApMfQKFvaiH wRx/1HMj1qOhgOOlhjWmkcKuOrJSOTWgXVWNoZBjSFAdrV0ZlTWzuzuOIVtC9EgRHH8W ndCZnI1ZBUeOquxOpLQo6xJcnyW49cEU72MsblYoG4xfPnG2gKHkKvwuOBD02wr0SH+X 0dOkP41bsIPhEbnooSIL8V3xzA4PkGh94AhNUzQX/O5gjwrFEweiUb4HhomVYwgxWak9 kLuUNmE0xrPGqTk6PyxULc8TDgm6psjhom+yACS9Z8uTAe1RsRJYGMN89i/AorUGpjIz ucow== MIME-Version: 1.0 X-Received: by 10.220.67.18 with SMTP id p18mr9707438vci.14.1394861257364; Fri, 14 Mar 2014 22:27:37 -0700 (PDT) Received: by 10.59.6.199 with HTTP; Fri, 14 Mar 2014 22:27:37 -0700 (PDT) In-Reply-To: <20140315001820.GB5765@nbu> References: <20140315001820.GB5765@nbu> Date: Sat, 15 Mar 2014 13:27:37 +0800 Message-ID: Subject: Re: Overhaul the config system with Lua From: =?UTF-8?B?5pyx5rGf?= To: Walt Ford , freebsd-hackers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.17 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Mar 2014 05:27:38 -0000 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 : > 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