edac-utils icon indicating copy to clipboard operation
edac-utils copied to clipboard

Does not work with board names which contain empty spaces

Open glaubitz opened this issue 10 years ago • 1 comments

Hello!

We just stumbled over an issue with edac-utils which can arise when using the labels.db to match the kernel's DIMM identifiers with the one on the mainboard.

The problem occurs when board names contain trailing spaces like in our case for the IBM iDataPlex servers:

[yrl01:02]root@ygpu02:/etc/edac> echo "$(</sys/class/dmi/id/board_name)" _69Y4782 _

As you can see, the board_name string returned by the kernel contains 5 trailing spaces. When adding this board name to the labels.db, it's not possible to add these trailing spaces as they are ignored by edac-utils which just tries to match "69Y4782".

It might be a good idea to add support for regular expressions when matching board names (or strings in general) or allowing to quotation marks around the strings such that board names with trailing spaces or other weird characters won't be a problem.

Adrian

glaubitz avatar Jun 15 '15 13:06 glaubitz

Great bug report thanks. I haven't looked at this code in quite awhile, so I do not know when I'd personally get to this, but feel free to propose a patch!

Your idea for regex is great. It might also be easier to ignore trailing whitespace in all dimm labels

grondo avatar Jun 15 '15 13:06 grondo