269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# CDDL HEADER START
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# The contents of this file are subject to the terms of the
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# Common Development and Distribution License (the "License").
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# You may not use this file except in compliance with the License.
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# See the License for the specific language governing permissions
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# and limitations under the License.
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# When distributing Covered Code, include this CDDL HEADER in each
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# If applicable, add the following below this CDDL HEADER, with the
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# fields enclosed by brackets "[]" replaced with your own identifying
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# information: Portions Copyright [yyyy] [name of copyright owner]
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# CDDL HEADER END
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
269f47de02761bab3b7b28e2007a2bac34f629ccThuy FettigHALFDI=/etc/hal/fdi/policy/30user/90-solaris-device-allocation.fdi
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# dev_allocation_convert
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# All the real work gets done in this function
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# If allocation already configured, just return
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettigif [ -f ${HALFDI} -a -f ${DEVALLOC} -a -f ${DEVMAPS} ]; then
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# Prevent automount of removable and hotpluggable volume
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# by forcing volume.ignore HAL property on all such volumes.
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettigif [ ! -f ${HALFDI} ]; then
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig<?xml version="1.0" encoding="UTF-8"?>
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig<deviceinfo version="0.2">
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig <match key="info.capabilities" contains="volume">
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig <match key="@block.storage_device:storage.removable" bool="true">
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig <merge key="volume.ignore" type="bool">true</merge>
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig <match key="@block.storage_device:storage.hotpluggable" bool="true">
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig <merge key="volume.ignore" type="bool">true</merge>
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig</deviceinfo>
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# Initialize device allocation
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# Need to determine if Trusted Extensions is enabled.
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# Check the setting in etc/system (other methods won't work
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig# because TX is likely not yet fully active.)
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettigif [ $? = 0 ]; then
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig # Trusted Extensions is enabled (but possibly not yet booted).
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig if [ ! -f ${DEVALLOC} ]; then
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig if [ ! -f ${DEVMAPS} ]; then
269f47de02761bab3b7b28e2007a2bac34f629ccThuy Fettig # Restore default policy for removable and hotpluggable volumes