From owner-freebsd-sysinstall@FreeBSD.ORG Wed Jan 18 18:14:28 2012 Return-Path: Delivered-To: freebsd-sysinstall@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 628FE106566B for ; Wed, 18 Jan 2012 18:14:28 +0000 (UTC) (envelope-from rcm@fuzzwad.org) Received: from mail.volente.us (unknown [IPv6:2001:470:7:d47::2]) by mx1.freebsd.org (Postfix) with ESMTP id 247BA8FC0A for ; Wed, 18 Jan 2012 18:14:28 +0000 (UTC) Received: from shiny-w0.fuzzwad.net (localhost [127.0.0.1]) by mail.volente.us (8.14.4/8.14.4) with ESMTP id q0IIEM3t041834; Wed, 18 Jan 2012 12:14:24 -0600 (CST) (envelope-from rcm@fuzzwad.org) Message-ID: <4F170BFD.9060407@fuzzwad.org> Date: Wed, 18 Jan 2012 12:14:21 -0600 From: Ron McDowell User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Devin Teske References: <4F1361C9.4080403@fuzzwad.org> <4F15C86B.5020802@fuzzwad.org> <039201ccd559$d77e0e30$867a2a90$@fisglobal.com> In-Reply-To: <039201ccd559$d77e0e30$867a2a90$@fisglobal.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-sysinstall@freebsd.org Subject: Re: My thoughts on "bsdconfig" X-BeenThere: freebsd-sysinstall@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Sysinstall Work List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 18:14:28 -0000 On 1/17/12 2:51 PM, Devin Teske wrote: > However, I feel that a better approach would be to allow /usr/libexec/bsdconfig > to function more like /etc/rc.d -- specifically that simply installing a new > '*.rc' file into said-directory is enough to get a new menu item to appear. > > The specifics of which I open to discussion, however I envision the main > bsdconfig script doing the following on start-up to accommodate a modular > architecture of the root (main) menu: > > 1. Look in /usr/libexec/bsdconfig for '*.rc' (or some similar naming > convention). > 2. Source each one in the following manner: > 2.a. first, syntax-check the rc file using "sh -n FILE". If this fails, warn and > skip > 2.b. next, source the rc file using "." built-in safely from within sub-shell. > If this fails, warn and skip. > 2.c. The rc file conditionally provides in some manner (like name= in rc.d > scripts) details on how to represent the menu item for this module > 3. bsdconfig uses said details to construct the menu-item for each individual > module > 4. bsdconfig presents the menu > 5. When a menu item is selected, invoke the appropriate function within the > selected module > > It makes expanding the tool quite easy as (conceivably) there would be a > template for creating new modules (just as there is a template for creating new > rc.d scripts). I like this. But it will take some serious in-depth thought. -- Ron McDowell San Antonio TX