インストーラ・メディアでは/etc/rc.localで
if [ -f /etc/installerconfig ]; then if bsdinstall script /etc/installerconfig; then dialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel \ --ok-label "Reboot" --pause "Installation of FreeBSD complete! \ Rebooting in 10 seconds" 10 30 10 reboot else dialog --backtitle "FreeBSD Installer" --title "Error" --textbox \ /tmp/bsdinstall_log 0 0 fi exit fi
となってるので,*.imgの中の/etc/installerconfigにbsdinstall(8)のSCRIPTINGを書けばインストールをバッチ処理できる.
/usr/sbin/bsdinstallでは
: (snip) : while getopts $GETOPTS_STDARGS ignored; do : just skipping known flags done shift $(( $OPTIND - 1 )) # What are we here to do? VERB="${1:-auto}"; shift : (snip) : if [ "$debug" ]; then case "$debugFile" in # If NULL, send errors to the bit-bucket "") exec "/usr/libexec/bsdinstall/$VERB" "$@" 2> /dev/null ;; # If begins with `+', send errors to both terminal and file (no `+') +*) exec "/usr/libexec/bsdinstall/$VERB" "$@" \ 2>&1 >&$TERMINAL_STDOUT_PASSTHRU | tee "${debugFile#+}" ;; # Otherwise, just send errors to the file specified *) exec "/usr/libexec/bsdinstall/$VERB" "$@" 2>> "$debugFile" esac else exec "/usr/libexec/bsdinstall/$VERB" "$@" 2> /dev/null fi
なので,"/usr/libexec/bsdinstall/script /etc/installerconfig"が実行されることになる