Commit 53d43153 authored by Mike Hibler's avatar Mike Hibler

Add a VGAONLY attribute to the post-frisbee customization.

This is for BSD, so that we can tweak the default /boot/loader.conf file
to turn off "comconsole" on machines that don't have a UART.
In my experience, trying to probe the UART on newer machines that don't
have one causes a kernel crash.

Currently this attribute is just signalled by the existance of the
/etc/testbed/isvgaonly file in the diskloader MFS. But this will be
eventually sent over via "tmcc loadinfo" so that we can set the attribute
on a per-node-type or per-node basis.
parent bde090d9
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
# Optional flag argument says "do not reboot"
......@@ -156,7 +156,9 @@ loadone() {
NOCLFLUSH=""
MBRVERS=""
PREPARE=""
VGAONLY=""
IMAGEID=""
for parm in $_LOADINFO; do
case $parm in
ADDR=*|\
......@@ -170,6 +172,7 @@ loadone() {
MBRVERS=*|\
ASF=*|\
PREPARE=*|\
VGAONLY=*|\
IMAGEID=*)
# XXX need to parse better, eval is dangerous!
eval $parm
......@@ -191,6 +194,7 @@ loadone() {
ACPI=${ACPI:-'unknown'}
ASF=${ASF:-'unknown'}
NOCLFLUSH=${NOCLFLUSH:-'unknown'}
VGAONLY=${VGAONLY:-'unknown'}
MBRVERS=${MBRVERS:-'1'}
PREPARE=${PREPARE:-'0'}
......@@ -428,6 +432,7 @@ loadone() {
export SLICEFIX_ACPI=$ACPI
export SLICEFIX_ASF=$ASF
export SLICEFIX_NOCLFLUSH=$NOCLFLUSH
export SLICEFIX_VGAONLY=$VGAONLY
$BINDIR/slicefix $PART $DISK
echo "Image #$_NUM load complete at `date`"
return 0
......
#!/bin/sh
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# All rights reserved.
#
......@@ -70,6 +70,24 @@ case $NOCLFLUSH in
;;
esac
VGAONLY=${SLICEFIX_VGAONLY:-'unknown'}
case $VGAONLY in
0|no|NO)
VGAONLY=no
;;
1|yes|YES)
VGAONLY=yes
;;
*)
# XXX check the MFS filesystem
if [ -r $ETCDIR/isvgaonly ]; then
VGAONLY=yes
else
VGAONLY=unknown
fi
;;
esac
#
# ...or the filesystem
#
......@@ -151,6 +169,7 @@ dofreebsd() {
changeacpi=0
changeasf=0
changeclflush=0
changecons=0
fixit=0
......@@ -247,6 +266,21 @@ dofreebsd() {
fixit=1
fi
#
# If node doesn't have a serial port, make sure comconsole is not set!
#
if [ $VGAONLY = "yes" ]; then
grep "^console=\"comconsole\"" /mnt/boot/loader.conf >/dev/null 2>&1
case $? in
0)
changecons=1
fixit=1
;;
*)
;;
esac
fi
# check to see if we need to download any postconfig scripts:
doosconfig=0
if [ -x $BINDIR/osconfig ]; then
......@@ -356,6 +390,19 @@ EOF2
fi
fi
#
# Remove console="comconsole"
#
if [ $changecons -eq 1 ]; then
echo " disabling comconsole"
sed -E -i $lcbak -e "/^console=\"comconsole\"/d" /mnt/boot/loader.conf || {
echo "Failed to update /boot/loader.conf"
umount $rootdev
return 1
}
lcbak=""
fi
#
# See if we need to change the use of NOCLFLUSH.
# If explicitly specified, we override any previous setting.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment