From owner-freebsd-sysinstall@FreeBSD.ORG Mon Jun 28 03:44:45 2010 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 54D0A106566B for ; Mon, 28 Jun 2010 03:44:45 +0000 (UTC) (envelope-from sektie@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0EEBE8FC17 for ; Mon, 28 Jun 2010 03:44:44 +0000 (UTC) Received: by vws13 with SMTP id 13so6966768vws.13 for ; Sun, 27 Jun 2010 20:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=RdkJMHN3w9SUdhika6MxA9M706mzrW6cbdnudqDfsRY=; b=dLj9VrGMggAqPfp4hJmDgTThzGJshNsUHUzIxxaylXig30cj2tWZIglT8tN4uk25V7 jTSWsINebkrlTFBjdtRTsu3mTZcutP34GlRmh5wsEe6K8LHN3WTDDhImcW3eoKEqnfes yjZr0L+kJkn7rX3eyaxisCQD+LgbpoN9cs3/A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=WFaPRro92fszG/VY+CnUu8Do24rxZWCRivN1vg0A6ENlA+7LQIRIW15nlpSGzZgEha xvctAeyCIJvSOKAteq2iwUjv6MwLU5Co0aKFZKRYpbkXEvFdPK3Y7Ti4u2/a/fx/iVHV 5zMfK6doLlt6kW++2gsiSDxzAd8R56lIcuQk0= MIME-Version: 1.0 Received: by 10.220.127.95 with SMTP id f31mr2535189vcs.163.1277696675311; Sun, 27 Jun 2010 20:44:35 -0700 (PDT) Sender: sektie@gmail.com Received: by 10.220.71.13 with HTTP; Sun, 27 Jun 2010 20:44:35 -0700 (PDT) Date: Sun, 27 Jun 2010 20:44:35 -0700 X-Google-Sender-Auth: Aeka6zxgb1ZkJDS2c_HZZ8Y-xQU Message-ID: From: Randi Harper To: freebsd-sysinstall@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Mailman-Approved-At: Mon, 28 Jun 2010 03:55:47 +0000 Subject: documentation work 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: Mon, 28 Jun 2010 03:44:45 -0000 Another thing that needs to get done is a refresh of the documentation. As the man page says, there's a good deal of variables that aren't documented. Getting a list of them is easy - they are in sysinstall.h. If someone is looking for a way to get more familiar with sysinstall code, researching and documenting these missing variables would be an easy task. I know working on documentation may not seem all that glamorous if you're looking to write code. If no one else wants to step up and offer, I'll work on it, but I know we've got some new people around that are looking for something to do. :) -- randi From owner-freebsd-sysinstall@FreeBSD.ORG Mon Jun 28 10:55:50 2010 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 D7CB71065674 for ; Mon, 28 Jun 2010 10:55:50 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id 9D27F8FC14 for ; Mon, 28 Jun 2010 10:55:50 +0000 (UTC) Received: from unknown (client-86-31-67-88.midd.adsl.virginmedia.com [86.31.67.88]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 01A2F5C03; Mon, 28 Jun 2010 10:55:56 +0000 (UTC) Date: Mon, 28 Jun 2010 11:55:41 +0100 From: Bruce Cran To: Karsten Behrmann Message-ID: <20100628115541.00002945@unknown> In-Reply-To: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net> References: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net> X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-sysinstall@freebsd.org Subject: Re: Some design suggestions 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: Mon, 28 Jun 2010 10:55:50 -0000 On Sun, 27 Jun 2010 00:23:34 +0200 Karsten Behrmann wrote: > [TL;DR: Sysinstall is old and grown, and we should make some > adjustments to modules/headers/functions to fit the bigger size] sysinstall is a prototype, so keeping that in mind we should feel free to restructure it as needed. > I suggest having each typed as > int configFoo(void) > where appropriate, with the following return codes: > * 0 - success > * 1 - unspecified error (to catch returns of a && b) > * 2 - user initiated abort (by pressing cancel or something) > * 3 - operation failed (no disk found, I/O error, ...) I'd prefer something like: struct foo* initFoo(void); Then, pass the foo* around each of the functions. I think that having fewer globals is a good thing. Also, we should typedef the return type to make it clear what it refers to. > ----- avoid libdialog in API ----- > [TL;DR: libdialog return codes suck. Don't use them. Don't use > libdialog arguments unnecessarily either] I agree - we should be aiming towards a UI-agnostic API so that in the future a text or GUI frontend can be plugged in if pc-sysinstall ends up not taking over. > ----- use more static data ----- > [TL;DR: Don't use environment variables to store config info, use > static globals inside the modules instead] I disagree: globals are almost as bad as environment variables. I think we should instead use context structures that we pass around, like geom does. -- Bruce Cran brucec From owner-freebsd-sysinstall@FreeBSD.ORG Mon Jun 28 11:32:20 2010 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 5BBDA106564A for ; Mon, 28 Jun 2010 11:32:20 +0000 (UTC) (envelope-from BearPerson@gmx.net) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id B66518FC08 for ; Mon, 28 Jun 2010 11:32:19 +0000 (UTC) Received: (qmail invoked by alias); 28 Jun 2010 11:32:17 -0000 Received: from port-92-204-43-35.dynamic.qsc.de (EHLO [192.168.0.146]) [92.204.43.35] by mail.gmx.net (mp039) with SMTP; 28 Jun 2010 13:32:17 +0200 X-Authenticated: #20254835 X-Provags-ID: V01U2FsdGVkX195V8Yg1Dl5S18B1AuqewvxWdJE4328KXn41hog3t OeFGQbrFv5WqkJ Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) From: Karsten Behrmann In-Reply-To: <20100628115541.00002945@unknown> Date: Mon, 28 Jun 2010 13:32:17 +0200 Content-Transfer-Encoding: 7bit Message-Id: <8CA80062-E8A7-40C3-B364-0493BDBBCD34@gmx.net> References: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net> <20100628115541.00002945@unknown> To: freebsd-sysinstall@freebsd.org X-Mailer: Apple Mail (2.1081) X-Y-GMX-Trusted: 0 Subject: Re: Some design suggestions 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: Mon, 28 Jun 2010 11:32:20 -0000 As Bruce Cran wrote: > Quoting Karsten Behrmann: >> I suggest having each typed as >> int configFoo(void) >> where appropriate, with the following return codes: >> * 0 - success >> * 1 - unspecified error (to catch returns of a && b) >> * 2 - user initiated abort (by pressing cancel or something) >> * 3 - operation failed (no disk found, I/O error, ...) > > I'd prefer something like: > > struct foo* initFoo(void); > > Then, pass the foo* around each of the functions. I think > that having fewer globals is a good thing. Also, we should typedef the > return type to make it clear what it refers to. I was thinking we might do an enum for the status, but that might make callers overly verbose, not sure... "int rc" just is shorter than "enum SysinstallReturn rc" [see below for more ranting on "fewer globals" - suffice to say that I strongly disagree with the foo* .] > I agree - we should be aiming towards a UI-agnostic API so that in the > future a text or GUI frontend can be plugged in if pc-sysinstall ends > up not taking over. This is a side effect, but not what I'm driving at (yet). Having UI- agnostic API helps writing different frontends, but since the backend functions heavily interact with the user, we would need a UI-agnostic UI library anyway before we can really plug in different UIs. Instead, my concern is that the main parts of the API should not be burdened by the thought "how should I influence the menu when I am used inside one" - regardless of which types and conventions we use to reflect that. There is more than enough these functions need to worry about, already. >> ----- use more static data ----- >> [TL;DR: Don't use environment variables to store config info, use >> static globals inside the modules instead] > > I disagree: globals are almost as bad as environment variables. I think > we should instead use context structures that we pass around, like geom > does. Not so. I do not feel it makes much of a difference whether a variable resides on the heap or somewhere in static data. Context structures are essential when you need something more than once. However, I don't see us configuring two wholly distinct partitionings inside the same sysinstall session. It *IS* singleton state, and then we might as well store it easily into static variables. I do not like having an extra state parameter to worry about, and doing state->root_partition is just that little bit more for my eyes to ignore than reading just root_partition. Of course, this is personal preference. But I do not believe (static) globals should be unilaterally killed, they are quite useful. They have these advantages over environment variables: - arbitrarily typeable - clear ownership/responsibility - compiler enforces local-only access Now, as long as the struct definition is local to the modules, and the rest only passes around pointers, context structures provide the exact same advantages. I fail to see any further advantages that would be relevant for us: No relevant technological advantages, and nothing that would force a better overall design/style, either. Call me old-fashioned, but I don't like allocating memory dynamically any more than I really have to. Having more large structures to worry about makes me itchy. At the end of the day, it's all global state - no matter if it is referenced as a static global field, or as a field on a struct that was allocated exactly once and is referenced a couple of times from the stack. And don't tell me "but a struct can be free()d to reset to defaults" - not so. The relevant "reset to defaults" happens inside your "initFoo", and whether that allocates a new struct, and assigns defaults to its field, or if it assigns the defaults to static fields, seems hardly different at all. So Far, Karsten From owner-freebsd-sysinstall@FreeBSD.ORG Tue Jun 29 11:37:58 2010 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 8D8B91065670 for ; Tue, 29 Jun 2010 11:37:58 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id 52DC18FC1C for ; Tue, 29 Jun 2010 11:37:57 +0000 (UTC) Received: from unknown (client-86-31-67-88.midd.adsl.virginmedia.com [86.31.67.88]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id D6F006131; Tue, 29 Jun 2010 11:38:05 +0000 (UTC) Date: Tue, 29 Jun 2010 12:37:54 +0100 From: Bruce Cran To: Karsten Behrmann Message-ID: <20100629123754.00004ab1@unknown> In-Reply-To: <8CA80062-E8A7-40C3-B364-0493BDBBCD34@gmx.net> References: <3B0E67D1-95E7-421C-A506-744C86BC1E6C@gmx.net> <20100628115541.00002945@unknown> <8CA80062-E8A7-40C3-B364-0493BDBBCD34@gmx.net> X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-sysinstall@freebsd.org Subject: Re: Some design suggestions 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: Tue, 29 Jun 2010 11:37:58 -0000 On Mon, 28 Jun 2010 13:32:17 +0200 Karsten Behrmann wrote: > Not so. > I do not feel it makes much of a difference whether a variable resides > on the heap or somewhere in static data. > > Context structures are essential when you need something more than > once. However, I don't see us configuring two wholly distinct > partitionings inside the same sysinstall session. It *IS* singleton > state, and then we might as well store it easily into static > variables. > > I do not like having an extra state parameter to worry about, and > doing state->root_partition is just that little bit more for my eyes > to ignore than reading just root_partition. > > Of course, this is personal preference. But I do not believe (static) > globals should be unilaterally killed, they are quite useful. They > have these advantages over environment variables: > - arbitrarily typeable > - clear ownership/responsibility > - compiler enforces local-only access As long as the globals are declared in a single place and are restricted to the module, that sounds like a good idea: what I don't like is where globals are scattered throughout the file, some being declared at the top and some just before the function that uses them. I've worked on too many .NET projects with far too many fields that I've become very wary of globals! -- Bruce Cran From owner-freebsd-sysinstall@FreeBSD.ORG Thu Jul 1 17:21:08 2010 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 3712A1065673 for ; Thu, 1 Jul 2010 17:21:08 +0000 (UTC) (envelope-from webmaster@serverman.de) Received: from ws1.serverman.de (ws1.serverman.de [193.26.24.170]) by mx1.freebsd.org (Postfix) with ESMTP id ECA9F8FC0A for ; Thu, 1 Jul 2010 17:21:07 +0000 (UTC) Received: by ws1.serverman.de (Postfix, from userid 5001) id 44B595A4B7; Thu, 1 Jul 2010 19:05:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ws1.serverman.de X-Spam-Level: X-Spam-Status: No, score=-4.4 required=7.0 tests=ALL_TRUSTED,AWL,BAYES_00, NORMAL_HTTP_TO_IP autolearn=ham version=3.2.5 Received: from [192.168.1.24] (p4FF5D561.dip.t-dialin.net [79.245.213.97]) by ws1.serverman.de (Postfix) with ESMTPA id 3DAB95A4B5 for ; Thu, 1 Jul 2010 19:05:12 +0200 (CEST) Message-ID: <4C2CCAC7.60007@serverman.de> Date: Thu, 01 Jul 2010 19:05:11 +0200 From: "Thomas Toka / www.serverman.de" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-sysinstall@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Sysinstall install.cfg 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: Thu, 01 Jul 2010 17:21:08 -0000 Hi there, first of all sorry for posting here and there... I am new to freebsd sysinstall and did not know where to ask till i was redirected here... Ok so my goal is to script a automated freebsd install. I have followed this howto: http://www.locolomo.org/howto/pxeboot/article.html I have tweaked here and there... i start my mfsroot with: mfsroot_load="YES" mfsroot_type="mfs_root" mfsroot_name="/boot/mfsroot_tftp" vfs.root.mountfrom="ufs:/dev/md0" init_path="/stand/sysinstall" init_script="/etc/rc.jumpstart" init_shell="/bin/sh" My install.conf looks like this: ## install.cfg debug="YES" tryDHCP="YES" ifconfig_em0="DHCP" netDev="em0" hostname="jumpstart" domainname=serverman.de command=/stand/boot_crunch ifconfig em0 up system command=/stand/boot_crunch dhclient em0 system command=/stand/boot_crunch ftp -o /stand/hostinstall.cfg http://192.168.1.15/hostinstall.cfg system command=/stand/sysinstall configFile=/stand/hostinstall.cfg loadConfig So what i want to do ist fire up em0, start dhcplient, load hostinstall.cfg and execute this. Only thing that happens ist that the installer starts and i can choose language. I habe scripte all systems linke debian (preseed), suse (autoyast), centos (ks) and others... So i know i a m not far away... There must be some variable like nonInteractive but i could not manage even if i added theme... I see the output of debug on F2 but it is not executed. How to manage this? Thanks... -- Viele Grüsse aus Menden Thomas Toka ======================================================================== Webmaster, Administrator, Webhoster, Gameserverhoster