In /usr/share/php/openmediavault/system/storage/storagedevice.inc
on line 57 it says $this->_vendor = trim(file_get_contents($filename));.
I believe this should be changed to return trim(file_get_contents($filename));.
I've also changed the method "getSerialNumber" so that "SCSI_IDENT_SERIAL" takes higher priority in case there is one, as this is the correct case in a ARECA RAID card environment AFAIK.
See full code:
PHP: /usr/share/php/openmediavault/system/storage/storagedevice.inc
/**
* Get the device vendor.
* @return string The device vendor, otherwise an empty string.
*/
public function getVendor() {
$filename = sprintf("/sys/block/%s/device/vendor",
$this->getDeviceName(TRUE));
if (file_exists($filename))
return trim(file_get_contents($filename));
// $this->_vendor = trim(file_get_contents($filename));
return "";
}
/**
* Get the device serial number.
* @return string The device serial number, otherwise an empty string.
*/
public function getSerialNumber() {
if (TRUE === $this->hasUdevProperty("SCSI_IDENT_SERIAL")) {
$property = $this->getUdevProperty("SCSI_IDENT_SERIAL");
return str_replace("_", " ", $property);
} elseif (TRUE === $this->hasUdevProperty("ID_SERIAL_SHORT")) {
$property = $this->getUdevProperty("ID_SERIAL_SHORT");
return str_replace("_", " ", $property);
} else {
return "";
}
}
Alles anzeigen
But my real question is, where do I share this?
EDIT:
Found out that the device's serial in udevadm info could also be parameter "ID_SCSI_SERIAL" as well.
I'm not sure all the possibilities but seems like looks pretty unpromising...
Kind regards