boot-archive revision 6927f468b0af7710df000f6b16f6ee413e1e3007
320N/A#!/sbin/sh
320N/A#
320N/A# CDDL HEADER START
320N/A#
493N/A# The contents of this file are subject to the terms of the
320N/A# Common Development and Distribution License (the "License").
320N/A# You may not use this file except in compliance with the License.
320N/A#
320N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
320N/A# or http://www.opensolaris.org/os/licensing.
320N/A# See the License for the specific language governing permissions
320N/A# and limitations under the License.
320N/A#
320N/A# When distributing Covered Code, include this CDDL HEADER in each
320N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
320N/A# If applicable, add the following below this CDDL HEADER, with the
320N/A# fields enclosed by brackets "[]" replaced with your own identifying
320N/A# information: Portions Copyright [yyyy] [name of copyright owner]
320N/A#
320N/A# CDDL HEADER END
320N/A#
320N/A#
320N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
320N/A# Use is subject to license terms.
320N/A#
320N/A# ident "%Z%%M% %I% %E% SMI"
320N/A
320N/A#
320N/A# Check the boot archive content against root filesystem.
320N/A# Return failure if they differ.
320N/A#
320N/A
320N/A. /lib/svc/share/smf_include.sh
320N/A. /lib/svc/share/fs_include.sh
320N/A
493N/A#
320N/A# no boot-archive on sparc...yet
320N/A#
493N/Aif [ `uname -p` = "sparc" ]; then
320N/A exit $SMF_EXIT_OK
320N/Afi
320N/A
320N/Asmf_is_globalzone || exit $SMF_EXIT_OK
320N/A
320N/A#
493N/A# Make sure we return failure only once. If user choose to ignore
493N/A# error, we return success to permit boot to continue. The boot
320N/A# archive will be updated on the subsequent shutdown.
320N/A#
ERRORFILE=/etc/svc/volatile/boot_archive_error
if [ -f "${ERRORFILE}" ]; then
rm ${ERRORFILE}
exit $SMF_EXIT_OK
fi
#
# Now check the archive.
#
/sbin/bootadm update-archive -vnC 2> /dev/null
if [ $? = 0 ]; then
exit $SMF_EXIT_OK
fi
touch ${ERRORFILE}
cecho ""
cecho "WARNING - The following files in / differ from the boot archive:"
/sbin/bootadm update-archive -vnC > /dev/msglog 2> /dev/null
cecho "The recommended action is to reboot and select \"Solaris failsafe\""
cecho "option from the boot menu. Then follow prompts to update the"
cecho "boot archive."
cecho "To continue booting at your own risk, clear the service:"
cecho " # svcadm clear system/boot-archive"
cecho ""
exit $SMF_EXIT_ERR_FATAL