From owner-freebsd-stable@FreeBSD.ORG Thu Jun 4 20:02:58 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9DAC78CE for ; Thu, 4 Jun 2015 20:02:58 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C03E166C for ; Thu, 4 Jun 2015 20:02:57 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 8F53328426; Thu, 4 Jun 2015 21:57:11 +0200 (CEST) Received: from illbsd.quip.test (ip-89-177-50-74.net.upcbroadband.cz [89.177.50.74]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 5E9A228423; Thu, 4 Jun 2015 21:57:10 +0200 (CEST) Message-ID: <5570AD96.5030802@quip.cz> Date: Thu, 04 Jun 2015 21:57:10 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:35.0) Gecko/20100101 Firefox/35.0 SeaMonkey/2.32 MIME-Version: 1.0 To: Claus Andersen , freebsd-stable@freebsd.org Subject: Re: [SOLVED][BUG??] Re: Unattended install using bsdinstall and ZFS References: <555B141A.3000901@quip.cz> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2015 20:02:58 -0000 Claus Andersen wrote on 05/29/2015 19:17: > Hi! > > A quick re-cap: Want to do an unattended FreeBSD install using > bsdinstall and ZFS. I now have a workaround and consider crying > wol^H^H^Hbug. > > The following minimal install script works as expected for UFS: > > install-ufs.txt > DISTRIBUTIONS="kernel.txz base.txz" > RELEASE="10.1" > PARTITIONS="da0" > > #!/bin/sh > echo "Ready for post installation damage..." > > Invoke with: > bsdinstall script install-ufs.txt > > Now switching to ZFS I would expect the following to work: > > install-zfs1.txt > DISTRIBUTIONS="kernel.txz base.txz" > RELEASE="10.1" > ZFSBOOT_DISKS="da0 da1" > ZFSBOOT_VDEV_TYPE="mirror" > > #!/bin/sh > echo "Ready for post installation damage..." > > Invoke with: > bsdinstall script install-zfs1.txt > > Failure: > - ZFSBOOT_DISKS, ZFSBOOT_VDEV_TYPE not picked up > - Asks for ZFS configuration interactively > > Miroslav Lachman hinted that from looking at the source I should set > NONINTERACTIVE. This does not work. > > Hours later I have figure out the following which works(tm): > > install-zfs2.txt > DISTRIBUTIONS="kernel.txz base.txz" > RELEASE="10.1" > export ZFSBOOT_DISKS="da0 da1" > export ZFSBOOT_VDEV_TYPE="mirror" > export nonInteractive="YES" > > #!/bin/sh > echo "Ready for post installation damage..." > > Invoke with: > bsdinstall script install-zfs2.txt > > This works as expected but it does not sit nice with me. But I am no > guru so I would be very very happy if anyone can confirm if my findings > are bogus or not? There is a huge number of indirect variables which > really confuses me! It seems that either someone is putting in a lot of > indirections but is not done yet - or vice versa. So "proper" usage is > up in the air. > > Findings: > - CAPITAL letters are used for "input" variables > - CamelCase is used for "internal" variables. > - NONINTERACTIVE should be set by default when using "bsdinstall script" > - Setting NONINTERACTIVE manually is not picked up > - Setting nonInteractive works but is bad practice and not intended by > design > - Doing export as part of the bsdinstall script is not what was intended > by design > > Does these findings sound reasonable? If so - would it be fair to > consider the current functionality a bug? Or am I too stupid to get the > feature? > > I can file a PR and help out with test and documentation. But the > current incarnation of bsdinstall is too convoluted for my low level of > script-fu. I am out of free time so I cannot go deeper in this problem. But from what I see I can confirm your findings - it seems like a bug and it would be good if you can file a PR for it so it will not be lost. Miroslav Lachman