You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ramsize: 8192
bytes: MB
ramsize: No
bytes: Module
ramsize: 8192
bytes: MB
ramsize: No
bytes: Module
At the end of the loop we will have fortunately the correct numeric value for the variable $ramtotal. But the unit for $bytes is inconsitent.
ramtotal: 16384
bytes: Module
Proposed solution
My proposal is to make the grep command with an extended regular expression much more precise that will return only the size with numeric values and additionally with a valid unit either MB or GB as postfix at the end of the line.
I haven´t checked other systems yet, but it could also lead to an error in the calculation of $ramtotal size.
Please have a look and check if the improvement can be implemented.
The text was updated successfully, but these errors were encountered:
v3.1.57
- Added enabling E10M20-T1, M2D20 and M2D18 for DS1821+, DS1621+ and DS1520+.
- Fixed enabling E10M20-T1, M2D20 and M2D18 cards in models that don't officially support them.
- Fixed bugs where the calculated amount of installed memory could be incorrect:
- If last memory socket was empty an invalid unit of bytes could be used. Issue #106
- When dmidecode returned MB for one ram module and GB for another ram module. Issue #107
Environment
script version: v3.0.56
OS: DSM 7.2
Device: 1817+
RAM: 2x 8GB
Problem description
The evaluation of RAM size might cause issues because the condition of the grep command for
dmidecode
is not clear enough.Example:
On my system the command
dmidecode -t memory | grep "[Ss]ize"
will return the following content.Now you can imagine what will happen with the variables $ramsize and $bytes when evaluating with awk.
The result is:
At the end of the loop we will have fortunately the correct numeric value for the variable $ramtotal. But the unit for $bytes is inconsitent.
Proposed solution
My proposal is to make the grep command with an extended regular expression much more precise that will return only the size with numeric values and additionally with a valid unit either MB or GB as postfix at the end of the line.
I haven´t checked other systems yet, but it could also lead to an error in the calculation of $ramtotal size.
Please have a look and check if the improvement can be implemented.
The text was updated successfully, but these errors were encountered: