From owner-freebsd-stable@FreeBSD.ORG Fri May 29 17:17:42 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 63C67731 for ; Fri, 29 May 2015 17:17:42 +0000 (UTC) (envelope-from clan@wheel.dk) Received: from freesbee.wheel.dk (freesbee.wheel.dk [IPv6:2001:6c8:130::97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freesbee.wheel.dk", Issuer "RapidSSL SHA256 CA - G3" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2445A173C for ; Fri, 29 May 2015 17:17:41 +0000 (UTC) (envelope-from clan@wheel.dk) Received: by freesbee.wheel.dk (Postfix, from userid 1023) id 6FF19371C82; Fri, 29 May 2015 19:17:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wheel.dk; s=20131204; t=1432919851; bh=qaKYexxfYqFSP/dvhm5RwpXyOXF4cDrD8jIUhmvQIfs=; h=Date:From:To:Subject:In-Reply-To:References; b=aA9UNm3vvT5BcaokbdvVUah3daQEJvDCr/AS5Zb19nPXo33IWAiCLhouTF5oRYRFZ Frkk3aqADhq/SigWKGvzutgISDWDvVdxG+DAOzvfFuBBr0Ya9Y8td+O/USXEooFz1+ siWLRDoi+5lW/k1be55m3+s9r9xeVNb9zUWAMwPdviSBTLRehr+yrsplVqPvc3/1W/ t6mMnJO3hyTFY1npR4qBthWCyKdtvXqYIf0tYCgjz42eUKuQsV1ml8dPoNa5Zjv93G 9NQNnxR2vLXSM1TzL2mOHelB9rHQwo1FpduxivixX8LLjrP/23RsZ+4CjY+HImVfRG XgSnrk/uY7dpQ== Received: from localhost (localhost [127.0.0.1]) by freesbee.wheel.dk (Postfix) with ESMTP id 6E891371C81 for ; Fri, 29 May 2015 19:17:31 +0200 (CEST) Date: Fri, 29 May 2015 19:17:31 +0200 (CEST) From: Claus Andersen To: freebsd-stable@freebsd.org Subject: [SOLVED][BUG??] Re: Unattended install using bsdinstall and ZFS In-Reply-To: <555B141A.3000901@quip.cz> Message-ID: References: <555B141A.3000901@quip.cz> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII 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: Fri, 29 May 2015 17:17:42 -0000 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. Kind Regards, Claus Andersen