summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2008-02-13 10:20:36 -0800
committerAaron Plattner <aplattner@nvidia.com>2008-02-13 10:20:36 -0800
commitf048a99526c5bad39bef29d414635ad3a5b53371 (patch)
tree3c6bcdafd89749e7932d43db1c25850e6ad47cec
parent6d2a0069d419975ba01c2c423b18ef7cd2e76a6f (diff)
1.0-61111.0-6111
-rw-r--r--ChangeLog5
-rw-r--r--Makefile2
-rw-r--r--install-from-cwd.c1
-rw-r--r--kernel.c63
-rw-r--r--kernel.h1
-rw-r--r--nvidia-installer.c12
-rw-r--r--nvidia-installer.h1
7 files changed, 73 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f5aaf7..7a9e6a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
+2004-07-23 version 1.0.7
+
+ * Added --kernel-output-path option to support separate KBUILD
+ output directories.
+
2004-01-12 version 1.0.6
* Add support for installing on Linux 2.6 kernels.
diff --git a/Makefile b/Makefile
index 12ee6cf..655d171 100644
--- a/Makefile
+++ b/Makefile
@@ -90,7 +90,7 @@ NVIDIA_INSTALLER = nvidia-installer
MKPRECOMPILED = mkprecompiled
NVIDIA_INSTALLER_PROGRAM_NAME = "nvidia-installer"
-NVIDIA_INSTALLER_VERSION = "1.0.6"
+NVIDIA_INSTALLER_VERSION = "1.0.7"
NCURSES_UI = nvidia-installer-ncurses-ui.so
NCURSES_UI_C = g_$(NCURSES_UI:.so=.c)
diff --git a/install-from-cwd.c b/install-from-cwd.c
index 6b78f60..eb72e77 100644
--- a/install-from-cwd.c
+++ b/install-from-cwd.c
@@ -160,6 +160,7 @@ int install_from_cwd(Options *op)
*/
if (!determine_kernel_source_path(op)) goto failed;
+ determine_kernel_output_path(op);
/* and now, build the kernel interface */
diff --git a/kernel.c b/kernel.c
index 26be0ab..9e332ff 100644
--- a/kernel.c
+++ b/kernel.c
@@ -291,6 +291,39 @@ int determine_kernel_source_path(Options *op)
} /* determine_kernel_source_path() */
+/*
+ * determine_kernel_output_path() - determine the kernel output
+ * path; unless specified, the kernel output path is assumed to be
+ * the same as the kernel source path.
+ */
+
+int determine_kernel_output_path(Options *op)
+{
+ char *str;
+
+ /* check --kernel-output-path */
+
+ if (op->kernel_output_path) {
+ ui_log(op, "Using the kernel output path '%s' as specified by the "
+ "'--kernel-output-path' commandline option.",
+ op->kernel_output_path);
+ return TRUE;
+ }
+
+ /* check SYSOUT */
+
+ str = getenv("SYSOUT");
+ if (str) {
+ ui_log(op, "Using the kernel output path '%s', as specified by the "
+ "SYSOUT environment variable.", str);
+ op->kernel_output_path = str;
+ return TRUE;
+ }
+
+ op->kernel_output_path = op->kernel_source_path;
+ return TRUE;
+}
+
/*
* link_kernel_module() - link the prebuilt kernel interface against
@@ -360,7 +393,9 @@ int build_kernel_module(Options *op, Package *p)
* no hope for the make rules if this fails.
*/
cmd = nvstrcat("sh ", p->kernel_module_build_directory,
- "/conftest.sh cc ", op->kernel_source_path, "/include ",
+ "/conftest.sh cc ",
+ op->kernel_source_path, " ",
+ op->kernel_output_path, " ",
"select_makefile just_msg", NULL);
ret = run_command(op, cmd, &result, FALSE, 0, TRUE);
@@ -372,15 +407,13 @@ int build_kernel_module(Options *op, Package *p)
return FALSE;
}
-
if (!rivafb_check(op, p)) return FALSE;
-
rivafb_module_check(op, p);
-
cmd = nvstrcat("cd ", p->kernel_module_build_directory,
- "; make print-module-filename SYSSRC=",
- op->kernel_source_path, NULL);
+ "; make print-module-filename",
+ " SYSSRC=", op->kernel_source_path,
+ " SYSOUT=", op->kernel_output_path, NULL);
ret = run_command(op, cmd, &p->kernel_module_filename, FALSE, 0, FALSE);
@@ -406,7 +439,9 @@ int build_kernel_module(Options *op, Package *p)
ui_status_begin(op, "Building kernel module:", "Building");
cmd = nvstrcat("cd ", p->kernel_module_build_directory,
- "; make module SYSSRC=", op->kernel_source_path, NULL);
+ "; make module",
+ " SYSSRC=", op->kernel_source_path,
+ " SYSOUT=", op->kernel_output_path, NULL);
ret = run_command(op, cmd, &result, TRUE, 25, TRUE);
@@ -1306,8 +1341,10 @@ static int cc_version_check(Options *op, Package *p)
ui_log(op, "Performing cc_version_check with CC=\"%s\".", CC);
cmd = nvstrcat("sh ", p->kernel_module_build_directory,
- "/conftest.sh ", CC, " ", op->kernel_source_path,
- "/include ", "cc_sanity_check just_msg", NULL);
+ "/conftest.sh ", CC, " ",
+ op->kernel_source_path, " ",
+ op->kernel_output_path, " ",
+ "cc_sanity_check just_msg", NULL);
ret = run_command(op, cmd, &result, FALSE, 0, TRUE);
@@ -1347,7 +1384,9 @@ static int rivafb_check(Options *op, Package *p)
ui_log(op, "Performing rivafb check.");
cmd = nvstrcat("sh ", p->kernel_module_build_directory,
- "/conftest.sh cc ", op->kernel_source_path, "/include ",
+ "/conftest.sh cc ",
+ op->kernel_source_path, " ",
+ op->kernel_output_path, " ",
"rivafb_sanity_check just_msg", NULL);
ret = run_command(op, cmd, &result, FALSE, 0, TRUE);
@@ -1380,7 +1419,9 @@ static void rivafb_module_check(Options *op, Package *p)
ui_log(op, "Performing rivafb module check.");
cmd = nvstrcat("sh ", p->kernel_module_build_directory,
- "/conftest.sh cc ", op->kernel_source_path, "/include ",
+ "/conftest.sh cc ",
+ op->kernel_source_path, " ",
+ op->kernel_output_path, " ",
"rivafb_module_sanity_check just_msg", NULL);
ret = run_command(op, cmd, &result, FALSE, 0, TRUE);
diff --git a/kernel.h b/kernel.h
index 75dcc8f..e56bd22 100644
--- a/kernel.h
+++ b/kernel.h
@@ -29,6 +29,7 @@
int determine_kernel_module_installation_path (Options*);
int determine_kernel_source_path (Options*);
+int determine_kernel_output_path (Options*);
int link_kernel_module (Options*, Package*);
int build_kernel_module (Options*, Package*);
int build_kernel_interface (Options*, Package*);
diff --git a/nvidia-installer.c b/nvidia-installer.c
index 124d526..e40cd35 100644
--- a/nvidia-installer.c
+++ b/nvidia-installer.c
@@ -261,6 +261,14 @@ static void print_advanced_options_args_only(int args_only)
"directory exists. Otherwise, it will use "
"'/usr/src/linux'.");
fmtout("");
+
+ fmtout("--kernel-output-path=[KERNEL OUTPUT PATH]");
+ fmtoutp(TAB, "The directory containing any KBUILD output files if "
+ "either one of the 'KBUILD_OUTPUT' or 'O' parameters were "
+ "passed to KBUILD when building the kernel image/modules. "
+ "When not specified, the installer will assume that no "
+ "separate output directory was used.");
+ fmtout("");
fmtout("--kernel-install-path=[KERNEL INSTALL PATH]");
fmtoutp(TAB, "The directory in which the NVIDIA kernel module should be "
@@ -454,6 +462,7 @@ Options *parse_commandline(int argc, char *argv[])
#define KERNEL_SOURCE_PATH_OPTION 23
#define NO_RPMS_OPTION 24
#define X_PREFIX_OPTION 25
+#define KERNEL_OUTPUT_PATH_OPTION 26
static struct option long_options[] = {
@@ -482,6 +491,7 @@ Options *parse_commandline(int argc, char *argv[])
{ "utility-prefix", 1, NULL, UTILITY_PREFIX_OPTION },
{ "kernel-include-path", 1, NULL, KERNEL_INCLUDE_PATH_OPTION },
{ "kernel-source-path", 1, NULL, KERNEL_SOURCE_PATH_OPTION },
+ { "kernel-output-path", 1, NULL, KERNEL_OUTPUT_PATH_OPTION },
{ "kernel-install-path", 1, NULL, KERNEL_INSTALL_PATH_OPTION },
{ "uninstall", 0, NULL, UNINSTALL_OPTION },
{ "proc-mount-point", 1, NULL, PROC_MOUNT_POINT_OPTION },
@@ -575,6 +585,8 @@ Options *parse_commandline(int argc, char *argv[])
op->utility_prefix = optarg; break;
case KERNEL_SOURCE_PATH_OPTION:
op->kernel_source_path = optarg; break;
+ case KERNEL_OUTPUT_PATH_OPTION:
+ op->kernel_output_path = optarg; break;
case KERNEL_INCLUDE_PATH_OPTION:
op->kernel_include_path = optarg; break;
case KERNEL_INSTALL_PATH_OPTION:
diff --git a/nvidia-installer.h b/nvidia-installer.h
index 92f8257..c7cdd87 100644
--- a/nvidia-installer.h
+++ b/nvidia-installer.h
@@ -107,6 +107,7 @@ typedef struct __options {
char *utility_prefix;
char *kernel_source_path;
+ char *kernel_output_path;
char *kernel_include_path;
char *kernel_module_installation_path;
char *utils[MAX_UTILS];