17c478bd9Sstevel@tonic-gate#!/sbin/sh 27c478bd9Sstevel@tonic-gate# 37c478bd9Sstevel@tonic-gate# CDDL HEADER START 47c478bd9Sstevel@tonic-gate# 57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 67c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 77c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 87c478bd9Sstevel@tonic-gate# with the License. 97c478bd9Sstevel@tonic-gate# 107c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 117c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 127c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 137c478bd9Sstevel@tonic-gate# and limitations under the License. 147c478bd9Sstevel@tonic-gate# 157c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 167c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 177c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 187c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 197c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 207c478bd9Sstevel@tonic-gate# 217c478bd9Sstevel@tonic-gate# CDDL HEADER END 227c478bd9Sstevel@tonic-gate# 237c478bd9Sstevel@tonic-gate# 247c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 257c478bd9Sstevel@tonic-gate# Use is subject to license terms. 267c478bd9Sstevel@tonic-gate# 277c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate. /lib/svc/share/smf_include.sh 307c478bd9Sstevel@tonic-gate. /lib/svc/share/fs_include.sh 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate# 337c478bd9Sstevel@tonic-gate# no boot-archive on sparc...yet 347c478bd9Sstevel@tonic-gate# 357c478bd9Sstevel@tonic-gateif [ `uname -p` = "sparc" ]; then 367c478bd9Sstevel@tonic-gate exit $SMF_EXIT_OK 377c478bd9Sstevel@tonic-gatefi 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate# 407c478bd9Sstevel@tonic-gate# Check the boot archive content against root filesystem. 417c478bd9Sstevel@tonic-gate# Return failure if they differ. 427c478bd9Sstevel@tonic-gate# 437c478bd9Sstevel@tonic-gateif [ "${_INIT_ZONENAME:=`/sbin/zonename`}" != "global" ]; then 447c478bd9Sstevel@tonic-gate exit $SMF_EXIT_OK 457c478bd9Sstevel@tonic-gatefi 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate# 487c478bd9Sstevel@tonic-gate# Make sure we return failure only once. If user choose to ignore 497c478bd9Sstevel@tonic-gate# error, we return success to permit boot to continue. The boot 507c478bd9Sstevel@tonic-gate# archive will be updated on the subsequent shutdown. 517c478bd9Sstevel@tonic-gate# 527c478bd9Sstevel@tonic-gateERRORFILE=/etc/svc/volatile/boot_archive_error 537c478bd9Sstevel@tonic-gateif [ -f "${ERRORFILE}" ]; then 547c478bd9Sstevel@tonic-gate rm ${ERRORFILE} 557c478bd9Sstevel@tonic-gate exit $SMF_EXIT_OK 567c478bd9Sstevel@tonic-gatefi 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate# 597c478bd9Sstevel@tonic-gate# Now check the archive. 607c478bd9Sstevel@tonic-gate# 61*8c1b6884Sszhou/sbin/bootadm update-archive -vnC 2> /dev/null 627c478bd9Sstevel@tonic-gateif [ $? = 0 ]; then 637c478bd9Sstevel@tonic-gate exit $SMF_EXIT_OK 647c478bd9Sstevel@tonic-gatefi 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gatetouch ${ERRORFILE} 677c478bd9Sstevel@tonic-gatececho "" 687c478bd9Sstevel@tonic-gatececho "WARNING - The following files in / differ from the boot archive:" 697c478bd9Sstevel@tonic-gate 70*8c1b6884Sszhou/sbin/bootadm update-archive -vnC > /dev/msglog 2> /dev/null 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gatececho "The recommended action is to reboot and select \"Solaris failsafe\"" 737c478bd9Sstevel@tonic-gatececho "option from the boot menu. Then follow prompts to update the" 747c478bd9Sstevel@tonic-gatececho "boot archive." 757c478bd9Sstevel@tonic-gatececho "To continue booting at your own risk, clear the service:" 767c478bd9Sstevel@tonic-gatececho " # svcadm clear system/boot-archive" 777c478bd9Sstevel@tonic-gatececho "" 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gateexit $SMF_EXIT_ERR_FATAL 80