Commit 5ada29d7 authored by Mike Hibler's avatar Mike Hibler
Browse files

More fixups based on first try in frisbee MFS.

More removal of hardwired paths in favor of paths.sh vars.
Included script getfromtb.sh does not exist.
touch and env do not exist in MFS.
Use tmcc, not tmcc.bin.
Create /etc/emulab/ismfs as frisbee MFS doesn't have it.
parent adc7c1ef
......@@ -62,8 +62,8 @@ declare host #emulab hostname
declare failed="" #major falure to be commicated to user
declare os="" #[Linux|FreeBSD] for now
declare -a todo_exit
declare -A hwinv # hwinv from tmcc.bin
declare -A hwinvcopy # a copy of hwinv from tmcc.bin
declare -A hwinv # hwinv from tmcc
declare -A hwinvcopy # a copy of hwinv from tmcc
#declare -A tcm_out # hwinv for output
......@@ -88,7 +88,7 @@ trap 'err_report $LINENO' ERR
# read info from tmcc no args uses the globel array hwinv
# if $1 then use that for a input file else use tmcc.bin
# if $1 then use that for a input file else use tmcc
readtmcinfo() {
local -A ina
local keyword
......@@ -99,10 +99,10 @@ readtmcinfo() {
ifile=${1+$1} # use $1 if set otherwise use nothing
if [ -z "$ifile" ] ; then
# noinput file then use a tmp file to hold data from tmcc.bin
# noinput file then use a tmp file to hold data from tmcc
itmp="y"
ifile=/tmp/.$$tmcchwinv
$(/usr/local/etc/emulab/tmcc.bin hwinfo > $ifile)
$($BINDIR/tmcc hwinfo > $ifile)
else
itmp=""
fi
......@@ -419,8 +419,9 @@ printhwinv() {
# which is not in busybox and not a bash builtin
which() {
mypath=$(env | grep PATH)
mypath=${mypath/PATH=/}
#mypath=$(env | grep PATH)
#mypath=${mypath/PATH=/}
mypath=$PATH
mypath=${mypath//:/ }
for i in $mypath ; do
if [ -e $i/$1 ] ; then
......@@ -437,17 +438,17 @@ inithostname() {
echo "ERROR uname messed up"
exit 1
fi
if [ -e "/usr/local/etc/emulab/tmcc.bin" ] ; then
host=$(/usr/local/etc/emulab/tmcc.bin nodeid)
if [ -e "$BINDIR/tmcc" ] ; then
host=$($BINDIR/tmcc nodeid)
else
echo "ERROR no tmcc.bin command"
echo "ERROR no tmcc command"
exit 1
fi
if [ -z "$host" ] ; then
if [ -e "/var/emulab/boot/realname" ] ; then
host=$(cat /var/emulab/boot/realname)
elif [ -e "/var/emulab/boot/nodeid" ] ; then
host=$(cat /var/emulab/boot/nodeid)
if [ -e "$BOOTDIR/realname" ] ; then
host=$(cat $BOOTDIR/realname)
elif [ -e "$BOOTDIR/nodeid" ] ; then
host=$(cat $BOOTDIR/nodeid)
else
host=$(hostname)
fi
......@@ -497,14 +498,14 @@ initlogs () {
# start XXX XXX should be "" when in production
# logfile4tb=${2-""}
logfile4tb=${2-"/tmp/nodecheck.log.tb"}
touch ${logfile4tb}
cp /dev/null ${logfile4tb}
# end XXX XXX
tmplog=/tmp/.$$tmp.log ; cat /dev/null > ${tmplog} # create and truncate
add_on_exit "rm -f $tmplog"
logout=/tmp/.$$logout.log ; touch ${logout} # make it exist
logout=/tmp/.$$logout.log ; cp /dev/null ${logout} # make it exist
add_on_exit "rm -f $logout"
tmpout=/tmp/.$$tmpout.log ; touch ${tmpout}
tmpout=/tmp/.$$tmpout.log ; cp /dev/null ${tmpout}
add_on_exit "rm -f $tmpout"
# tmpfunctionout=/tmp/.$$tmpfunctionout.log
......
......@@ -25,7 +25,12 @@
echo -n ' Cpucheck..'
source checkutils.sh
source getfromtb.sh
#source getfromtb.sh
if [ -z "$BOOTDIR" ]
then
BOOTDIR=/var/emulab/boot
fi
declare arch="" failed="" s=""
declare -i sockets=0 cores_socket=0 threads_core=0 mhz=0 err=0
......@@ -33,8 +38,8 @@ declare -i hyperthread=0 x64bit=0 hwvirt=0
os=`uname`
host=`hostname`
if [ -e "/var/emulab/boot/realname" ]; then
host=`cat /var/emulab/boot/realname`
if [ -e "$BOOTDIR/realname" ]; then
host=`cat $BOOTDIR/realname`
fi
### setup logging
......
......@@ -85,7 +85,7 @@ set +e
{ printhwinv
} > /tmp/nodecheck.log.inv
host=$($BINDIR/tmcc.bin nodeid)
host=$($BINDIR/tmcc nodeid)
# make sure proj got mounted
if [ ! -d $PROJDIR ] ; then
echo "OHhh all this work for nothing"
......@@ -104,7 +104,7 @@ set +e
$(chmod g+rw $PROJDIR/nodecheck/$host $PROJDIR/nodecheck/FullInventory/$host);
# Test what found local against what is in the database
readtmcinfo # info from tmcc.bin hwinv
readtmcinfo # info from tmcc hwinv
# for testing readtmcinfo $PROJDIR/nodecheck/test
copytmcinfo # copy into hwinvcopy
readtmcinfo /tmp/nodecheck.log.tb.new # read local found into hwinv
......
......@@ -31,7 +31,7 @@ _32KGiB=33554432
echo -n ' Starting memcheck..'
source checkutils.sh
source getfromtb.sh
#source getfromtb.sh
source hbis.sh
declare failed="" s=""
......
......@@ -29,7 +29,7 @@ source checkutils.sh
inithostname
initlogs $@
tmplog2=/tmp/.2tmp
touch ${tmplog2}
cp /dev/null ${tmplog2}
add_on_exit "rm -f $tmplog2"
......
......@@ -43,7 +43,7 @@ if [ $# -gt 1 -a "$2" = "gather" ]; then
checks="disk cpu mem nic gather"
fi
host=`$BINDIR/tmcc.bin nodeid`
host=`$BINDIR/tmcc nodeid`
# XXX MFSes don't have all the apps we need, so mount an extra directory
if [ -f "$ETCDIR/ismfs" ] ; then
......
......@@ -557,6 +557,9 @@ case $STATUS in
dd if=/dev/zero of=/dev/$d bs=512 count=16
done
# XXX rc.nodecheck expects this
cp /dev/null $ETCDIR/ismfs
# XXX tmp, gather HW info (including disk speed tests)
if [ -x $BINDIR/rc.nodecheck ]; then
$BINDIR/rc.nodecheck boot gather
......
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