find nvme with lsblk

This commit is contained in:
2024-04-14 11:13:00 +02:00
parent 2306d34e91
commit aa7ddf8b36
2 changed files with 14 additions and 5 deletions

View File

@ -305,7 +305,7 @@ void reHDD::searchDrives(list <Drive>* plistDrives)
char * cLine = NULL;
size_t len = 0;
FILE* outputfileHwinfo = popen("lsblk -I 8 -d -o NAME", "r");
FILE* outputfileHwinfo = popen("lsblk -e 11 -d -o NAME", "r");
if (outputfileHwinfo == NULL)
{
@ -321,7 +321,16 @@ void reHDD::searchDrives(list <Drive>* plistDrives)
tmpDrive->state = Drive::NONE;
tmpDrive->bIsOffline = false;
plistDrives->push_back(*tmpDrive);
//Logger::logThis()->info("drive found: " + tmpDrive->getPath());
//Logger::logThis()->info("SATA drive found: " + tmpDrive->getPath());
}
if (string(cLine).length() == 8)
{
Drive* tmpDrive = new Drive("/dev/" + string(cLine).substr(0, 7));
tmpDrive->state = Drive::NONE;
tmpDrive->bIsOffline = false;
plistDrives->push_back(*tmpDrive);
//Logger::logThis()->info("NVME drive found: " + tmpDrive->getPath());
}
}
pclose(outputfileHwinfo);