#
# 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
#
#
"""
ChainBootInstance autogenerator backend for pybootmgmt
"""
"""Autogenerator implementation for ChainDiskBootInstance generation.
This implementation invokes a helper script that scans the system's
disks for OS instances that can be chainloaded, then outputs information
in an easily-parseable format.
"""
"The workhorse of the autogenerator"
raise BootmgmtUnsupportedOperationError('Chain loader autogen '
'not supported on non-disk BootConfigs')
if cur_fw is not None:
else:
cur_fw_name = None
# This is only supported on x86 BIOS:
'x86 BIOS')
return []
try:
helper_cmd = ['/usr/lib/boot/bootmgmt-helper-chain']
return []
except CalledProcessError as cpe:
return []
inst_list = []
lineno = 0
lineno += 1
continue
try:
# partition can be empty, an int or a comma-separated list of
# strings
else:
else:
partition = None
except ValueError:
continue
if partition is None:
chain_info = (disk,)
else:
return inst_list
"Main entry point used by the autogenerator factory"