boot-archive-update.ksh revision 58091fd8689db902780a10667e0e8118a9454b8f
58091fd8689db902780a10667e0e8118a9454b8fsetje#!/sbin/sh
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje# CDDL HEADER START
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje# The contents of this file are subject to the terms of the
58091fd8689db902780a10667e0e8118a9454b8fsetje# Common Development and Distribution License (the "License").
58091fd8689db902780a10667e0e8118a9454b8fsetje# You may not use this file except in compliance with the License.
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
58091fd8689db902780a10667e0e8118a9454b8fsetje# or http://www.opensolaris.org/os/licensing.
58091fd8689db902780a10667e0e8118a9454b8fsetje# See the License for the specific language governing permissions
58091fd8689db902780a10667e0e8118a9454b8fsetje# and limitations under the License.
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje# When distributing Covered Code, include this CDDL HEADER in each
58091fd8689db902780a10667e0e8118a9454b8fsetje# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
58091fd8689db902780a10667e0e8118a9454b8fsetje# If applicable, add the following below this CDDL HEADER, with the
58091fd8689db902780a10667e0e8118a9454b8fsetje# fields enclosed by brackets "[]" replaced with your own identifying
58091fd8689db902780a10667e0e8118a9454b8fsetje# information: Portions Copyright [yyyy] [name of copyright owner]
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje# CDDL HEADER END
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
58091fd8689db902780a10667e0e8118a9454b8fsetje# Use is subject to license terms.
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetje# ident "%Z%%M% %I% %E% SMI"
58091fd8689db902780a10667e0e8118a9454b8fsetje
58091fd8689db902780a10667e0e8118a9454b8fsetje. /lib/svc/share/smf_include.sh
58091fd8689db902780a10667e0e8118a9454b8fsetje. /lib/svc/share/fs_include.sh
58091fd8689db902780a10667e0e8118a9454b8fsetje
58091fd8689db902780a10667e0e8118a9454b8fsetjeUPDATEFILE=/etc/svc/volatile/boot_archive_needs_update
58091fd8689db902780a10667e0e8118a9454b8fsetje
58091fd8689db902780a10667e0e8118a9454b8fsetjesmf_is_globalzone || exit $SMF_EXIT_OK
58091fd8689db902780a10667e0e8118a9454b8fsetje
58091fd8689db902780a10667e0e8118a9454b8fsetje# no boot-archive on sparc...yet
58091fd8689db902780a10667e0e8118a9454b8fsetje#
58091fd8689db902780a10667e0e8118a9454b8fsetjeif [ `uname -p` = "sparc" ]; then
58091fd8689db902780a10667e0e8118a9454b8fsetje exit $SMF_EXIT_OK
58091fd8689db902780a10667e0e8118a9454b8fsetjefi
58091fd8689db902780a10667e0e8118a9454b8fsetje
58091fd8689db902780a10667e0e8118a9454b8fsetje# get rid of transient reboot entry in GRUB menu
58091fd8689db902780a10667e0e8118a9454b8fsetjeif [ -f /stubboot/boot/grub/menu.lst ]; then
58091fd8689db902780a10667e0e8118a9454b8fsetje /sbin/bootadm -m update_temp -R /stubboot
58091fd8689db902780a10667e0e8118a9454b8fsetjeelse
58091fd8689db902780a10667e0e8118a9454b8fsetje /sbin/bootadm -m update_temp
58091fd8689db902780a10667e0e8118a9454b8fsetjefi
58091fd8689db902780a10667e0e8118a9454b8fsetje
58091fd8689db902780a10667e0e8118a9454b8fsetjeif [ -f $UPDATEFILE ] || [ -f /reconfigure ]; then
58091fd8689db902780a10667e0e8118a9454b8fsetje /usr/sbin/rtc -c > /dev/null 2>&1
58091fd8689db902780a10667e0e8118a9454b8fsetje /sbin/bootadm update-archive
58091fd8689db902780a10667e0e8118a9454b8fsetje rm -f $UPDATEFILE
58091fd8689db902780a10667e0e8118a9454b8fsetjefi
58091fd8689db902780a10667e0e8118a9454b8fsetje
58091fd8689db902780a10667e0e8118a9454b8fsetjeexit $SMF_EXIT_OK