dmi: Don't print dmidecode shell error

Don't print the error "sh: dmidecode: not found" if dmidecode is not there.
Uses stderr redirection to /dev/null (or NUL on Windows).

Change-Id: I3ded8e1bad14b5e809185a79c4e3a17329b1ecb9
Signed-off-by: Stefan Reinauer <>
Signed-off-by: Stefan Tauner <>
Signed-off-by: Nico Huber <>
Tested-by: build bot (Jenkins) <>
Reviewed-by: Paul Menzel <>
diff --git a/dmi.c b/dmi.c
index 729cdb1..70b1177 100644
--- a/dmi.c
+++ b/dmi.c
@@ -34,6 +34,7 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include "platform.h"
 #include "flash.h"
 #include "programmer.h"
@@ -292,7 +293,11 @@
 #define DMI_COMMAND_LEN_MAX 300
-static const char *dmidecode_command = "dmidecode";
+static const char *dmidecode_command = "dmidecode.exe 2>NUL";
+static const char *dmidecode_command = "dmidecode 2>/dev/null";
 static char *get_dmi_string(const char *string_name)