xref: /titanic_52/usr/src/cmd/boot/scripts/boot-archive-update.ksh (revision 58091fd8689db902780a10667e0e8118a9454b8f)
1*58091fd8Ssetje#!/sbin/sh
2*58091fd8Ssetje#
3*58091fd8Ssetje# CDDL HEADER START
4*58091fd8Ssetje#
5*58091fd8Ssetje# The contents of this file are subject to the terms of the
6*58091fd8Ssetje# Common Development and Distribution License (the "License").
7*58091fd8Ssetje# You may not use this file except in compliance with the License.
8*58091fd8Ssetje#
9*58091fd8Ssetje# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*58091fd8Ssetje# or http://www.opensolaris.org/os/licensing.
11*58091fd8Ssetje# See the License for the specific language governing permissions
12*58091fd8Ssetje# and limitations under the License.
13*58091fd8Ssetje#
14*58091fd8Ssetje# When distributing Covered Code, include this CDDL HEADER in each
15*58091fd8Ssetje# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*58091fd8Ssetje# If applicable, add the following below this CDDL HEADER, with the
17*58091fd8Ssetje# fields enclosed by brackets "[]" replaced with your own identifying
18*58091fd8Ssetje# information: Portions Copyright [yyyy] [name of copyright owner]
19*58091fd8Ssetje#
20*58091fd8Ssetje# CDDL HEADER END
21*58091fd8Ssetje#
22*58091fd8Ssetje#
23*58091fd8Ssetje# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24*58091fd8Ssetje# Use is subject to license terms.
25*58091fd8Ssetje#
26*58091fd8Ssetje# ident	"%Z%%M%	%I%	%E% SMI"
27*58091fd8Ssetje
28*58091fd8Ssetje. /lib/svc/share/smf_include.sh
29*58091fd8Ssetje. /lib/svc/share/fs_include.sh
30*58091fd8Ssetje
31*58091fd8SsetjeUPDATEFILE=/etc/svc/volatile/boot_archive_needs_update
32*58091fd8Ssetje
33*58091fd8Ssetjesmf_is_globalzone || exit $SMF_EXIT_OK
34*58091fd8Ssetje
35*58091fd8Ssetje# no boot-archive on sparc...yet
36*58091fd8Ssetje#
37*58091fd8Ssetjeif [ `uname -p` = "sparc" ]; then
38*58091fd8Ssetje        exit $SMF_EXIT_OK
39*58091fd8Ssetjefi
40*58091fd8Ssetje
41*58091fd8Ssetje# get rid of transient reboot entry in GRUB menu
42*58091fd8Ssetjeif [ -f /stubboot/boot/grub/menu.lst ]; then
43*58091fd8Ssetje	/sbin/bootadm -m update_temp -R /stubboot
44*58091fd8Ssetjeelse
45*58091fd8Ssetje	/sbin/bootadm -m update_temp
46*58091fd8Ssetjefi
47*58091fd8Ssetje
48*58091fd8Ssetjeif [ -f $UPDATEFILE ] || [ -f /reconfigure ]; then
49*58091fd8Ssetje	/usr/sbin/rtc -c > /dev/null 2>&1
50*58091fd8Ssetje	/sbin/bootadm update-archive
51*58091fd8Ssetje	rm -f $UPDATEFILE
52*58091fd8Ssetjefi
53*58091fd8Ssetje
54*58091fd8Ssetjeexit $SMF_EXIT_OK
55