Skip to content

Commit 9ee5193

Browse files
committed
Added mmcblk device type MMC
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.
1 parent d14c3da commit 9ee5193

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/context.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ typedef enum nwipe_device_t_ {
3838
NWIPE_DEVICE_ATA,
3939
NWIPE_DEVICE_NVME,
4040
NWIPE_DEVICE_VIRT,
41-
NWIPE_DEVICE_SAS
41+
NWIPE_DEVICE_SAS,
42+
NWIPE_DEVICE_MMC
4243
} nwipe_device_t;
4344

4445
typedef enum nwipe_pass_t_ {

src/device.c

+13-2
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ int check_device( nwipe_context_t*** c, PedDevice* dev, int dcount )
365365
strcpy( next_device->device_type_str, " SAS" );
366366
check_HPA = 1;
367367
break;
368+
369+
case NWIPE_DEVICE_MMC:
370+
strcpy( next_device->device_type_str, " MMC" );
371+
break;
368372
}
369373
if( next_device->device_is_ssd )
370374
{
@@ -638,6 +642,13 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, i
638642
{
639643
*bus = NWIPE_DEVICE_VIRT;
640644
}
645+
else
646+
{
647+
if( strstr( result, "/mmcblk" ) != 0 )
648+
{
649+
*bus = NWIPE_DEVICE_MMC;
650+
}
651+
}
641652
}
642653
}
643654
}
@@ -859,9 +870,9 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, i
859870

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

864-
if( *bus == NWIPE_DEVICE_USB )
875+
if( *bus == NWIPE_DEVICE_USB || *bus == NWIPE_DEVICE_MMC )
865876
{
866877
strcpy( serialnumber, "(S/N: unknown)" );
867878
set_return_value = 5;

0 commit comments

Comments
 (0)