Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check smartctl for unresolved bus types SATA #358

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c

strncpy( serialnumber, &result[15], 20 );
}

if( *bus == 0 )
{
if( strstr( result, "Transport protocol:" ) != 0 )
Expand All @@ -645,6 +646,18 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c
*bus = NWIPE_DEVICE_SAS;
}
}

if( strstr( result, "SATA Version is:" ) != 0 )
{

/* strip any leading or trailing spaces and left justify, +4 is the length of "bus type:" */
trim( &result[16] );

if( strncmp( &result[16], "SATA", 4 ) == 0 )
{
*bus = NWIPE_DEVICE_ATA;
}
}
}
}

Expand Down