home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.jcu.edu.au
/
2014.06.ftp.jcu.edu.au.tar
/
ftp.jcu.edu.au
/
v6.3.2b
/
SWBD63
/
fabos-6.3.2b-10.ppc.rpm
/
fabos-6.3.2b.10.cpio.gz
/
fabos-6.3.2b.10.cpio
/
fabos
/
libexec
/
fastbootenv
< prev
next >
Wrap
Text File
|
2010-11-10
|
2KB
|
97 lines
#!/bin/sh
#
# Copyright (c) 2003-2005 Brocade Communications Systems, Inc.
# All rights reserved.
#
# Set (and reset) env for faster boot
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/fabos/sbin:/fabos/bin
#
# main
#
case "$1" in
'fast')
cur=`bootenv BootTest 2>/dev/null`
if [ ! -z "${cur}" ] ; then
# Save previous setting so we can restore later.
/sbin/bootenv FastBootTest "${cur}" > /dev/null 2>&1
# Then delete.
/sbin/bootenv -u BootTest > /dev/null 2>&1
fi
cur=`bootenv InitTest 2>/dev/null`
if [ ! -z "${cur}" ] ; then
# Save previous setting so we can restore later.
/sbin/bootenv FastInitTest "${cur}" > /dev/null 2>&1
/sbin/bootenv -u InitTest > /dev/null 2>&1
fi
al=`bootenv AutoLoadTimeout 2>/dev/null`
if [ $? != 0 -o X${al} != X0 ]; then
/sbin/bootenv AutoLoadTimeout 0
fi
# quiet added to OSLoadOptions in kernel.spec.in. and here too
OPT="$(echo $(cat /boot/extra_boot_opts 2>/dev/null) quiet)"
bootenv OSLoadOptions "$OPT;$OPT"
;;
'regular')
# restore saved InitTest setting.
cur=`bootenv FastInitTest 2>/dev/null`
if [ -z "${cur}" ] ; then
nv="MEM()"
else
nv=${cur}
fi
it=`bootenv InitTest 2>/dev/null`
if { [ $? != 0 ] || [ -z "${it}" ] ; }
then
/sbin/bootenv InitTest "${nv}"
fi
# Wipe setting after InitTest is restored.
if [ ! -z "${cur}" ] ; then
/sbin/bootenv -u FastInitTest > /dev/null 2>&1
fi
# restore saved BootTest setting.
cur=`bootenv FastBootTest 2>/dev/null`
# No default
if [ ! -z "${cur}" ] ; then
it=`bootenv BootTest 2>/dev/null`
if { [ $? != 0 ] || [ -z "${it}" ] ; }
then
/sbin/bootenv BootTest "${cur}"
fi
# Wipe setting after InitTest is restored.
/sbin/bootenv -u FastBootTest > /dev/null 2>&1
fi
# Do not enable PROM if FIPS requires it
fips=$(cat /etc/fabos/pwron_fips_status 2>/dev/null)
if [ -z "$fips" -o "$fips" = "0" ] ; then
if bootenv AutoLoadTimeout >/dev/null 2>&1; then
/sbin/bootenv -u AutoLoadTimeout > /dev/null 2>&1
fi
fi
if [ ! -e /etc/fabos/lo/persistent ]
then
rm -f /var/log/fsslo.data
fi
;;
*)
echo "Usage: $0 {fast | regular}"
;;
esac