Bug fixing for set boot options
Set boot options to persistent not working, fix it by using bool
pointer type.And also update oneTimeEnabled value since it's
property changed.
Tested:
It works by set boot option IPMI command with persistent parameter.
ipmitool raw 0x00 0x08 0x05 0xc0 0x3c 0x00 0x00 0x00
Change-Id: I81c68b89fe80b6ecbad1da99f4f169442a9ee675
Signed-off-by: Chen Yugang <yugang.chen@linux.intel.com>
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 0389c46..00f6943 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -3283,7 +3283,11 @@
Value variant = getDbusProperty(
*dbus, service, boot_options::oneTimePath,
boot_options::enabledIntf, boot_options::oneTimeBootEnableProp);
- oneTimeEnabled = std::get_if<bool>(&variant);
+ auto pTmp = std::get_if<bool>(&variant);
+ if (pTmp != nullptr)
+ {
+ oneTimeEnabled = *pTmp;
+ }
/*
* Check if the current boot setting is onetime or permanent, if the
@@ -3299,6 +3303,7 @@
setDbusProperty(*dbus, service, boot_options::oneTimePath,
boot_options::enabledIntf,
boot_options::oneTimeBootEnableProp, !permanent);
+ oneTimeEnabled = !permanent;
}
// set BootSource and BootMode properties