summaryrefslogtreecommitdiff
path: root/kernel.c
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-02-13 10:20:38 -0800
committerAaron Plattner <aplattner@nvidia.com>2008-02-13 10:20:38 -0800
commit6a5baffc91051abad8e243e7f7dbbe0819384772 (patch)
tree09e812bfb47cd15b2840e206b559fc1277ea89c7 /kernel.c
parent75c80b36e8fbbfd0d349fbbfe9db6b54ec1fe30a (diff)
1.0-97461.0-9746
Diffstat (limited to 'kernel.c')
-rw-r--r--kernel.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/kernel.c b/kernel.c
index 8470c11..e3692c4 100644
--- a/kernel.c
+++ b/kernel.c
@@ -57,6 +57,7 @@ static int rmmod_kernel_module(Options *op, const char *);
static PrecompiledInfo *download_updated_kernel_interface(Options*, Package*,
const char*);
static int fbdev_check(Options *op, Package *p);
+static int xen_check(Options *op, Package *p);
static PrecompiledInfo *scan_dir(Options *op, Package *p,
const char *directory_name,
@@ -447,6 +448,7 @@ int build_kernel_module(Options *op, Package *p)
}
if (!fbdev_check(op, p)) return FALSE;
+ if (!xen_check(op, p)) return FALSE;
cmd = nvstrcat("cd ", p->kernel_module_build_directory,
"; make print-module-filename",
@@ -1587,12 +1589,49 @@ static int fbdev_check(Options *op, Package *p)
return TRUE;
-
} /* fbdev_check() */
/*
+ * xen_check() - run the xen_sanity_check conftest; if this test fails, print
+ * the test's error message and abort the driver installation.
+ */
+
+static int xen_check(Options *op, Package *p)
+{
+ char *CC, *cmd, *result;
+ int ret;
+
+ CC = getenv("CC");
+ if (!CC) CC = "cc";
+
+ ui_log(op, "Performing Xen check.");
+
+ cmd = nvstrcat("sh ", p->kernel_module_build_directory,
+ "/conftest.sh ", CC, " ", CC, " ",
+ op->kernel_source_path, " ",
+ op->kernel_output_path, " ",
+ "xen_sanity_check just_msg", NULL);
+
+ ret = run_command(op, cmd, &result, FALSE, 0, TRUE);
+
+ nvfree(cmd);
+
+ if (ret != 0) {
+ ui_error(op, "%s", result);
+ nvfree(result);
+
+ return FALSE;
+ }
+
+ return TRUE;
+
+} /* xen_check() */
+
+
+
+/*
* scan_dir() - scan through the specified directory for a matching
* precompiled kernel interface.
*/