Skip to content

Draft: info: Fix RAM calculation with empty slots on some hardware

On some hardware the value in MEMORY_ARRAY_NUM_DEVICES does not correspond to the number of slots available. Since the loop was using this value to iterate over all slots, this could result in modules getting skipped if there were empty slots in between the modules.

This works around this by instead looking at all consecutive slots and checking if the slot either has a size or presence property. This works because systemd assigns consecutive numbers to each slot and sets the presence property to 0 if a module is absent. Once there is neither a size nor a presence property, we know that there are no more slots to look at.

Fixes: #1686 (closed)

Edited by Bastien Nocera

Merge request reports

Loading