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