#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
"""
System firmware backend support for pybootmgmt
"""
import sys
"""Returns an instance of bootinfo.SystemFirmware corresponding to the
firmware name passed in. If fw_name is None, the system firmware type
is autodetected and the appropriate child of SystemFirmware is returned
"""
if fw_name is None:
# If this is a SPARC system, the appropriate class is obp
if curarch == 'sparc':
elif curarch == 'x86':
# If this is an x86 system and the efi-systype property exists,
# then this is a UEFI system and the property value specifies the
# bit width.
try:
except IOError as e:
# Problem while trying to get the property
# Set efisystype to None to force BIOS
efisystype = None
if efisystype is None:
else:
else:
raise BootmgmtUnsupportedPlatformError('Unknown platform '
'"%s"' % curarch)
else: