83b1e9b4 | 06-Oct-2021 |
Patrick Williams <patrick@stwcx.xyz> |
catch exceptions as const
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I17001575bc409351f5187b1b269e66968d402c1c |
55ae5a88 | 02-Aug-2021 |
Ed Tanous <edtanous@google.com> |
Revert "meson: nlohmann/json has a meson build"
and Revert "meson: Rework valijson subproject dependency"
This reverts commit 9fedd141288d36d41345305532251e4659535751. and e7948f447eaeb3afaa78d5d29
Revert "meson: nlohmann/json has a meson build"
and Revert "meson: Rework valijson subproject dependency"
This reverts commit 9fedd141288d36d41345305532251e4659535751. and e7948f447eaeb3afaa78d5d298dc12b0730b8a84.
As they break the yocto build.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I8034a362f0866342a1527f468dc84a6ff1c67bd7
show more ...
|
65ed6645 | 02-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
FruUtils: Avoid truncation in derivation of fruAreaSize
FRU areas can be up to 255 * 8 bytes in length. 2040 can't be represented in an unsigned 8-bit type, so widen the result type to match fruBloc
FruUtils: Avoid truncation in derivation of fruAreaSize
FRU areas can be up to 255 * 8 bytes in length. 2040 can't be represented in an unsigned 8-bit type, so widen the result type to match fruBlockSize.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ie331abc2a50d1d91fced2f03d2ba3275331bdeaa
show more ...
|
499e7aa9 | 02-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
FruUtils: Rework calculateChecksum() implementation
FRU areas are sized by a single-byte count field in units of FRU blocks, which are 8 bytes in size. As such, it's possible for a FRU area to be up
FruUtils: Rework calculateChecksum() implementation
FRU areas are sized by a single-byte count field in units of FRU blocks, which are 8 bytes in size. As such, it's possible for a FRU area to be up to 255 * 8 or 2040 bytes in size. An accumulation of values over such an area to calculate the checksum can produce values exceeding 256. In such a circumstance the current checksum implementation will mask a negative value, invoking undefined behaviour.
Instead, accumulate into an unsigned, 8-bit type to avoid negative masking through well-defined wrap behaviour.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: Ie85894004f1048413cddc62d68dd0b7ae8f6f541
show more ...
|
9fedd141 | 01-Aug-2021 |
Andrew Jeffery <andrew@aj.id.au> |
meson: nlohmann/json has a meson build
Exploit the usual configuration available for subprojects that support meson directly.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I410cc14ca42
meson: nlohmann/json has a meson build
Exploit the usual configuration available for subprojects that support meson directly.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Change-Id: I410cc14ca426b1c4c26600f6a72a47aa4d944570
show more ...
|
07d467bc | 23-Feb-2021 |
Ed Tanous <edtanous@google.com> |
Make build on clang
And support clang-tidy rules. The changes are pretty minimal, and were all done by the clang robot.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I29501aa56de1cd63c
Make build on clang
And support clang-tidy rules. The changes are pretty minimal, and were all done by the clang robot.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I29501aa56de1cd63cda233e06a07641458f89345
show more ...
|
c02d8cbb | 28-Jun-2021 |
Zhikui Ren <zhikui.ren@intel.com> |
FruDevice: fix possible resource leak
file left open when ioctl call fails. close it before conitnue.
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> Change-Id: I8f6c489dc5340bb8e67cd24f790feb8044
FruDevice: fix possible resource leak
file left open when ioctl call fails. close it before conitnue.
Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> Change-Id: I8f6c489dc5340bb8e67cd24f790feb80445a27ed
show more ...
|
395c6d45 | 04-May-2021 |
Jonathan Doman <jonathan.doman@intel.com> |
Require all probe interface properties to match
If multiple properties were provided for a probe interface rule, the match would succeed if the last property (as iterated over by a map) were a match
Require all probe interface properties to match
If multiple properties were provided for a probe interface rule, the match would succeed if the last property (as iterated over by a map) were a match. This commit changes the logic to require all properties to match.
Tested: Added second (invalid) property value to baseboard.json FruDevice rule, and verified that the baseboard was no longer presented by entity-manager after making this change.
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Change-Id: I2b65d0bedb7e0f193c784cdb292653e00cbb34a3
show more ...
|
6d649821 | 05-May-2021 |
Jonathan Doman <jonathan.doman@intel.com> |
Fix dangling reference to scan count
count variable is automatic but was captured by reference in the deepest nested lambda. This makes all the captures explicit in the post-scan lambdas.
Tested: e
Fix dangling reference to scan count
count variable is automatic but was captured by reference in the deepest nested lambda. This makes all the captures explicit in the post-scan lambdas.
Tested: entity-manager presents the same items before and after this change.
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com> Change-Id: I34bce907e43adb67067797c74b2feaf489d742dc
show more ...
|
cda14730 | 11-May-2021 |
Ed Tanous <edtanous@google.com> |
Make a copy of the probe string to fix warning
The newest version of gcc uncovered a subtle bug where we were relying on a reference to an rvalue in a loop. How this manifested was that probeComman
Make a copy of the probe string to fix warning
The newest version of gcc uncovered a subtle bug where we were relying on a reference to an rvalue in a loop. How this manifested was that probeCommand was of type nlohmann::json, which has begin() and end() overloads for std::string, but would return by value instead of by reference to the nlohmann internals. Because of this, technically the reference we were looking at is destroyed each iteration of the loop.
This never caused an issue in practice, as the lifetime of probeCommand was always greater than probe, but it's good to not rely on undefined behavior.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ie89df5d69236331de68788a7f3c5af862160c069
show more ...
|
37e142be | 30-Apr-2021 |
Ed Tanous <edtanous@google.com> |
Check for errors before trying to open a bus
This is a fix to a regression introduced as part of 9b86787adea3f8f29fac2acbb9fa0f48fbcf244a namely, the recursive iterator doesn't check for the existen
Check for errors before trying to open a bus
This is a fix to a regression introduced as part of 9b86787adea3f8f29fac2acbb9fa0f48fbcf244a namely, the recursive iterator doesn't check for the existence of a bus path before attempting to open it, which results in a crash when std::filesystem throws an exception.
This was reported as part of bug #8
Tested: Launched entity-manager in qemu, which was previously crashing and observed "Unable to open path /sys/bus/i2c/devices/i2c-4" in the journal log, with entity-manager staying running.
Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: I638a66e271df0041d4df75be22eb03c064d9cf68
show more ...
|
9fd87e54 | 05-Oct-2020 |
Igor Kononenko <i.kononenko@yadro.com> |
entity-manager: allow non-numeric substitution for name
Currently EntityManager crashes if it can't parse template substitution as numeric variable. This prevent to use test string substitutions the
entity-manager: allow non-numeric substitution for name
Currently EntityManager crashes if it can't parse template substitution as numeric variable. This prevent to use test string substitutions there.
Tested: use string for template substitution in configuration name: { "Name": "$name", "Probe": [ "com.yadro.HWManager.Fan({'part_number': 'ASMFAN781101A'})" ], ..... } Where name is string: com.yadro.HWManager.Fan interface - - - .name property s "Sys_Fan1" emits-change writable .part_number property s "ASMFAN781102A" emits-change writable
Change-Id: I7139a51e9644dba857ff1c542cf127e723182375 Signed-off-by: Igor Kononenko <i.kononenko@yadro.com> Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
show more ...
|
4bab932b | 08-Apr-2021 |
Matt Spinler <spinler@us.ibm.com> |
Fix early exit for non D-Bus probes
The existing code had a bug where it would require a D-Bus interface to be present for a probe in order to continue on to create any configuration objects. This
Fix early exit for non D-Bus probes
The existing code had a bug where it would require a D-Bus interface to be present for a probe in order to continue on to create any configuration objects. This doesn't always work because some probe statements, like "TRUE", don't need any D-bus interface checks to succeed.
The fix is to continue on, and just pass an empty map of D-Bus interfaces into the template substitution function.
This bug was introduced in my 'Do tmpl substitutions using all properties on path" commit.
Tested: Tested with a Probe: "TRUE" config and saw the configuration object for it created on D-Bus.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I672a5fe055801d8bd674778350ce8f434cc0c430
show more ...
|
9b86787a | 13-Oct-2020 |
Johnathan Mantey <johnathanx.mantey@intel.com> |
Improve initialization of I2C sensors
After an AC cycle validation has witnessed some systems sensors are missing. As Entity Manager begins the process of scanning for sesnsors, and creating the har
Improve initialization of I2C sensors
After an AC cycle validation has witnessed some systems sensors are missing. As Entity Manager begins the process of scanning for sesnsors, and creating the hardware monitoring nodes, there are occassionally some failures to correctly create the node. This manifests itself by the 'dd' kernel driver emitting an -EBUSY error message. Unfortunately the 'dd' driver also eats the error code, and continues. This is by design.
This commit modifies how the nodes are initialized. The steps taken: 1. Determine if the node is already present 2. Create the node if it is not 3. Set a timer, to give the kernel time to create the node 4. For those sensors that create a "hwmon" subdir, search for that directory after the timer elapses. 5. If the subdir is not present, delete the device, and try again by initiating another timer. 6. Continue until the subdir exists, or a retry count expires.
Tested: Ran AC cycles via a script. After each cycle, wait for the SUT to DC on, and arrive at the EFI Shell> prompt. Issue "ipmitool sensor list", capturing the results Search the list for all of the sensors that have been reported as missing after AC cycles.
Change-Id: I118df674162677d66e7d211b089430fce384086b Signed-off-by: Johnathan Mantey <johnathanx.mantey@intel.com>
show more ...
|
77987124 | 30-Mar-2021 |
Scron-Chang <Scron.Chang@quantatw.com> |
FruUtils: Add back the else in formatFRU.
There is no "else" in this if-statement and that causes the name very wrong. The dbus path always be "/xyz/openbmc_project/FruDevice/UNKNOWN", and the prope
FruUtils: Add back the else in formatFRU.
There is no "else" in this if-statement and that causes the name very wrong. The dbus path always be "/xyz/openbmc_project/FruDevice/UNKNOWN", and the properties of the dbus-object are FRU_CUSTOM_FIELD_NAME which is "INFO_AM".
Tested: After applying this patch, information of all FRU becomes normal.
Signed-off-by: Scron-Chang <Scron.Chang@quantatw.com> Change-Id: I1e9ee88bbd1d02a1b96cf52a02250efb407cec58
show more ...
|
9e5a6755 | 15-Mar-2021 |
Scron-Chang <Scron.Chang@quantatw.com> |
FruDevice: Define the day 1/1/96.
FruDevice should decide the first day of the month. Otherwise, the date on its own dbus-object gets different from the result of ipmitool.
Tested: After applying t
FruDevice: Define the day 1/1/96.
FruDevice should decide the first day of the month. Otherwise, the date on its own dbus-object gets different from the result of ipmitool.
Tested: After applying this patch, the date on the dbus-object is the same as what ipmitool shows.
For example: root@xxx:/usr/bin# busctl get-property xyz.openbmc_project.FruDevice \ > /xyz/openbmc_project/FruDevice/xxx xyz.openbmc_project.FruDevice \ > BOARD_MANUFACTURE_DATE s "2020-09-24 - 06:25:00" root@xxx:/usr/bin# ipmitool fru print 132 | grep "Date" Board Mfg Date : Thu Sep 24 06:25:00 2020 UTC
Signed-off-by: Scron-Chang <Scron.Chang@quantatw.com> Change-Id: Ic0ed37f18661bafff26676027dc5e16743968221
show more ...
|
c8dc4af9 | 11-Jan-2021 |
Kumar Thangavel <thangavel.k@hcl.com> |
Moved the common code and functions between fru deamons in entitymanager.
Store the common functions/variable declarations between multiple fru related deamons in the FruUtils.cpp and FruUtils.hpp f
Moved the common code and functions between fru deamons in entitymanager.
Store the common functions/variable declarations between multiple fru related deamons in the FruUtils.cpp and FruUtils.hpp files in entitymanager.
TESTED : Built Facebook YosemiteV2 images and loaded on the target hardware. Verified all the fru's read and write.
Signed-off-by: Kumar Thangavel <thangavel.k@hcl.com> Change-Id: I42129998603915af7a81f2bb8dff39dc198e8264
show more ...
|
06d1b4ad | 09-Feb-2021 |
Vijay Khemka <vijaykhemkalinux@gmail.com> |
FruDevice: Move verifyOffset to util
Moving verifyOffset module to fruUtils.cpp
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: I8d8450783d421c1db384ca1332fa5aee90a41ced |
e789bf12 | 24-Feb-2021 |
Matt Spinler <spinler@us.ibm.com> |
Do tmpl substitutions using all properties on path
The current code would substitute the template arguments in the JSON files, such as $bus, by only looking at the properties of the interface that p
Do tmpl substitutions using all properties on path
The current code would substitute the template arguments in the JSON files, such as $bus, by only looking at the properties of the interface that passed the probe.
This commit will try to find a substitution using the properties of all of the interfaces on the same object path as the interface that passed the probe. It does this by reading and storing the properties of all interfaces that came back from the existing GetSubTree call that finds the paths of the probed interfaces, instead of just limiting it to the interfaces that were probed. The template substitutions are then tried on the properties of all interfaces until one is successful.
This change is being made so that the interface used in the probe doesn't also need to contain properties for the device details, such as the bus property, that otherwise wouldn't belong there. For example, the com.ibm.ipzvpd.VINI interface, which models EEPROM contents, is currently used in probes on IBM systems, and with this change the bus and address properties can now be on a separate interface, such as the recently proposed xyz.openbmc_project.Inventory.Decorator.I2CDevice.
Tested: Tested that the $bus template can be successfully filled in with the Bus property from an interface other than the one the probe was matched on.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ic6f1539b38f6a4098f131d7f14cad6b6ddff041f
show more ...
|
4f328895 | 24-Feb-2021 |
Matt Spinler <spinler@us.ibm.com> |
Fix lambda capture in findDbusObjects
In findDbusObjects(), the interfaces variable was getting moved as part of the async method callback creation, but was then used after that as part of the async
Fix lambda capture in findDbusObjects
In findDbusObjects(), the interfaces variable was getting moved as part of the async method callback creation, but was then used after that as part of the async method call arguments. Change the lambda to capture it by value so that it is still usable as an argument to the GetSubTree D-Bus method call.
Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Ia81df828759292fac3157d37bf797c9d7c03c8f0
show more ...
|
7792e396 | 25-Jan-2021 |
Vijay Khemka <vijaykhemkalinux@gmail.com> |
FruDevice: Enforce FRU layout order
As per Section 17 of FRU specification, FRU information areas are required to be in order in FRU data layout which means all offset value should be in increasing
FruDevice: Enforce FRU layout order
As per Section 17 of FRU specification, FRU information areas are required to be in order in FRU data layout which means all offset value should be in increasing order or can be 0 if that area is not present. Verifying these Fru layout order in early header parsing.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: I612297df73ad3661074f16b2b6c1551dd4b055b6
show more ...
|
f69fe90e | 19-Feb-2021 |
Helen Huang <he.huang@intel.com> |
Checking nullptr of busmap[0]
If no device in i2cbus2 under /dev, busmap[0] would be nullptr. So initialize busmap[0] for this case.
Change-Id: I019bd850474af6b1763b8b71c14d73a233fe881a Signed-off
Checking nullptr of busmap[0]
If no device in i2cbus2 under /dev, busmap[0] would be nullptr. So initialize busmap[0] for this case.
Change-Id: I019bd850474af6b1763b8b71c14d73a233fe881a Signed-off-by: Helen Huang <he.huang@linux.intel.com>
show more ...
|
2a967082 | 22-Jan-2021 |
Vijay Khemka <vijaykhemkalinux@gmail.com> |
FruDevice: Check for language code
Currently we are supporting only english language for 8 bit ascii string parsing. If language code detected as non english, we still allows parsing for language in
FruDevice: Check for language code
Currently we are supporting only english language for 8 bit ascii string parsing. If language code detected as non english, we still allows parsing for language independent data like binary, bcd type etc but for language dependent data with type code (11) mentioned in section 13 of FRU specification, we are reporting this as an error for non english language code. As per section 10, chassis area info will always be in english that's why it doesn't have any language bytes in it's field header.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: I3dec0d37110f877da48e484104281389d54047a8
show more ...
|
02618f0d | 20-Jan-2021 |
Vijay Khemka <vijaykhemkalinux@gmail.com> |
FruDevice: Verify offset overlap
Checking each field area offset if they are overlapping with other field area offset.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: Id0fcb704a
FruDevice: Verify offset overlap
Checking each field area offset if they are overlapping with other field area offset.
Signed-off-by: Vijay Khemka <vijaykhemkalinux@gmail.com> Change-Id: Id0fcb704ac20083fae1760ec7d6e6cb559442526
show more ...
|
9b43b779 | 21-Jan-2021 |
Helen Huang <he.huang@linux.intel.com> |
Emplace baseboardDev to I2C bus0
Fix issue: FRU devices on I2C bus0 is replaced by baseboardDev, So the FRU device on I2C bus0 could not be registed on entity manager
Solution: Use emplace() to add
Emplace baseboardDev to I2C bus0
Fix issue: FRU devices on I2C bus0 is replaced by baseboardDev, So the FRU device on I2C bus0 could not be registed on entity manager
Solution: Use emplace() to add the baseboardDev to I2C bus0.
Tested: Tested on the platform with FRU device on I2C bus0, Use 'busctl tree xyz.openbmc_project.FruDevice' and 'ipmitool fru' to check FRU device,both baseboardDev and FRU device on I2C bus0 could be shown.
Signed-off-by: Helen Huang <he.huang@linux.intel.com> Change-Id: I49d37212a1c044a59c8d81694534ab6a747c7d3a
show more ...
|