import less(1)
[unleashed/tickless.git] / usr / src / lib / efcode / etc / efcode.cleanup.sh
blob5d422601e8e8a45d229cb849bdac68191b418285
1 #! /usr/bin/sh
3 # CDDL HEADER START
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.
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.
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]
20 # CDDL HEADER END
23 # ident "%Z%%M% %I% %E% SMI"
25 # Copyright 2007 Sun Microsystems, Inc. All rights reserved.
26 # Use is subject to license terms.
28 # Efcode cleanup
29 # Disable efdaemon on target systems not supporting Embedded Fcode Interpreter
30 # Enable efdaemon on target systems supporting Embedded Fcode Interpreter
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.
36 ARCH=`/usr/bin/uname -m`
39 # arch == sun4u
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
46 if [ `/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
49 else
50 echo "/usr/sbin/svcadm disable /platform/${ARCH}/efdaemon:default" >> \
51 ${FLASH_ROOT}/var/svc/profile/upgrade