#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
#
#
# mksavedir
# Make sure that $DUMPADM_SAVDIR is set and exists.
#
mksavedir ()
{
}
#
# We haven't run savecore on a dump device yet
#
#
# If we previously crashed early in boot before dumpadm was used to configure
# an alternate dump device, then the dump is in the primary swap partition,
# which was configured as the dump device by the first swapadd early in boot.
# Thus before we run dumpadm to configure the dump device, we first run
# savecore to check the swap partition for a dump; this is run in the
# foreground to reduce the chances of overwriting the dump.
#
# This does not apply for zfs root systems that use a zvol for dump;
# for such systems the dedicated dump device is appointed during startup
# of the filesystem/usr:default instance before any swap is added.
# Therefore we must check that the dump device is a swap device here -
# if not then we'll run savecore here in the foreground and prevent
# our dependent services coming online until we're done.
#
fi
fi
fi
shift $#
else
#
# dumpadm -n is in effect, but we can still run savecore
# to raise an event with initial panic detail extracted
# from the dump header.
#
fi
fi
fi
#
# Now run dumpadm to configure the dump device based on the settings
# previously saved by dumpadm. See dumpadm(1m) for instructions on
# how to modify the dump settings.
#
else
exit $SMF_EXIT_ERR_CONFIG
fi
if [ -r /etc/dumpadm.conf ]; then
. /etc/dumpadm.conf
else
echo "WARNING: /etc/dumpadm.conf is missing or unreadable" >& 2
exit $SMF_EXIT_ERR_CONFIG
fi
#
# If the savecore executable is absent then we're done
#
exit $SMF_EXIT_ERR_CONFIG
fi
#
# because the dump device may have changed. If the earlier savecore had
# saved the dump, savecore will just exit immediately.
#
isswap=0
isswap=1
if [ "x$savedev" != "x$DUMPADM_DEVICE" ]; then
fi
fi
if [ "x$DUMPADM_ENABLE" != xno ]; then
#
# If the dump device is part of swap, we only need to run
# savecore a second time if the device is different from the
# swap device on which we initially ran savecore.
#
fi
else
#
# The dump device couldn't have been dedicated before we
# ran dumpadm, so we must execute savecore again.
#
fi
else
#
# savecore not enabled. Check whether a valid dump is
# present on the device and raise an event to signal that,
# but avoid sending a duplicate event from the savecore -c
# earlier.
#
fi
fi
exit $SMF_EXIT_OK