xref: /titanic_41/usr/src/lib/efcode/etc/efcode.cleanup.sh (revision bf56214c0556fa6864189c826d39dbe156bb22a0)
1#! /usr/bin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# Efcode cleanup
29# Disable efdaemon on target systems not supporting Embedded Fcode Interpreter
30# Enable  efdaemon on target systems supporting Embedded Fcode Interpreter
31#
32# We may need to enable/disable the efdaemon services in SMF.  This could
33# happen if the system the flash was created on and the target system support
34# different hotplug implementations.
35#
36ARCH=`/usr/bin/uname -m`
37
38#
39# arch == sun4u
40#
41# Not all sun4u platforms support efcode.
42# Daemon support is based upon finding the
43# "pcicfg.e (PCIe/PCI Config (EFCode Enabled)"
44# module in the modinfo output
45#
46if [ `/usr/sbin/modinfo | /usr/bin/grep -c pcicfg` != "0" ]; then
47	echo "/usr/sbin/svcadm enable /platform/${ARCH}/efdaemon:default" >> \
48	    ${FLASH_ROOT}/var/svc/profile/upgrade
49else
50	echo "/usr/sbin/svcadm disable /platform/${ARCH}/efdaemon:default" >> \
51	    ${FLASH_ROOT}/var/svc/profile/upgrade
52fi
53