Skip to content

Commit

Permalink
Added mmcblk device type MMC
Browse files Browse the repository at this point in the history
Added the abbreviation MMC for mmcblk devices such as SD and
microSD cards and some low budget laptops.

Changed log message from "USB bridge, no pass-through support"
to "Smart data unavailable" as no smart data could be caused by
a non USB device such as mmcblk as well as USB devices with no ATA
pass through and other devices that smartctl does not detect.
  • Loading branch information
PartialVolume committed Nov 16, 2023
1 parent d14c3da commit 9ee5193
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ typedef enum nwipe_device_t_ {
NWIPE_DEVICE_ATA,
NWIPE_DEVICE_NVME,
NWIPE_DEVICE_VIRT,
NWIPE_DEVICE_SAS
NWIPE_DEVICE_SAS,
NWIPE_DEVICE_MMC
} nwipe_device_t;

typedef enum nwipe_pass_t_ {
Expand Down
15 changes: 13 additions & 2 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ int check_device( nwipe_context_t*** c, PedDevice* dev, int dcount )
strcpy( next_device->device_type_str, " SAS" );
check_HPA = 1;
break;

case NWIPE_DEVICE_MMC:
strcpy( next_device->device_type_str, " MMC" );
break;
}
if( next_device->device_is_ssd )
{
Expand Down Expand Up @@ -638,6 +642,13 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, i
{
*bus = NWIPE_DEVICE_VIRT;
}
else
{
if( strstr( result, "/mmcblk" ) != 0 )
{
*bus = NWIPE_DEVICE_MMC;
}
}
}
}
}
Expand Down Expand Up @@ -859,9 +870,9 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, i

if( exit_status == 1 )
{
nwipe_log( NWIPE_LOG_WARNING, "%s USB bridge, no pass-through support", device );
nwipe_log( NWIPE_LOG_WARNING, "Smartctl is unable to provide smart data for %s", device );

if( *bus == NWIPE_DEVICE_USB )
if( *bus == NWIPE_DEVICE_USB || *bus == NWIPE_DEVICE_MMC )
{
strcpy( serialnumber, "(S/N: unknown)" );
set_return_value = 5;
Expand Down

0 comments on commit 9ee5193

Please sign in to comment.