[SOLVED][BUG??] Unattended install using bsdinstall and ZFS

Patrick M. Hausen hausen at punkt.de
Wed Jul 29 07:54:16 UTC 2015


Hi, Claus,

> Am 29.05.2015 um 19:17 schrieb Claus Andersen <clan at wheel.dk>:
> 
> 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:
> [...]
> 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..."

Thanks for your detailled report. I can confirm your findings and I was able to do an unattended install using these settings:

DISTRIBUTIONS="base.txz doc.txz games.txz kernel.txz lib32.txz"
INTERFACES="em0"
export ZFSBOOT_DISKS="da0 da1"
export ZFSBOOT_VDEV_TYPE="mirror"
export ZFSBOOT_FORCE_4K_SECTORS="1"
export ZFSBOOT_SWAP_SIZE="8g"
export ZFSBOOT_SWAP_MIRROR="1"
export ZFSBOOT_POOL_CREATE_OPTIONS="-O compress=lz4 -O checksum=fletcher4"
export nonInteractive="YES"

Yet, there are still 2 things that prevent a truly unattended installation. First, at least for me,
the installer alway displays a dialog with debug messages which needs to be explicitly
confirmed at the end of the installation. This is not the case if I use UFS. With UFS it just
reboots into the freshly installed system.

I could work around that one by explicitly calling "reboot" at the end of the shell script
part of installerconfig.

Second, if you do remote installation via IPMI and serial console over IP, the standard install
environment copied from CD calls this code in /etc/rc.local:

[...]
else
    # Serial or other console
    echo
    echo "Welcome to FreeBSD!"
    echo
    echo "Please choose the appropriate terminal type for your system."
    echo "Common console types are:"
    echo "   ansi     Standard ANSI terminal"
    echo "   vt100    VT100 or compatible terminal"
    echo "   xterm    xterm terminal emulator (or compatible)"
    echo "   cons25w  cons25w terminal"
    echo
    echo -n "Console type [vt100]: "
    read TERM
    TERM=${TERM:-vt100}
fi 

IMHO hardwiring this is not a good idea. Can be solved by simply commenting out the unwanted
parts, but this should be configurable in installerconfig. Currently it quite defeats the purpose of
*unattended* installations. At least I expect "power on, get some coffee, login via ssh into newly
installed system" ;-)

Kind regards
Patrick M. Hausen
Leiter Netzwerke und Sicherheit
-- 
punkt.de GmbH * Kaiserallee 13a * 76133 Karlsruhe
Tel. 0721 9109 0 * Fax 0721 9109 100
info at punkt.de       http://www.punkt.de
Gf: Jürgen Egeling      AG Mannheim 108285





More information about the freebsd-stable mailing list