Support chassis bootdev clear-cmos
Implement the set/get the CMOS clear data 2 of the boot option
parameters boot flags(0x05).
Tested:
1. Set the clear-cmos to yes
# ipmitool chassis bootdev none clear-cmos=yes
2. Get the bootparam 0x05
# ipmitool chassis bootparam get 5
Boot parameter version: 1
Boot parameter 5 is valid/unlocked
Boot parameter data: a080000000
Boot Flags :
- Boot Flag Valid
- Options apply to only next boot
- BIOS EFI boot
- CMOS Clear
- Boot Device Selector : No override
- BIOS verbosity : System Default
- Console Redirection control : Console redirection occurs per
BIOS configuration setting (default)
- BIOS Mux Control Override : BIOS uses recommended setting of
the mux at the end of POST
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I7312106977f8aef5d781dd276eecf9af279a7dc3
diff --git a/chassishandler.cpp b/chassishandler.cpp
index 30ffb23..60d4ee3 100644
--- a/chassishandler.cpp
+++ b/chassishandler.cpp
@@ -1907,6 +1907,7 @@
static uint8_t transferStatus = setComplete;
static uint8_t bootFlagValidBitClr = 0;
static uint5_t bootInitiatorAckData = 0x0;
+static bool cmosClear = false;
/** @brief implements the Get Chassis system boot option
* @param ctx - context pointer
@@ -2036,7 +2037,8 @@
response.pack(bootOptionParameter, reserved1, uint5_t{},
uint1_t{biosBootType}, uint1_t{permanent},
uint1_t{validFlag}, uint2_t{}, uint4_t{bootOption},
- uint2_t{}, uint8_t{}, uint8_t{}, uint8_t{});
+ uint1_t{}, cmosClear, uint8_t{}, uint8_t{},
+ uint8_t{});
return ipmi::responseSuccess(std::move(response));
}
catch (const InternalFailure& e)
@@ -2134,7 +2136,6 @@
bool screenBlank;
uint4_t bootDeviceSelector;
bool lockKeyboard;
- bool cmosClear;
uint8_t data3;
uint4_t biosInfo;
uint4_t rsvd1;