#! /bin/sh
#
# Customize a nanoBSD flash image for serial console
#
# Copyright (c) 2004 Poul-Henning Kamp
#
# See /usr/share/examples/etc/bsd-style-copyright for license terms.
#
# $FreeBSD: stable/5/tools/tools/nanobsd/Customize/comconsole 142775 2005-02-28 10:01:45Z phk $
# 
# Usage:
#
# ${CUSTOMIZE} ${WD} ${WORLDDIR} ${.CURDIR} [ ${LOCAL_FILES_LIST} ]

WD=$1
WORLDDIR=$2
CURDIR=$3
LOCAL_FILES_LIST=$4

PKG_DBDIR=${WD}/var/db/pkg
export PKG_DBDIR

# Enable getty on console
sed -i "" -e /ttyd0/s/off/on/ ${WD}/etc/ttys

# Disable getty on syscons devices
sed -i "" -e '/^ttyv[0-8]/s/	on/	off/' ${WD}/etc/ttys

# Tell loader to use serial console early.
echo " -h" > ${WD}/boot.config
