Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyipmi/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def chassis_control(self, option):
rsp = self.send_message(req)
check_completion_code(rsp.completion_code)

def set_boot_options(self, persistent_boot_option, boot_device):
def set_boot_options(self, bios_boot_type, persistent_boot_option, boot_device):
req = create_request_by_name('SetSystemBootOptions')
req.parameter_selector.boot_options = 5
req.parameter_selector.parameter_valid = 0
req.data_1.valid_flag = 1
# intersted field
req.data_1.persistent_boot_option = persistent_boot_option
req.data_1.bios_boot_efi = 0
req.data_1.bios_boot_type = bios_boot_type
req.data_3.ignore = 0
req.data_4.ignore = 0
req.data_5.ignore = 0
Expand Down
6 changes: 3 additions & 3 deletions pyipmi/integration_test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import sys
# insert at 1, 0 is the script path (or '' in REPL)
sys.path.insert(1, '/Users/srmppn/Desktop/python-ipmi/')
sys.path.insert(1, '/Users/bvnkwiz/Documents/python-ipmi/')
import pyipmi
import pyipmi.interfaces

from pyipmi.msgs.chassis import BOOT_OPTION_LEGACY, BOOT_OPTION_EFI, BOOT_DEVICE_PXE, BOOT_DEVICE_DISK
from pyipmi.msgs.chassis import BOOT_OPTION_LEGACY, BOOT_OPTION_EFI, BOOT_DEVICE_PXE, BOOT_DEVICE_DISK, NON_PERSISTENT_BOOT_OPTION

# Supported interface_types for ipmitool are: 'lan' , 'lanplus', and 'serial-terminal'
interface = pyipmi.interfaces.create_interface('ipmitool', interface_type='lan')
Expand All @@ -18,5 +18,5 @@
connection.session.establish()

device_id = connection.get_device_id()
connection.set_boot_options(persistent_boot_option = BOOT_OPTION_LEGACY, boot_device = BOOT_DEVICE_PXE)
connection.set_boot_options(bios_boot_type= BOOT_OPTION_LEGACY, persistent_boot_option = NON_PERSISTENT_BOOT_OPTION, boot_device = BOOT_DEVICE_PXE)
result = connection.chassis_control_hard_reset()
6 changes: 5 additions & 1 deletion pyipmi/msgs/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
BOOT_DEVICE_PXE = 1
BOOT_DEVICE_DISK = 3

# Persistent boot options
NON_PERSISTENT_BOOT_OPTION = 0
PERSISTENT_BOOT_OPTION = 1


@register_message_class
class GetChassisCapabilitiesReq(Message):
Expand Down Expand Up @@ -181,7 +185,7 @@ class SetSystemBootOptionsReq(Message):
# boot flags (semi vi)
Bitfield('data_1', 1,
Bitfield.ReservedBit(5, 0),
Bitfield.Bit('bios_boot_efi', 1),
Bitfield.Bit('bios_boot_type', 1),
Bitfield.Bit('persistent_boot_option', 1),
Bitfield.Bit('valid_flag', 1)),
Bitfield('data_2', 1,
Expand Down