[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/3] Display a warning message on TAINT_HARDWARE_UNSUPPORTED (#623140).



---
 loader/loader.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/loader/loader.c b/loader/loader.c
index 704a986..50f55cd 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -1208,6 +1208,29 @@ static void checkForRam(void) {
     }
 }
 
+static void checkTaintFlag(void) {
+    gchar *contents = NULL;
+    GError *fileErr = NULL;
+
+    if (!g_file_get_contents("/proc/sys/kernel/tainted", &contents, NULL, &fileErr)) {
+        logMessage(ERROR, "error reading /proc/sys/kernel/tainted: %s", fileErr->message);
+        g_error_free(fileErr);
+        return;
+    }
+
+    if (g_ascii_strncasecmp(contents, "0", 1)) {
+        startNewt();
+        newtWinMessage(_("Unsupported Hardware Detected"), _("OK"),
+                       _("This hardware (or a combination thereof) is not "
+                         "supported by Red Hat.  For more information on "
+                         "supported hardware, please refer to "
+                         "http://www.redhat.com/hardware.";));
+        stopNewt();
+    }
+
+    g_free(contents);
+}
+
 static int haveDeviceOfType(int type) {
     struct device ** devices;
 
@@ -2213,6 +2236,8 @@ int main(int argc, char ** argv) {
         manualDeviceCheck(&loaderData);
     }
 
+    checkTaintFlag();
+
     if (loaderData.updatessrc)
         loadUpdatesFromRemote(loaderData.updatessrc, &loaderData);
     else if (FL_UPDATES(flags))
-- 
1.7.1.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]