From 1744d896923c852681acd9014218b7294cb41dbb Mon Sep 17 00:00:00 2001 From: PartialVolume Date: Wed, 17 Nov 2021 19:27:27 +0000 Subject: [PATCH] Update nvme temperatures. For sdX devices we look in /sys/class/hwmon/hwmonX/block for the device name. However, for nvme we access the device name by looking in .. /sys/class/hwmon/hwmonX/device/nvme/nvme0 nvme0n1 Multiple nvme drives/controllers will need to be tested. --- src/temperature.c | 5 +++-- src/version.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/temperature.c b/src/temperature.c index a85d1d1..cd08c34 100644 --- a/src/temperature.c +++ b/src/temperature.c @@ -105,12 +105,13 @@ int nwipe_init_temperature( nwipe_context_t* c ) { /* If not then we search the parent directory ../device/ * for the device name rather than ../device/block/ */ - strcat( dirpath_tmp2, "/device" ); + strcat( dirpath_tmp2, "/device/nvme/nvme0" ); strcpy( dirpath_tmp, dirpath_tmp2 ); if( ( dir2 = opendir( dirpath_tmp ) ) == NULL ) { - nwipe_log( NWIPE_LOG_ERROR, "hwmon: Can't open /sys/class/hwmon/hwmonX/ or ../hwmonX/block" ); + nwipe_log( NWIPE_LOG_ERROR, + "hwmon: Can't open /sys/class/hwmon/hwmonX/block or ../hwmonX/device/nvme/nvme0" ); continue; } } diff --git a/src/version.c b/src/version.c index ac3f413..b0551de 100644 --- a/src/version.c +++ b/src/version.c @@ -4,7 +4,7 @@ * used by configure to dynamically assign those values * to documentation files. */ -const char* version_string = "0.32.011"; +const char* version_string = "0.32.012"; const char* program_name = "nwipe"; const char* author_name = "Martijn van Brummelen"; const char* email_address = "git@brumit.nl"; @@ -14,4 +14,4 @@ Modifications to original dwipe Copyright Andy Beverley \n\ This is free software; see the source for copying conditions.\n\ There is NO warranty; not even for MERCHANTABILITY or FITNESS\n\ FOR A PARTICULAR PURPOSE.\n"; -const char* banner = "nwipe 0.32.011"; +const char* banner = "nwipe 0.32.012";