From owner-freebsd-stable@FreeBSD.ORG Tue May 19 10:52:54 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 974787B3 for ; Tue, 19 May 2015 10:52:54 +0000 (UTC) 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 4A2851782 for ; Tue, 19 May 2015 10:52:53 +0000 (UTC) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 89AB728428; Tue, 19 May 2015 12:44:43 +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 8408728427; Tue, 19 May 2015 12:44:42 +0200 (CEST) Message-ID: <555B141A.3000901@quip.cz> Date: Tue, 19 May 2015 12:44:42 +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: Unattended install using bsdinstall and ZFS References: 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: Tue, 19 May 2015 10:52:54 -0000 Claus Andersen wrote on 05/19/2015 11:06: > Hi, > > Got no answer on -questions so I hope I do not break netiquette by > trying my luck here: > > I cannot wrap my head around this: Am able to do an unattended install > using bsdinstall and UFS on 10.1. But I cannot get ZFS to work unattended. > If I set the variables concerning ZFS in the install script they do not > seem to get picked up. If I set them on the command line using export > before I execute the script it only picks up on ZFSBOOT_* but seems to > ignore ZFSINTERACTIVE and ZFS_CONFIRM_LAYOUT > > This almost works: > # ZFSBOOT_DISKS="da0 da1" > # ZFSBOOT_VDEV_TYPE="mirror" > # ZFSBOOT_CONFIRM_LAYOUT=0 > # export ZFSBOOT_DISKS ZFSBOOT_VDEV_TYPE ZFSBOOT_CONFIRM_LAYOUT > # bsdinstall script install.txt > > But this still gives me the menu "ZFS Configuration". In the menu I can > see that it has picked up ZFSBOOT_DISKS and ZFSBOOT_VDEV_TYPE. > > The minimal "install.txt" contains: > > DISTRIBUTIONS="kernel.txz base.txz" > RELEASE="10.1" > ZFSINTERACTIVE="NO" > > #!/bin/sh > echo "Installation complete, running in host system" > > It seems to ignore ZFSINTERACTIVE. I have tried with 0, "0", "false", > "False", "FALSE". And I have tried going the export route. > > I would rather use whatever bsdinstall makes available so I can retire my > current range of DIY scripts. > > What is the correct(TM) way of doing unattended install using bsdinstall > and ZFS? Google and the man page was not enough for me - I need a real > human being! I didn't use bsdinstall script, but I look in to code and I think you should not set ZFSINTERACTIVE at all (or leave it empty?). If it is set, you get Interactive install. You just need to set NONINTERACTIVE This is the code used by bsdinstall and there are useful comments: /usr/share/bsdconfig/variable.subr # f_zfsinteractive # # Has the user specifically requested the ZFS-portion of configuration and # setup to be performed interactively? Returns success if the user has asked # for the ZFS configuration to be done interactively even if perhaps overall # non-interactive mode has been requested (by setting nonInteractive). # # Returns success if $zfsInteractive is set and non-NULL. # f_zfsinteractive() { local value f_getvar $VAR_ZFSINTERACTIVE value && [ "$value" ] } # f_interactive # # Are we running interactively? Return error if $nonInteractive is set and non- # NULL, otherwise return success. # f_interactive() { local value ! f_getvar $VAR_NONINTERACTIVE value || [ ! "$value" ] } Take a closer look in to /usr/share/bsdconfig/variable.subr Miroslav Lachman