Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 2015 19:17:31 +0200 (CEST)
From:      Claus Andersen <clan@wheel.dk>
To:        freebsd-stable@freebsd.org
Subject:   [SOLVED][BUG??] Re: Unattended install using bsdinstall and ZFS
Message-ID:  <alpine.BSF.2.20.1505291912550.66999@freesbee.wheel.dk>
In-Reply-To: <555B141A.3000901@quip.cz>
References:  <alpine.BSF.2.20.1505191102100.63121@freesbee.wheel.dk> <555B141A.3000901@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.20.1505291912550.66999>