Solved Set terminal type during unattended install?

I repackaged a 10.3-RELEASE installer, and added etc/installerconfig.

The preamble section looks like this:
Code:
PARTITIONS=vtbd0
DISTRIBUTIONS="kernel.txz base.txz"

I'm able to use bhyve to boot into the installer, and the process executes automatically, as expected. The only issue is that I need to manually enter the terminal type before the installer will begin.

I was unable to find a solution to this in the bsdinstall manpages or through a few hours of fruitless searching. There's got to be a way to do this, right?
 
I actually modified my FreeBSD USB memstick installer to load serial console. So i can install over terminal.

/boot/loader.conf

Code:
boot_multicons="YES"
boot_serial="YES"
comconsole_speed="115200"
console="comconsole,vidconsole"
 
I threw a bunch of off topic serial port stuff up and need to clarify. You want to check installer /etc/ttys for this:

ttyv0 "/usr/libexec/getty Pc" vt100 on secure

My installer stick has xterm as the ttyv0 terminal type. I am assuming you need to change that.
 
Sorry, rereading my question, and it wasn't very clear at all. I blame late night and hours of bashing head against desk.

I'm trying to do this:
Code:
sh /usr/share/examples/bhyve/vmrun.sh -c 2 -m 8192m -d /usr/local/vms/guest.img -i -I /usr/local/vms/new.iso guest

Where new.iso is a repackaged FreeBSD-10.3-RELEASE-amd64-dvd1.iso, with an added etc/installerconfig file.

I want to run that command, go get some coffee, and come back to a fully-installed system.

It works for the most part, but only after I've manually pressed enter to accept the default at the following screen.

Code:
Welcome to FreeBSD!

Please choose the appropriate terminal type for your system.
Common console types are:
   ansi     Standard ANSI terminal
   vt100    VT100 or compatible terminal
   xterm    xterm terminal emulator (or compatible)
   cons25w  cons25w terminal

Console type [vt100]:

I assumed there'd be an environment variable I could set in the preamble section of installerconfig to just set a default console type, but I haven't been able to find any such thing. Once I've got it all figured out it'll get plugged into a VM creation framework I've yet to find/devise, so a hands-off install ala Kickstart is required.
 
In etc/rc.local:

Code:
kbdcontrol -d >/dev/null 2>&1
if [ $? -eq 0 ]; then
   # Syscons: use xterm, start interesting things on other VTYs
   if [ ${MACHINE} = "pc98" ]; then
       TERM=cons25w
   else
       TERM=xterm
   fi

   # Don't send ESC on function-key 62/63 (left/right command key)
   kbdcontrol -f 62 '' > /dev/null 2>&1
   kbdcontrol -f 63 '' > /dev/null 2>&1

   if [ -z "$EXTERNAL_VTY_STARTED" ]; then
       # Init will clean these processes up if/when the system
       # goes multiuser
       touch /tmp/bsdinstall_log
       tail -f /tmp/bsdinstall_log > /dev/ttyv2 &
       /usr/libexec/getty autologin ttyv3 &
       EXTERNAL_VTY_STARTED=1
   fi
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
export TERM

I did try setting TERM=vt100 in installerconfig, but it had no effect because the above block executes before installerconfig is checked. I 'could' just remove it from rc.local.

kbdcontrol -d results in

Code:
kbdcontrol: getting keymap: Inappropriate ioctl for device
 
That worked, good enough for me.

Code:
[root@aman /usr/local/vms]# diff tmp/etc/rc.local unpackaged/etc/rc.local
16,53c16
< kbdcontrol -d >/dev/null 2>&1
< if [ $? -eq 0 ]; then
<    # Syscons: use xterm, start interesting things on other VTYs
<    if [ ${MACHINE} = "pc98" ]; then
<        TERM=cons25w
<    else
<        TERM=xterm
<    fi
<
<    # Don't send ESC on function-key 62/63 (left/right command key)
<    kbdcontrol -f 62 '' > /dev/null 2>&1
<    kbdcontrol -f 63 '' > /dev/null 2>&1
<
<    if [ -z "$EXTERNAL_VTY_STARTED" ]; then
<        # Init will clean these processes up if/when the system
<        # goes multiuser
<        touch /tmp/bsdinstall_log
<        tail -f /tmp/bsdinstall_log > /dev/ttyv2 &
<        /usr/libexec/getty autologin ttyv3 &
<        EXTERNAL_VTY_STARTED=1
<    fi
< 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
< export TERM
---
> export TERM=vt100
 
Back
Top