Unattended install using bsdinstall and ZFS

Claus Andersen clan at wheel.dk
Tue May 19 12:34:27 UTC 2015


On Tue, 19 May 2015, Miroslav Lachman wrote:

> 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

Thanks! This makes sense - but does not work for me. I have tried to set 
NONINTERACTIVE but I get the same result: The "ZFS Configuration" dialog. 
On a side note I would expect NONINTERACTIVE to be set in "script" - but I 
digress.

When I follow the source as you suggest I see:

/usr/libexec/bsdinstall/script
calls "bsdinstall zfsboot" because ZFSBOOT_DISKS is set.

Looking in /usr/libexec/bsdinstall/zfsboot the interesting bit here seems 
to be:

#
# If interactive and the user has not explicitly chosen a vdev type or disks,
# make the user confirm scripted/default choices when proceeding to install.
#
: ${ZFSBOOT_CONFIRM_LAYOUT:=1}

But I have set both vdev type and disks. I have even tried setting 
ZFSBOOT_CONFIRM_LAYOUT=0 - but most of my tests are without setting this. 
And this seems to control a later confimation step - and not the initial 
"ZFS Configuration" dialog.

This bit kills me if I have ZFSINTERACTIVE set. But I have not (anymore):

# User may have specifically requested ZFS-related operations be interactive
! f_interactive && f_zfsinteractive && unset $VAR_NONINTERACTIVE

So when I examine the code with my limited capabilities everything looks 
correct. But it still fails for me.

I do the following in a new clean and pristine VM booting the 10.1 CD.

   	# export ZFSBOOT_DISKS="da0 da1"
   	# export ZFSBOOT_VDEV_TYPE="mirror"
   	# 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.

I have tried the following invariant:

   	# export ZFSBOOT_DISKS="da0 da1"
   	# export ZFSBOOT_VDEV_TYPE="mirror"
   	# export NONINTERACTIVE="YES"
   	# bsdinstall script install.txt

With the same result.

The minimal "install.txt" contains:

   	DISTRIBUTIONS="kernel.txz base.txz"
   	RELEASE="10.1"
   	NONINTERACTIVE="YES"

   	#!/bin/sh
   	echo "Installation complete, running in host system"

Anything obvious I am doing wrong? Or even the not-so-obvious would be 
welcome :-)

Rgds,
Claus


More information about the freebsd-stable mailing list