From owner-freebsd-questions@FreeBSD.ORG Thu Aug 1 17:58:09 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 115CCC82; Thu, 1 Aug 2013 17:58:09 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C83CC2198; Thu, 1 Aug 2013 17:58:08 +0000 (UTC) Received: from smtp.fisglobal.com ([10.132.206.31]) by ltcfislmsgpa06.fnfis.com (8.14.5/8.14.5) with ESMTP id r71Hw7OO021989 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 1 Aug 2013 12:58:07 -0500 Received: from LTCFISWMSGMB21.FNFIS.com ([10.132.99.23]) by LTCFISWMSGHT03.FNFIS.com ([10.132.206.31]) with mapi id 14.02.0309.002; Thu, 1 Aug 2013 12:58:06 -0500 From: "Teske, Devin" To: Amitabh Kant Subject: Re: Make Release Thread-Topic: Make Release Thread-Index: AQHOjtJECsxKvcvx/UeR7ZtcfRlfPpmA4r6AgAADpwCAABEggA== Date: Thu, 1 Aug 2013 17:58:05 +0000 Message-ID: <13CA24D6AB415D428143D44749F57D7201FFEEA3@ltcfiswmsgmb21> References: <13CA24D6AB415D428143D44749F57D7201FFEB17@ltcfiswmsgmb21> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.132.253.126] Content-Type: text/plain; charset="iso-8859-1" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794, 1.0.431, 0.0.0000 definitions=2013-08-01_08:2013-08-01,2013-08-01,1970-01-01 signatures=0 Cc: "Sam Fourman Jr." , Devin Teske , FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Devin Teske List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 17:58:09 -0000 On Aug 1, 2013, at 9:56 AM, Amitabh Kant wrote: > On Thu, Aug 1, 2013 at 10:13 PM, Teske, Devin = wrote: > I'm hoping that my very open development documentation on customizing the= release(7) process for producing DruidBSD releases can help you out here. >=20 > I've documented much of the internals of the release(7) process (albeit, = relevant to the RELENG_8 release(7) Makefile; in RELENG_9 it's still releva= nt to /usr/src/release/Makefile.sysinstall ... but I gather that much of th= e knobs may still exist in HEAD). >=20 > Have a read through this revision-controlled text file... >=20 > http://druidbsd.cvs.sf.net/viewvc/druidbsd/druidbsd/druid/dep/freebsd/pat= ches/README?revision=3D1.2&view=3Dmarkup >=20 > ALSO NOTE: Yes, the file is dated... it talks about cvsup instead of svn.= My hope is that the doco can be a good starting point (even if the data is= a bit dated). >=20 > In there, you'll find things like (relevant to RELENG_9): >=20 > make -f Makefile.sysinstall release \ > MAKE=3D"/usr/bin/env CFLAGS=3D-DDRUID make" \ > CHROOTDIR=3D/usr/release EXTSRCDIR=3D/usr/src KERNELS_BAS= E=3D \ > NODOC=3DYES NO_FLOPPIES=3DYES NOCDROM=3DYES NOPORTS=3DYES= \ > WORLD_FLAGS=3D-DWITHOUT_OPENSSL PATCH_FLAGS=3D-N \ > LOCAL_PATCHES=3D/tmp/druid.patches \ > LOCAL_SCRIPT=3D/tmp/local_script.sh |& tee release.log >=20 > Take special note of the "LOCAL_SCRIPT=3D" option. >=20 > Maybe, just maybe, the bsdinstall-specific release(7) process supports LO= CAL_SCRIPT too. If it doesn't... why not? > -- > Devin >=20 > Devin >=20 > Do you have any idea if there have an changes to bsdinstall process (on s= cripting side) in the upcoming 9.2 ?=20 >=20 Yes, the partedit portion of bsdinstall is scriptable in 9.2. Also, many bu= g fixes. Also, you can now create /etc/installerconf (no `dot' between inst= aller and conf) and it will be picked up and run by bsdinstall. For your bsdinstall scripts, 2 new tools and a new framework to learn... Tools: bsdconfig(8) and sysrc(8) Framework: bsdconfig libraries (advanced scripting) If you're behind on your sysinstall(8) *(yes... sysinstall(8)) scripting ab= ilities, then I suggest you brush up. * bsdconfig(8) is [mostly] backward compatible sysinstall(8) scripts So... in your bsdinstal installerconf, you can: # Example A # ( do bsdinstall stuff ) then... bsdconfig packages # Example B # ( do bsdinstall stuff ) then... sysrc sshd_enable=3D"YES" # Example C # ( do bsdinstall stuff ) then... . /usr/share/bsdconfig/script.subr || exit 1 for package in a-1.0 b-2.0 c-3.0; do packageAdd done Here's a full list of items that bsdconfig(8) supports which are documented= in sysinstall(8) (to which all you need to do to access is to include "/us= r/share/bsdconfig/script.subr"): loadConfig deviceRescan mediaOpen mediaClose mediaGetType mediaSetCDROM mediaSetDOS mediaSetDirectory mediaSetFloppy mediaSetNFS mediaSetUFS mediaSetUSB optionsEditor tcpMenuSelect mediaSetFTP mediaSetFTPActive mediaSetFTPPassive mediaSetFTPUserPass mediaSetHTTP mediaSetHTTPProxy configPCNFSD configPackages packageAdd packageDelete packageReinstall installVarDefaults dumpVariables But that's only the tip of the iceberg. To get a full idea of what you can = do with shell-script ALONE, you have to see the bsdconfig includes, which a= re in /usr/share/bsdconfig (link to what's released into 9.2 below): http://svnweb.freebsd.org/base/stable/9/usr.sbin/bsdconfig/share/ For example, there is: common.subr -- stuff everybody should use (makes your code cleaner and give= s you basic abilities missing in shell, like f_getvar -- partner to setvar) device.subr -- scan for known devices and create structures with device inf= o and type. Also provide routines for quickly scanning the array of structu= res for pre-probed devices of a specific type. Also contains code for prese= nting a menu of devices (of given type) to the user to select, returning th= e user's selection for processing. dialog.subr -- a *monster* of a library (uber documented to boot). Allows c= lean abstraction of dialog to where either dialog(1) or Xdialog(1) is a sim= ple proposition to interface to. mustberoot.subr -- if your shell script needs to be able to run as non-root= but escalate to root as-needed, this provides a clean way to transition to= where your users seemlessly elevate. script.subr -- a dummy include that includes all the other includes. strings.subr -- handy string manipulation routines (tuned both for convenie= nce and performance). struct.subr -- hold information in structs (using shell!) sysrc.subr -- manage rc.conf(5)! variable.subr -- variable definitions (boring; unless you code on bsdconfig= -- hey, think about writing a module sometime! I encourage it, it's fun!) Beyond that... ( ok that's enough for this e-mail ). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you.