diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2010-09-28 13:14:51 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2010-09-28 13:14:51 -0700 |
commit | f2fb01961579041379a86b96e4f904fd26232749 (patch) | |
tree | 4ba04d7d59a9ebdbdddcf36372df5cedf4149c8c | |
parent | d1c2f0df019026813015a44cb5a9ccf425b3d214 (diff) |
260.19.04260.19.04
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | command-list.c | 1 | ||||
-rw-r--r-- | common-utils/nvgetopt.c (renamed from nvgetopt.c) | 151 | ||||
-rw-r--r-- | common-utils/nvgetopt.h | 156 | ||||
-rw-r--r-- | common-utils/src.mk | 7 | ||||
-rw-r--r-- | dist-files.mk | 2 | ||||
-rw-r--r-- | files.c | 26 | ||||
-rw-r--r-- | install-from-cwd.c | 14 | ||||
-rw-r--r-- | log.c | 121 | ||||
-rw-r--r-- | misc.c | 51 | ||||
-rw-r--r-- | nvgetopt.h | 69 | ||||
-rw-r--r-- | nvidia-installer.c | 11 | ||||
-rw-r--r-- | nvidia-installer.h | 32 | ||||
-rw-r--r-- | option_table.h | 146 | ||||
-rw-r--r-- | utils.mk | 10 | ||||
-rw-r--r-- | version.mk | 2 |
16 files changed, 493 insertions, 323 deletions
@@ -100,15 +100,32 @@ else COMPAT_32_SRC = endif +############################################################################## +# The common-utils directory may be in one of two places: either +# elsewhere in the driver source tree when building nvidia-installer +# as part of the NVIDIA driver build (in which case, COMMON_UTILS_DIR +# should be defined by the calling makefile), or directly in the +# source directory when building from the nvidia-installer source +# tarball (in which case, the below conditional assignments should be +# used) +############################################################################## + +COMMON_UTILS_DIR ?= common-utils + # include the list of source files; defines SRC include dist-files.mk +include $(COMMON_UTILS_DIR)/src.mk +SRC += $(addprefix $(COMMON_UTILS_DIR)/,$(COMMON_UTILS_SRC)) + INSTALLER_SRC = $(SRC) $(NCURSES_UI_SO_C) $(TLS_TEST_C) $(TLS_TEST_DSO_C) \ $(RTLD_TEST_C) $(COMPAT_32_SRC) $(STAMP_C) INSTALLER_OBJS = $(call BUILD_OBJECT_LIST,$(INSTALLER_SRC)) CFLAGS += -I. -imacros $(CONFIG_H) -I $(OUTPUTDIR) +CFLAGS += -I $(COMMON_UTILS_DIR) + HOST_CFLAGS += -I. -imacros $(CONFIG_H) -I $(OUTPUTDIR) LDFLAGS += -L. -ldl diff --git a/command-list.c b/command-list.c index a83908d..9558ba6 100644 --- a/command-list.c +++ b/command-list.c @@ -577,6 +577,7 @@ static ConflictingFileInfo __xfree86_libs[] = { { "libvdpau_trace.", 15, /* strlen("libvdpau_trace.") */ NULL }, { "libvdpau_nvidia.", 16, /* strlen("libvdpau_nvidia.") */ NULL }, { "libnvidia-compiler.", 19, /* strlen("libnvidia-compiler.") */ NULL }, + { "libnvcuvid.", 11, /* strlen("libnvcuvid.") */ NULL }, { NULL, 0, NULL } }; diff --git a/nvgetopt.c b/common-utils/nvgetopt.c index efce012..3bea6f8 100644 --- a/nvgetopt.c +++ b/common-utils/nvgetopt.c @@ -1,8 +1,5 @@ /* - * nvidia-installer: A tool for installing NVIDIA software packages on - * Unix and Linux systems. - * - * Copyright (C) 2010 NVIDIA Corporation + * Copyright (C) 2004-2010 NVIDIA Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -33,28 +30,29 @@ #include "nvgetopt.h" -/* - * nvgetopt() - see the glibc getopt_long(3) manpage for usage - * description. Options can be prepended with "--" or "-". - * - * A global variable stores the current index into the argv array, so - * subsequent calls to nvgetopt() will advance through argv[]. - * - * On success, the matching NVGetoptOption.val is returned. - * - * On failure, an error is printed to stderr, and 0 is returned. - * - * When there are no more options to parse, -1 is returned. - */ - -int nvgetopt(int argc, char *argv[], const NVGetoptOption *options, - char **strval) +int nvgetopt(int argc, + char *argv[], + const NVGetoptOption *options, + char **strval, + int *boolval, + int *intval, + double *doubleval, + int *disable_val) { char *c, *a, *arg, *name = NULL, *argument=NULL; - int i, found = NVGETOPT_FALSE, ret = 0; + int i, found = NVGETOPT_FALSE; + int ret = 0; + int negate = NVGETOPT_FALSE; + int disable = NVGETOPT_FALSE; const NVGetoptOption *o = NULL; static int argv_index = 0; + if (strval) *strval = NULL; + if (boolval) *boolval = NVGETOPT_FALSE; + if (intval) *intval = 0; + if (doubleval) *doubleval = 0.0; + if (disable_val) *disable_val = NVGETOPT_FALSE; + argv_index++; /* if no more options, return -1 */ @@ -102,8 +100,30 @@ int nvgetopt(int argc, char *argv[], const NVGetoptOption *options, } } else { /* long option */ for (i = 0; options[i].name; i++) { - if (strcmp(options[i].name, name) == 0) { + const char *tmpname; + int tmp_negate; + + /* + * if this option allows negation by prepending with + * "--no-" (true for IS_BOOLEAN and ALLOW_DISABLE), then + * skip any leading "no-" in the argument + */ + + if ((options[i].flags & (NVGETOPT_IS_BOOLEAN | + NVGETOPT_ALLOW_DISABLE)) && + (name[0] == 'n') && + (name[1] == 'o') && + (name[2] == '-')) { + tmpname = name + 3; + tmp_negate = NVGETOPT_TRUE; + } else { + tmpname = name; + tmp_negate = NVGETOPT_FALSE; + } + + if (strcmp(tmpname, options[i].name) == 0) { o = &options[i]; + negate = tmp_negate; break; } } @@ -176,13 +196,33 @@ int nvgetopt(int argc, char *argv[], const NVGetoptOption *options, goto done; } + + /* if the option is boolean, record !negate as the boolean value */ + + if (o->flags & NVGETOPT_IS_BOOLEAN) { + if (boolval) *boolval = !negate; + } + + /* - * if the option takes an argument string, then we either - * need to use what was after the "=" in this argv[] entry, + * if this option is flagged as "disable-able", then let the + * "--no-" prefix get interpreted to mean that the option should + * be disabled + */ + + if ((o->flags & NVGETOPT_ALLOW_DISABLE) && (negate == NVGETOPT_TRUE)) { + disable = NVGETOPT_TRUE; + } + + + /* + * if the option takes an argument (either string or integer), and + * we haven't already decided to disable the option, then we + * either need to use what was after the "=" in this argv[] entry, * or we need to pull the next entry off of argv[] */ - if (o->flags & NVGETOPT_HAS_ARGUMENT) { + if ((o->flags & NVGETOPT_HAS_ARGUMENT) && !disable) { if (argument) { if (!argument[0]) { fprintf(stderr, "%s: option \"%s\" requires an " @@ -190,19 +230,58 @@ int nvgetopt(int argc, char *argv[], const NVGetoptOption *options, goto done; } } else { - argv_index++; - if (argv_index >= argc) { - fprintf(stderr, "%s: option \"%s\" requires an " - "argument.\n", argv[0], arg); - goto done; + + /* + * if the argument is optional, and we're either at the + * end of the argv list, or the next argv starts with '-', + * then assume there is no argument for this option + */ + + if ((o->flags & NVGETOPT_ARGUMENT_IS_OPTIONAL) && + ((argv_index == (argc - 1)) || + (argv[argv_index + 1][0] == '-'))) { + argument = NULL; + goto argument_processing_done; + } else { + argv_index++; + if (argv_index >= argc) { + fprintf(stderr, "%s: option \"%s\" requires an " + "argument.\n", argv[0], arg); + goto done; + } + argument = argv[argv_index]; } - argument = argv[argv_index]; } /* argument is now a valid string: parse it */ - if ((o->flags & NVGETOPT_STRING_ARGUMENT) && (strval)) { + if ((o->flags & NVGETOPT_INTEGER_ARGUMENT) && (intval)) { + + /* parse the argument as an integer */ + + char *endptr; + *intval = (int) strtol(argument, &endptr, 0); + if (*endptr) { + fprintf(stderr, "%s: \"%s\" is not a valid argument for " + "option \"%s\".\n", argv[0], argument, arg); + goto done; + } + } else if ((o->flags & NVGETOPT_STRING_ARGUMENT) && (strval)) { + + /* treat the argument as a string */ + *strval = strdup(argument); + } else if ((o->flags & NVGETOPT_DOUBLE_ARGUMENT) && (doubleval)) { + + /* parse the argument as a double */ + + char *endptr; + *doubleval = (double) strtod(argument, &endptr); + if (*endptr) { + fprintf(stderr, "%s: \"%s\" is not a valid argument for " + "option \"%s\".\n", argv[0], argument, arg); + goto done; + } } else { fprintf(stderr, "%s: error while assigning argument for " "option \"%s\".\n", argv[0], arg); @@ -221,9 +300,15 @@ int nvgetopt(int argc, char *argv[], const NVGetoptOption *options, } } + argument_processing_done: + ret = o->val; -done: + /* fall through */ + + done: + + if (disable_val) *disable_val = disable; free(arg); return ret; diff --git a/common-utils/nvgetopt.h b/common-utils/nvgetopt.h new file mode 100644 index 0000000..7083860 --- /dev/null +++ b/common-utils/nvgetopt.h @@ -0,0 +1,156 @@ +/* + * Copyright (C) 2004-2010 NVIDIA Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the: + * + * Free Software Foundation, Inc. + * 59 Temple Place - Suite 330 + * Boston, MA 02111-1307, USA + * + * + * nvgetopt.h + */ + +#ifndef __NVGETOPT_H__ +#define __NVGETOPT_H__ + +#define NVGETOPT_FALSE 0 +#define NVGETOPT_TRUE 1 + + +/* + * indicates that the option is a boolean value; the presence of the + * option will be interpretted as a TRUE value; if the option is + * prepended with '--no-', the option will be interpretted as a FALSE + * value. On success, nvgetopt will return the parsed boolean value + * through 'boolval'. + */ + +#define NVGETOPT_IS_BOOLEAN 0x01 + + +/* + * indicates that the option takes an argument to be interpreted as a + * string; on success, nvgetopt will return the parsed string argument + * through 'strval'. + */ + +#define NVGETOPT_STRING_ARGUMENT 0x02 + + +/* + * indicates that the option takes an argument to be interpreted as an + * integer; on success, nvgetopt will return the parsed integer + * argument through 'intval'. + */ + +#define NVGETOPT_INTEGER_ARGUMENT 0x04 + + +/* + * indicates that the option takes an argument to be interpreted as + * an double; on success, nvgetopt will return the parsed double + * argument through 'doubleval'. + */ + +#define NVGETOPT_DOUBLE_ARGUMENT 0x08 + + +/* helper macro */ + +#define NVGETOPT_HAS_ARGUMENT (NVGETOPT_STRING_ARGUMENT | \ + NVGETOPT_INTEGER_ARGUMENT | \ + NVGETOPT_DOUBLE_ARGUMENT) + +/* + * indicates that the option, which normally takes an argument, can be + * disabled if the option is prepended with '--no-', in which case, + * the option does not take an argument. If the option is disabled, + * nvgetopt will return TRUE through 'disable_val'. + * + * Note that NVGETOPT_ALLOW_DISABLE can only be used with options that + * take arguments. + */ + +#define NVGETOPT_ALLOW_DISABLE 0x10 + + +/* + * indicates that the argument for this option is optional; if no + * argument is present (either the option is already at the end of the + * argv array, or the next option in argv starts with '-'), then the + * option is returned without an argument. + */ + +#define NVGETOPT_ARGUMENT_IS_OPTIONAL 0x20 + + +/* + * The NVGETOPT_HELP_ALWAYS flag is not used by nvgetopt() itself, but + * is often used by other users of NVGetoptOption tables, who print + * out basic and advanced help. In such cases, OPTION_HELP_ALWAYS is + * used to indicate that the help for the option should always be + * printed. + */ + +#define NVGETOPT_HELP_ALWAYS 0x40 + + +typedef struct { + const char *name; + int val; + unsigned int flags; + char *arg_name; /* not used by nvgetopt() */ + char *description; /* not used by nvgetopt() */ +} NVGetoptOption; + + +/* + * nvgetopt() - see the glibc getopt_long(3) manpage for usage + * description. Options can be prepended with "--", "-", or "--no-". + * + * A global variable stores the current index into the argv array, so + * subsequent calls to nvgetopt() will advance through argv[]. + * + * On success, the matching NVGetoptOption.val is returned. + * + * If the NVGETOPT_IS_BOOLEAN flag is set, boolval will be set to TRUE + * (or FALSE, if the option string was prepended with "--no-"). + * + * disable_val will be assigned TRUE if the option string was + * prepended with "--no-", otherwise it will be assigned FALSE. + * + * If an argument is successfully parsed, one of strval, intval, or + * doubleval will be assigned, based on which of + * NVGETOPT_STRING_ARGUMENT, NVGETOPT_INTEGER_ARGUMENT, or + * NVGETOPT_DOUBLE_ARGUMENT is set in the option's flags. If strval + * is assigned to a non-NULL value by nvgetopt, then it is the + * caller's responsibility to free the string when done with it. + * + * On failure, an error is printed to stderr, and 0 is returned. + * + * When there are no more options to parse, -1 is returned. + */ + +int nvgetopt(int argc, + char *argv[], + const NVGetoptOption *options, + char **strval, + int *boolval, + int *intval, + double *doubleval, + int *disable_val); + + +#endif /* __NVGETOPT_H__ */ diff --git a/common-utils/src.mk b/common-utils/src.mk new file mode 100644 index 0000000..b93479e --- /dev/null +++ b/common-utils/src.mk @@ -0,0 +1,7 @@ +# makefile fragment included by nvidia-xconfig, nvidia-settings, and nvidia-installer + +COMMON_UTILS_SRC += nvgetopt.c + +COMMON_UTILS_EXTRA_DIST += nvgetopt.h +COMMON_UTILS_EXTRA_DIST += src.mk + diff --git a/dist-files.mk b/dist-files.mk index 430ebf7..26c92df 100644 --- a/dist-files.mk +++ b/dist-files.mk @@ -39,7 +39,6 @@ SRC += install-from-cwd.c SRC += kernel.c SRC += log.c SRC += misc.c -SRC += nvgetopt.c SRC += nvidia-installer.c SRC += precompiled.c SRC += snarf-ftp.c @@ -62,7 +61,6 @@ DIST_FILES += files.h DIST_FILES += format.h DIST_FILES += kernel.h DIST_FILES += misc.h -DIST_FILES += nvgetopt.h DIST_FILES += nvidia-installer-ui.h DIST_FILES += nvidia-installer.h DIST_FILES += option_table.h @@ -588,21 +588,18 @@ int set_destinations(Options *op, Package *p) path = ""; break; - /* - * XXX should the OpenGL headers and documentation also go - * under the OpenGL installation prefix? The Linux OpenGL - * ABI requires that the header files be installed in - * /usr/include/GL/. - */ - - case FILE_TYPE_OPENGL_HEADER: - case FILE_TYPE_CUDA_HEADER: - case FILE_TYPE_VDPAU_HEADER: - prefix = op->opengl_prefix; - dir = op->opengl_incdir; - path = p->entries[i].path; + case FILE_TYPE_NVCUVID_LIB: + case FILE_TYPE_NVCUVID_SYMLINK: + if (p->entries[i].flags & FILE_CLASS_COMPAT32) { + prefix = op->compat32_prefix; + dir = op->compat32_libdir; + } else { + prefix = op->opengl_prefix; + dir = op->opengl_libdir; + } + path = ""; break; - + case FILE_TYPE_INSTALLER_BINARY: prefix = op->utility_prefix; dir = op->utility_bindir; @@ -1203,7 +1200,6 @@ int install_file(Options *op, const char *srcfile, int install_symlink(Options *op, const char *linkname, const char *dstfile) { - int retval; char *dirc, *dname; dirc = nvstrdup(dstfile); diff --git a/install-from-cwd.c b/install-from-cwd.c index 292d0a3..36d5e70 100644 --- a/install-from-cwd.c +++ b/install-from-cwd.c @@ -171,10 +171,6 @@ int install_from_cwd(Options *op) if (!get_prefixes(op)) goto failed; - /* ask if we should install the OpenGL header files */ - - should_install_opengl_headers(op, p); - /* * select the appropriate TLS class, modifying the package as * necessary. @@ -677,10 +673,6 @@ static Package *parse_manifest (Options *op) p->entries[n].flags |= FILE_TYPE_KERNEL_MODULE_SRC; else if (strcmp(flag, "KERNEL_MODULE_CMD") == 0) p->entries[n].flags |= FILE_TYPE_KERNEL_MODULE_CMD; - else if (strcmp(flag, "OPENGL_HEADER") == 0) - p->entries[n].flags |= FILE_TYPE_OPENGL_HEADER; - else if (strcmp(flag, "CUDA_HEADER") == 0) - p->entries[n].flags |= FILE_TYPE_CUDA_HEADER; else if (strcmp(flag, "CUDA_ICD") == 0) p->entries[n].flags |= FILE_TYPE_CUDA_ICD; else if (strcmp(flag, "OPENGL_LIB") == 0) @@ -725,12 +717,14 @@ static Package *parse_manifest (Options *op) p->entries[n].flags |= FILE_TYPE_XMODULE_SYMLINK; else if (strcmp(flag, "XMODULE_NEWSYM") == 0) p->entries[n].flags |= FILE_TYPE_XMODULE_NEWSYM; - else if (strcmp(flag, "VDPAU_HEADER") == 0) - p->entries[n].flags |= FILE_TYPE_VDPAU_HEADER; else if (strcmp(flag, "VDPAU_LIB") == 0) p->entries[n].flags |= FILE_TYPE_VDPAU_LIB; else if (strcmp(flag, "VDPAU_SYMLINK") == 0) p->entries[n].flags |= FILE_TYPE_VDPAU_SYMLINK; + else if (strcmp(flag, "NVCUVID_LIB") == 0) + p->entries[n].flags |= FILE_TYPE_NVCUVID_LIB; + else if (strcmp(flag, "NVCUVID_LIB_SYMLINK") == 0) + p->entries[n].flags |= FILE_TYPE_NVCUVID_SYMLINK; else { nvfree(flag); goto invalid_manifest_file; @@ -79,6 +79,7 @@ static FILE *log_file_stream; void log_init(Options *op) { time_t now; + char *path; if (!op->logging) return; @@ -100,108 +101,126 @@ void log_init(Options *op) log_printf(op, TRUE, NULL, "installer version: %s", NVIDIA_INSTALLER_VERSION); log_printf(op, TRUE, NULL, ""); - + + path = getenv("PATH"); + log_printf(op, TRUE, NULL, "PATH: %s", STRSTR(path)); + log_printf(op, TRUE, NULL, ""); + log_printf(op, TRUE, NULL, "option status:"); - log_printf(op, TRUE, NULL, " license pre-accepted : %s", + log_printf(op, TRUE, NULL, " license pre-accepted : %s", BOOLSTR(op->accept_license)); - log_printf(op, TRUE, NULL, " update : %s", + log_printf(op, TRUE, NULL, " update : %s", BOOLSTR(op->update)); - log_printf(op, TRUE, NULL, " force update : %s", + log_printf(op, TRUE, NULL, " force update : %s", BOOLSTR(op->force_update)); - log_printf(op, TRUE, NULL, " expert : %s", + log_printf(op, TRUE, NULL, " expert : %s", BOOLSTR(op->expert)); - log_printf(op, TRUE, NULL, " uninstall : %s", + log_printf(op, TRUE, NULL, " uninstall : %s", BOOLSTR(op->uninstall)); - log_printf(op, TRUE, NULL, " driver info : %s", + log_printf(op, TRUE, NULL, " driver info : %s", BOOLSTR(op->driver_info)); - log_printf(op, TRUE, NULL, " precompiled interfaces : %s", + log_printf(op, TRUE, NULL, " precompiled interfaces : %s", BOOLSTR(!op->no_precompiled_interface)); - log_printf(op, TRUE, NULL, " no ncurses color : %s", + log_printf(op, TRUE, NULL, " no ncurses color : %s", BOOLSTR(op->no_ncurses_color)); - log_printf(op, TRUE, NULL, " query latest version : %s", + log_printf(op, TRUE, NULL, " query latest version : %s", BOOLSTR(op->latest)); - log_printf(op, TRUE, NULL, " OpenGL header files : %s", - BOOLSTR(op->opengl_headers)); - log_printf(op, TRUE, NULL, " no questions : %s", + log_printf(op, TRUE, NULL, " no questions : %s", BOOLSTR(op->no_questions)); - log_printf(op, TRUE, NULL, " silent : %s", + log_printf(op, TRUE, NULL, " silent : %s", BOOLSTR(op->silent)); - log_printf(op, TRUE, NULL, " no recursion : %s", + log_printf(op, TRUE, NULL, " no recursion : %s", BOOLSTR(op->no_recursion)); - log_printf(op, TRUE, NULL, " no backup : %s", + log_printf(op, TRUE, NULL, " no backup : %s", BOOLSTR(op->no_backup)); - log_printf(op, TRUE, NULL, " kernel module only : %s", + log_printf(op, TRUE, NULL, " kernel module only : %s", BOOLSTR(op->kernel_module_only)); - log_printf(op, TRUE, NULL, " sanity : %s", + log_printf(op, TRUE, NULL, " sanity : %s", BOOLSTR(op->sanity)); - log_printf(op, TRUE, NULL, " add this kernel : %s", + log_printf(op, TRUE, NULL, " add this kernel : %s", BOOLSTR(op->add_this_kernel)); - log_printf(op, TRUE, NULL, " no runlevel check : %s", + log_printf(op, TRUE, NULL, " no runlevel check : %s", BOOLSTR(op->no_runlevel_check)); - log_printf(op, TRUE, NULL, " no network : %s", + log_printf(op, TRUE, NULL, " no network : %s", BOOLSTR(op->no_network)); - log_printf(op, TRUE, NULL, " no ABI note : %s", + log_printf(op, TRUE, NULL, " no ABI note : %s", BOOLSTR(op->no_abi_note)); - log_printf(op, TRUE, NULL, " no RPMs : %s", + log_printf(op, TRUE, NULL, " no RPMs : %s", BOOLSTR(op->no_rpms)); - log_printf(op, TRUE, NULL, " no kernel module : %s", + log_printf(op, TRUE, NULL, " no kernel module : %s", BOOLSTR(op->no_kernel_module)); - log_printf(op, TRUE, NULL, " force SELinux : %s", + log_printf(op, TRUE, NULL, " force SELinux : %s", SELINUXSTR(op->selinux_option)); - log_printf(op, TRUE, NULL, " no X server check : %s", + log_printf(op, TRUE, NULL, " no X server check : %s", BOOLSTR(op->no_x_check)); - log_printf(op, TRUE, NULL, " no cc version check : %s", + log_printf(op, TRUE, NULL, " no cc version check : %s", BOOLSTR(op->ignore_cc_version_check)); - log_printf(op, TRUE, NULL, " force tls : %s", + log_printf(op, TRUE, NULL, " run distro scripts : %s", + BOOLSTR(op->run_distro_scripts)); + log_printf(op, TRUE, NULL, " no nouveau check : %s", + BOOLSTR(op->no_nouveau_check)); + log_printf(op, TRUE, NULL, " run nvidia-xconfig : %s", + BOOLSTR(op->run_nvidia_xconfig)); + log_printf(op, TRUE, NULL, " sigwinch work around : %s", + BOOLSTR(op->sigwinch_workaround)); + log_printf(op, TRUE, NULL, " force tls : %s", TLSSTR(op->which_tls)); #if defined(NV_X86_64) - log_printf(op, TRUE, NULL, " force compat32 tls : %s", + log_printf(op, TRUE, NULL, " force compat32 tls : %s", TLSSTR(op->which_tls_compat32)); #endif - log_printf(op, TRUE, NULL, " X install prefix : %s", + log_printf(op, TRUE, NULL, " X install prefix : %s", STRSTR(op->x_prefix)); - log_printf(op, TRUE, NULL, " X library install path : %s", + log_printf(op, TRUE, NULL, " X library install path : %s", STRSTR(op->x_library_path)); - log_printf(op, TRUE, NULL, " X module install path : %s", + log_printf(op, TRUE, NULL, " X module install path : %s", STRSTR(op->x_module_path)); - log_printf(op, TRUE, NULL, " OpenGL install prefix : %s", + log_printf(op, TRUE, NULL, " OpenGL install prefix : %s", STRSTR(op->opengl_prefix)); - log_printf(op, TRUE, NULL, " OpenGL install libdir : %s", + log_printf(op, TRUE, NULL, " OpenGL install libdir : %s", STRSTR(op->opengl_libdir)); #if defined(NV_X86_64) - log_printf(op, TRUE, NULL, " compat32 install chroot : %s", + log_printf(op, TRUE, NULL, " compat32 install chroot : %s", STRSTR(op->compat32_chroot)); - log_printf(op, TRUE, NULL, " compat32 install prefix : %s", + log_printf(op, TRUE, NULL, " compat32 install prefix : %s", STRSTR(op->compat32_prefix)); - log_printf(op, TRUE, NULL, " compat32 install libdir : %s", + log_printf(op, TRUE, NULL, " compat32 install libdir : %s", STRSTR(op->compat32_libdir)); #endif - log_printf(op, TRUE, NULL, " utility install prefix : %s", + log_printf(op, TRUE, NULL, " utility install prefix : %s", STRSTR(op->utility_prefix)); - log_printf(op, TRUE, NULL, " utility install libdir : %s", + log_printf(op, TRUE, NULL, " utility install libdir : %s", STRSTR(op->utility_libdir)); - log_printf(op, TRUE, NULL, " doc install prefix : %s", + log_printf(op, TRUE, NULL, " installer prefix : %s", + STRSTR(op->installer_prefix)); + log_printf(op, TRUE, NULL, " doc install prefix : %s", STRSTR(op->documentation_prefix)); - log_printf(op, TRUE, NULL, " kernel name : %s", + log_printf(op, TRUE, NULL, " kernel name : %s", STRSTR(op->kernel_name)); - log_printf(op, TRUE, NULL, " kernel include path : %s", + log_printf(op, TRUE, NULL, " kernel include path : %s", STRSTR(op->kernel_include_path)); - log_printf(op, TRUE, NULL, " kernel source path : %s", + log_printf(op, TRUE, NULL, " kernel source path : %s", STRSTR(op->kernel_source_path)); - log_printf(op, TRUE, NULL, " kernel output path : %s", + log_printf(op, TRUE, NULL, " kernel output path : %s", STRSTR(op->kernel_output_path)); - log_printf(op, TRUE, NULL, " kernel install path : %s", + log_printf(op, TRUE, NULL, " kernel install path : %s", STRSTR(op->kernel_module_installation_path)); - log_printf(op, TRUE, NULL, " proc mount point : %s", + log_printf(op, TRUE, NULL, " precompiled kernel interfaces path : %s", + STRSTR(op->precompiled_kernel_interfaces_path)); + log_printf(op, TRUE, NULL, " precompiled kernel interfaces url : %s", + STRSTR(op->precompiled_kernel_interfaces_url)); + log_printf(op, TRUE, NULL, " proc mount point : %s", STRSTR(op->proc_mount_point)); - log_printf(op, TRUE, NULL, " ui : %s", + log_printf(op, TRUE, NULL, " ui : %s", STRSTR(op->ui_str)); - log_printf(op, TRUE, NULL, " tmpdir : %s", + log_printf(op, TRUE, NULL, " tmpdir : %s", STRSTR(op->tmpdir)); - log_printf(op, TRUE, NULL, " ftp mirror : %s", + log_printf(op, TRUE, NULL, " ftp mirror : %s", STRSTR(op->ftp_site)); - log_printf(op, TRUE, NULL, " RPM file list : %s", + log_printf(op, TRUE, NULL, " RPM file list : %s", STRSTR(op->rpm_file_list)); + log_printf(op, TRUE, NULL, " selinux chcon type : %s", + STRSTR(op->selinux_chcon_type)); log_printf(op, TRUE, NULL, ""); @@ -211,7 +230,7 @@ void log_init(Options *op) /* - * log_printf() - if the logggin option is set, this function writes + * log_printf() - if the logging option is set, this function writes * the given printf-style input to the log_file_stream; if the logging * option is not set, then nothing is done here. */ @@ -1095,54 +1095,6 @@ char *extract_version_string(const char *str) /* - * should_install_opengl_headers() - if in expert mode, ask the user - * if they want to install OpenGL header files. - */ - -void should_install_opengl_headers(Options *op, Package *p) -{ - int i, have_headers = FALSE; - - if (!op->expert) return; - - /* - * first, scan through the package to see if we have any header - * files to install - */ - - for (i = 0; i < p->num_entries; i++) { - if (p->entries[i].flags & FILE_TYPE_OPENGL_HEADER) { - have_headers = TRUE; - break; - } - } - - if (!have_headers) return; - - /* - * If we're to provide more verbose descriptions, we could present - * something like this: - * - * ("The %s provides OpenGL header files; these are used when - * compiling OpenGL applications. Most Linux distributions - * already have OpenGL header files installed (normally in the - * /usr/include/GL/ directory). If you don't have OpenGL header - * files installed and would like to, or if you want to develop - * OpenGL applications that take advantage of NVIDIA OpenGL - * extensions, then you can install NVIDIA's OpenGL header files - * at this time.", p->description); - */ - - op->opengl_headers = ui_yes_no(op, op->opengl_headers, - "Install NVIDIA's OpenGL header files?"); - - ui_expert(op, "Installation %s install the OpenGL header files.", - op->opengl_headers ? "will" : "will not"); - -} /* should_install_opengl_headers() */ - - -/* * should_install_compat32_files() - ask the user if he/she wishes to * install 32bit compatibily libraries. */ @@ -1359,7 +1311,6 @@ static int check_file(Options *op, const char *filename, uint64_t get_installable_file_mask(Options *op) { uint64_t installable_files = FILE_TYPE_INSTALLABLE_FILE; - if (!op->opengl_headers) installable_files &= ~FILE_TYPE_OPENGL_HEADER; return installable_files; @@ -2417,7 +2368,7 @@ done: * Determine if the nouveau driver is currently in use. We do the * equivalent of: * - * ls -l /sys/bus/pci/devices/*\/driver | grep nouveau + * ls -l /sys/bus/pci/devices/ /driver | grep nouveau * * The directory structure under /sys/bus/pci/devices/ should contain * a directory for each PCI device, and for those devices with a diff --git a/nvgetopt.h b/nvgetopt.h deleted file mode 100644 index d7c5f1b..0000000 --- a/nvgetopt.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * nvidia-installer: A tool for installing/un-installing the - * NVIDIA Linux graphics driver. - * - * Copyright (C) 2004-2010 NVIDIA Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the: - * - * Free Software Foundation, Inc. - * 59 Temple Place - Suite 330 - * Boston, MA 02111-1307, USA - * - * - * nvgetopt.h - */ - -#ifndef __NVGETOPT_H__ -#define __NVGETOPT_H__ - -#define NVGETOPT_FALSE 0 -#define NVGETOPT_TRUE 1 - -/* - * indicates that the option is a boolean value; the presence of the - * option will be interpretted as a TRUE value; if the option is - * prepended with '--no-', the option will be interpretted as a FALSE - * value. On success, nvgetopt will return the parsed boolean value - * through 'boolval'. - */ - -#define NVGETOPT_IS_BOOLEAN 0x1 - - -/* - * indicates that the option takes an argument to be interpretted as a - * string; on success, nvgetopt will return the parsed string argument - * through 'strval'. - */ - -#define NVGETOPT_STRING_ARGUMENT 0x2 - - -#define NVGETOPT_HAS_ARGUMENT (NVGETOPT_STRING_ARGUMENT) - -#define NVGETOPT_HELP_ALWAYS 0x20 - -typedef struct { - const char *name; - int val; - unsigned int flags; - char *description; /* not used by nvgetopt() */ -} NVGetoptOption; - - -int nvgetopt(int argc, char *argv[], const NVGetoptOption *options, - char **strval); - -#endif /* __NVGETOPT_H__ */ diff --git a/nvidia-installer.c b/nvidia-installer.c index 0269533..f078d71 100644 --- a/nvidia-installer.c +++ b/nvidia-installer.c @@ -121,7 +121,6 @@ static Options *load_default_options(void) op->distro = get_distribution(op); op->logging = TRUE; /* log by default */ - op->opengl_headers = TRUE; /* We now install our GL headers by default */ op->run_nvidia_xconfig = FALSE; op->selinux_option = SELINUX_DEFAULT; @@ -145,12 +144,16 @@ static Options *load_default_options(void) static void parse_commandline(int argc, char *argv[], Options *op) { - int c, boolval; + int c; char *strval = NULL, *program_name = NULL; while (1) { - c = nvgetopt(argc, argv, __options, &strval); + c = nvgetopt(argc, argv, __options, &strval, + NULL, /* boolval */ + NULL, /* intval */ + NULL, /* doubleval */ + NULL); /* disable_val */ if (c == -1) break; @@ -240,8 +243,6 @@ static void parse_commandline(int argc, char *argv[], Options *op) print_help_args_only(TRUE, FALSE); exit(0); break; case TMPDIR_OPTION: op->tmpdir = strval; break; - case NO_OPENGL_HEADERS_OPTION: - op->opengl_headers = FALSE; break; case FORCE_TLS_OPTION: if (strcasecmp(strval, "new") == 0) op->which_tls = FORCE_NEW_TLS; diff --git a/nvidia-installer.h b/nvidia-installer.h index ed12589..4589980 100644 --- a/nvidia-installer.h +++ b/nvidia-installer.h @@ -119,7 +119,6 @@ typedef struct __options { int no_ncurses_color; int latest; int force_update; - int opengl_headers; int no_questions; int silent; int which_tls; @@ -296,11 +295,11 @@ typedef struct { /* file types */ -#define FILE_TYPE_MASK 0x00000000ffffffffULL +#define FILE_TYPE_MASK 0x0000000fffffffffULL #define FILE_TYPE_KERNEL_MODULE_SRC 0x0000000000000001ULL #define FILE_TYPE_KERNEL_MODULE_CMD 0x0000000000000002ULL -#define FILE_TYPE_OPENGL_HEADER 0x0000000000000004ULL +/* unused 0x0000000000000004ULL */ #define FILE_TYPE_OPENGL_LIB 0x0000000000000008ULL #define FILE_TYPE_XLIB_STATIC_LIB 0x0000000000000010ULL #define FILE_TYPE_XLIB_SHARED_LIB 0x0000000000000020ULL @@ -321,14 +320,17 @@ typedef struct { /* Create a symlink only if the file doesn't exist */ #define FILE_TYPE_XMODULE_NEWSYM 0x0000000000100000ULL #define FILE_TYPE_MANPAGE 0x0000000000200000ULL -#define FILE_TYPE_CUDA_HEADER 0x0000000000400000ULL +/* unused 0x0000000000400000ULL */ #define FILE_TYPE_CUDA_LIB 0x0000000000800000ULL #define FILE_TYPE_CUDA_SYMLINK 0x0000000001000000ULL #define FILE_TYPE_VDPAU_LIB 0x0000000002000000ULL #define FILE_TYPE_VDPAU_SYMLINK 0x0000000004000000ULL -#define FILE_TYPE_VDPAU_HEADER 0x0000000008000000ULL +/* unused 0x0000000008000000ULL */ #define FILE_TYPE_UTILITY_BIN_SYMLINK 0x0000000010000000ULL #define FILE_TYPE_CUDA_ICD 0x0000000020000000ULL +#define FILE_TYPE_NVCUVID_LIB 0x0000000040000000ULL +#define FILE_TYPE_NVCUVID_SYMLINK 0x0000000080000000ULL +/* unused 0x0000000100000000ULL */ /* file class: this is used to distinguish OpenGL libraries */ @@ -352,8 +354,6 @@ typedef struct { FILE_TYPE_UTILITY_LIB | \ FILE_TYPE_DOCUMENTATION | \ FILE_TYPE_MANPAGE | \ - FILE_TYPE_OPENGL_HEADER | \ - FILE_TYPE_CUDA_HEADER | \ FILE_TYPE_CUDA_ICD | \ FILE_TYPE_KERNEL_MODULE | \ FILE_TYPE_INSTALLER_BINARY | \ @@ -362,23 +362,21 @@ typedef struct { FILE_TYPE_XMODULE_LIB | \ FILE_TYPE_DOT_DESKTOP | \ FILE_TYPE_VDPAU_LIB | \ - FILE_TYPE_VDPAU_HEADER) + FILE_TYPE_NVCUVID_LIB) #define FILE_TYPE_HAVE_PATH (FILE_TYPE_XMODULE_LIB | \ FILE_TYPE_XMODULE_SYMLINK | \ FILE_TYPE_XMODULE_NEWSYM | \ FILE_TYPE_MANPAGE | \ - FILE_TYPE_OPENGL_HEADER | \ FILE_TYPE_CUDA_LIB | \ FILE_TYPE_CUDA_SYMLINK | \ - FILE_TYPE_CUDA_HEADER | \ FILE_TYPE_TLS_LIB | \ FILE_TYPE_TLS_SYMLINK | \ FILE_TYPE_DOT_DESKTOP | \ FILE_TYPE_DOCUMENTATION | \ FILE_TYPE_VDPAU_SYMLINK | \ - FILE_TYPE_VDPAU_LIB | \ - FILE_TYPE_VDPAU_HEADER) + FILE_TYPE_VDPAU_LIB) + #define FILE_TYPE_HAVE_ARCH (FILE_TYPE_OPENGL_LIB | \ FILE_TYPE_CUDA_LIB | \ @@ -388,7 +386,9 @@ typedef struct { FILE_TYPE_TLS_LIB | \ FILE_TYPE_TLS_SYMLINK | \ FILE_TYPE_VDPAU_SYMLINK | \ - FILE_TYPE_VDPAU_LIB) + FILE_TYPE_VDPAU_LIB | \ + FILE_TYPE_NVCUVID_LIB | \ + FILE_TYPE_NVCUVID_SYMLINK) #define FILE_TYPE_HAVE_CLASS (FILE_TYPE_TLS_LIB | \ FILE_TYPE_TLS_SYMLINK) @@ -400,7 +400,8 @@ typedef struct { FILE_TYPE_XMODULE_SYMLINK | \ FILE_TYPE_UTILITY_LIB_SYMLINK| \ FILE_TYPE_UTILITY_BIN_SYMLINK| \ - FILE_TYPE_VDPAU_SYMLINK) + FILE_TYPE_VDPAU_SYMLINK | \ + FILE_TYPE_NVCUVID_SYMLINK) #define FILE_TYPE_NEWSYM (FILE_TYPE_XMODULE_NEWSYM) @@ -416,7 +417,8 @@ typedef struct { FILE_TYPE_TLS_LIB | \ FILE_TYPE_XMODULE_SHARED_LIB | \ FILE_TYPE_UTILITY_LIB | \ - FILE_TYPE_VDPAU_LIB) + FILE_TYPE_VDPAU_LIB | \ + FILE_TYPE_NVCUVID_LIB) #define TLS_LIB_TYPE_FORCED 0x0001 #define TLS_LIB_NEW_TLS 0x0002 diff --git a/option_table.h b/option_table.h index 1d2a644..cfbef82 100644 --- a/option_table.h +++ b/option_table.h @@ -42,7 +42,6 @@ enum { LOG_FILE_NAME_OPTION, HELP_ARGS_ONLY_OPTION, TMPDIR_OPTION, - NO_OPENGL_HEADERS_OPTION, INSTALLER_PREFIX_OPTION, FORCE_TLS_OPTION, SANITY_OPTION, @@ -80,51 +79,51 @@ enum { static const NVGetoptOption __options[] = { /* These options are printed by "nvidia-installer --help" */ - { "accept-license", 'a', NVGETOPT_HELP_ALWAYS, + { "accept-license", 'a', NVGETOPT_HELP_ALWAYS, NULL, "Bypass the display and prompting for acceptance of the " "NVIDIA Software License Agreement. By passing this option to " "nvidia-installer, you indicate that you have read and accept the " "License Agreement contained in the file 'LICENSE' (in the top " "level directory of the driver package)." }, - { "update", UPDATE_OPTION, NVGETOPT_HELP_ALWAYS, - "Connect to the NVIDIA FTP server ' " DEFAULT_FTP_SITE " ' and determine the " - "latest available driver version. If there is a more recent " - "driver available, automatically download and install it. Any " + { "update", UPDATE_OPTION, NVGETOPT_HELP_ALWAYS, NULL, + "Connect to the NVIDIA FTP server ' " DEFAULT_FTP_SITE " ' and " + "determine the latest available driver version. If there is a more " + "recent driver available, automatically download and install it. Any " "other options given on the commandline will be passed on to the " "downloaded driver package when installing it." }, - { "version", 'v', NVGETOPT_HELP_ALWAYS, + { "version", 'v', NVGETOPT_HELP_ALWAYS, NULL, "Print the nvidia-installer version and exit." }, - { "help", 'h', NVGETOPT_HELP_ALWAYS, + { "help", 'h', NVGETOPT_HELP_ALWAYS, NULL, "Print usage information for the common commandline options " "and exit." }, - { "advanced-options", 'A', NVGETOPT_HELP_ALWAYS, + { "advanced-options", 'A', NVGETOPT_HELP_ALWAYS, NULL, "Print usage information for the common commandline options " "as well as the advanced options, and then exit." }, /* These options are only printed by "nvidia-installer --advanced-help" */ - { "driver-info", 'i', 0, + { "driver-info", 'i', 0, NULL, "Print information about the currently installed NVIDIA " "driver version." }, - { "uninstall", UNINSTALL_OPTION, 0, + { "uninstall", UNINSTALL_OPTION, 0, NULL, "Uninstall the currently installed NVIDIA driver." }, - { "sanity", SANITY_OPTION, 0, + { "sanity", SANITY_OPTION, 0, NULL, "Perform basic sanity tests on an existing NVIDIA " "driver installation." }, - { "expert", 'e', 0, + { "expert", 'e', 0, NULL, "Enable 'expert' installation mode; more detailed questions " "will be asked, and more verbose output will be printed; " "intended for expert users. The questions may be suppressed " "with the '--no-questions' commandline option." }, - { "no-questions", 'q', 0, + { "no-questions", 'q', 0, NULL, "Do not ask any questions; the default (normally 'yes') " "is assumed for " "all yes/no questions, and the default string is assumed in " @@ -133,22 +132,22 @@ static const NVGetoptOption __options[] = { "license acceptance; the license may be accepted with the " "commandline option '--accept-license'." }, - { "silent", 's', 0, + { "silent", 's', 0, NULL, "Run silently; no questions are asked and no output is " "printed, except for error messages to stderr. This option " "implies '--ui=none --no-questions --accept-license'." }, - { "x-prefix", X_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, + { "x-prefix", X_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The prefix under which the X components of the " "NVIDIA driver will be installed; the default is '" DEFAULT_X_PREFIX "' unless nvidia-installer detects that X.Org >= 7.0 is installed, " "in which case the default is '" XORG7_DEFAULT_X_PREFIX "'. Only " "under rare circumstances should this option be used." }, - { "xfree86-prefix", XFREE86_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, + { "xfree86-prefix", XFREE86_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "This is a deprecated synonym for --x-prefix." }, - { "x-module-path", X_MODULE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, + { "x-module-path", X_MODULE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The path under which the NVIDIA X server modules will be installed. " "If this option is not specified, nvidia-installer uses the following " "search order and selects the first valid directory it finds: 1) " @@ -158,7 +157,7 @@ static const NVGetoptOption __options[] = { "than X.Org 7.0) or '" XORG7_DEFAULT_X_MODULEDIR "' (for X.Org 7.0 or " "later)." }, - { "x-library-path", X_LIBRARY_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, + { "x-library-path", X_LIBRARY_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The path under which the NVIDIA X libraries will be installed. " "If this option is not specified, nvidia-installer uses the following " "search order and selects the first valid directory it finds: 1) " @@ -168,14 +167,14 @@ static const NVGetoptOption __options[] = { DEFAULT_64BIT_LIBDIR "' or '" DEFAULT_LIBDIR "' on 64bit systems, " "depending on the installed Linux distribution." }, - { "opengl-prefix", OPENGL_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, + { "opengl-prefix", OPENGL_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The prefix under which the OpenGL components of the " "NVIDIA driver will be installed; the default is: '" DEFAULT_OPENGL_PREFIX "'. Only under rare circumstances should this option be used. " "The Linux OpenGL ABI (http://oss.sgi.com/projects/ogl-sample/ABI/) " "mandates this default value." }, - { "opengl-libdir", OPENGL_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, + { "opengl-libdir", OPENGL_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The path relative to the OpenGL library installation prefix under " "which the NVIDIA OpenGL components will be installed. The " "default is '" DEFAULT_LIBDIR "' on 32bit systems, and '" @@ -185,6 +184,7 @@ static const NVGetoptOption __options[] = { #if defined(NV_X86_64) { "compat32-chroot", COMPAT32_CHROOT_OPTION, NVGETOPT_STRING_ARGUMENT, + NULL, "The top-level prefix (chroot) relative to which the 32bit " "compatibility OpenGL libraries will be installed on Linux/x86-64 " "systems; this option is unset by default, the 32bit OpenGL " @@ -193,12 +193,14 @@ static const NVGetoptOption __options[] = { "circumstances should this option be used." }, { "compat32-prefix", COMPAT32_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, + NULL, "The prefix under which the 32bit compatibility OpenGL components " "of the NVIDIA driver will be installed; the default is: '" DEFAULT_OPENGL_PREFIX "'. Only under rare circumstances should " "this option be used." }, { "compat32-libdir", COMPAT32_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, + NULL, "The path relative to the 32bit compatibility prefix under which the " "32bit compatibility OpenGL components of the NVIDIA driver will " "be installed. The default is '" DEFAULT_LIBDIR "' or '" @@ -208,35 +210,39 @@ static const NVGetoptOption __options[] = { #endif /* NV_X86_64 */ { "installer-prefix", INSTALLER_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, + NULL, "The prefix under which the installer binary will be " "installed; the default is: '" DEFAULT_UTILITY_PREFIX "'. Note: please " "use the '--utility-prefix' option instead." }, - { "utility-prefix", UTILITY_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, + { "utility-prefix", UTILITY_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The prefix under which the NVIDIA utilities (nvidia-installer, " "nvidia-settings, nvidia-xconfig, nvidia-bug-report.sh) and the NVIDIA " "utility libraries will be installed; the default is: '" DEFAULT_UTILITY_PREFIX "'." }, - { "utility-libdir", UTILITY_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, + { "utility-libdir", UTILITY_LIBDIR_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The path relative to the utility installation prefix under which the " "NVIDIA utility libraries will be installed. The default is '" DEFAULT_LIBDIR "' on 32bit systems, and '" DEFAULT_64BIT_LIBDIR "' or '" DEFAULT_LIBDIR "' on 64bit " "systems, depending on the " "installed Linux distribution." }, - { "documentation-prefix", DOCUMENTATION_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, + { "documentation-prefix", DOCUMENTATION_PREFIX_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "The prefix under which the documentation files for the NVIDIA " "driver will be installed. The default is: '" DEFAULT_DOCUMENTATION_PREFIX "'." }, - { "kernel-include-path", KERNEL_INCLUDE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, + { "kernel-include-path", KERNEL_INCLUDE_PATH_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "The directory containing the kernel include files that " "should be used when compiling the NVIDIA kernel module. " "This option is deprecated; please use '--kernel-source-path' " "instead." }, - { "kernel-source-path", KERNEL_SOURCE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, + { "kernel-source-path", KERNEL_SOURCE_PATH_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "The directory containing the kernel source files that " "should be used when compiling the NVIDIA kernel module. " "When not specified, the installer will use " @@ -244,20 +250,23 @@ static const NVGetoptOption __options[] = { "directory exists. Otherwise, it will use " "'/usr/src/linux'." }, - { "kernel-output-path", KERNEL_OUTPUT_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, + { "kernel-output-path", KERNEL_OUTPUT_PATH_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "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." }, - { "kernel-install-path", KERNEL_INSTALL_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, + { "kernel-install-path", KERNEL_INSTALL_PATH_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "The directory in which the NVIDIA kernel module should be " "installed. The default value is either '/lib/modules/`uname " "-r`/kernel/drivers/video' (if '/lib/modules/`uname -r`/kernel' " "exists) or '/lib/modules/`uname -r`/video'." }, { "proc-mount-point", PROC_MOUNT_POINT_OPTION, NVGETOPT_STRING_ARGUMENT, + NULL, "The mount point for the proc file system; if not " "specified, then this value defaults to '" DEFAULT_PROC_MOUNT_POINT "' (which is normally " @@ -267,49 +276,44 @@ static const NVGetoptOption __options[] = { "the currently running kernel. This option should only be needed " "in very rare circumstances." }, - { "log-file-name", LOG_FILE_NAME_OPTION, NVGETOPT_STRING_ARGUMENT, + { "log-file-name", LOG_FILE_NAME_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "File name of the installation log file (the default is: " "'" DEFAULT_LOG_FILE_NAME "')." }, - { "tmpdir", TMPDIR_OPTION, NVGETOPT_STRING_ARGUMENT, + { "tmpdir", TMPDIR_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "Use the specified directory as a temporary directory when " "downloading files from the NVIDIA ftp site; " "if not given, then the following list will be searched, and " "the first one that exists will be used: $TMPDIR, /tmp, ., " "$HOME." }, - { "ftp-mirror", 'm', NVGETOPT_STRING_ARGUMENT, + { "ftp-mirror", 'm', NVGETOPT_STRING_ARGUMENT, NULL, "Use the specified FTP mirror rather than the default ' " DEFAULT_FTP_SITE " ' when downloading driver updates." }, - { "latest", 'l', 0, + { "latest", 'l', 0, NULL, "Connect to the NVIDIA FTP server ' " DEFAULT_FTP_SITE " ' " "(or use the ftp mirror " "specified with the '--ftp-mirror' option) and query the most " "recent " INSTALLER_OS "-" INSTALLER_ARCH " driver version number." }, - { "force-update", 'f', 0, + { "force-update", 'f', 0, NULL, "Forces an update to proceed, even if the installer " "thinks the latest driver is already installed; this option " "implies '--update'." }, - { "ui", USER_INTERFACE_OPTION, NVGETOPT_STRING_ARGUMENT, + { "ui", USER_INTERFACE_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "Specify what user interface to use, if available. " "Valid values for [UI] are 'ncurses' (the default) or 'none'. " "If the ncurses interface fails to initialize, or 'none' " "is specified, then a simple printf/scanf interface will " "be used." }, - { "no-ncurses-color", 'c', 0, + { "no-ncurses-color", 'c', 0, NULL, "Disable use of color in the ncurses user interface." }, - { "no-opengl-headers", NO_OPENGL_HEADERS_OPTION, 0, - "Normally, installation will install NVIDIA's OpenGL " - "header files. This option disables installation of the NVIDIA " - "OpenGL header files." }, - - { "force-tls", FORCE_TLS_OPTION, NVGETOPT_STRING_ARGUMENT, + { "force-tls", FORCE_TLS_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "NVIDIA's OpenGL libraries are compiled with one of two " "different thread local storage (TLS) mechanisms: 'classic tls' " "which is used on systems with glibc 2.2 or older, and 'new tls' " @@ -320,13 +324,14 @@ static const NVGetoptOption __options[] = { "for [FORCE-TLS] are 'new' and 'classic'." }, #if defined(NV_X86_64) - { "force-tls-compat32", FORCE_TLS_COMPAT32_OPTION, NVGETOPT_STRING_ARGUMENT, + { "force-tls-compat32", FORCE_TLS_COMPAT32_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "This option forces the installer to install a specific " "32bit compatibility OpenGL TLS library; further details " "can be found in the description of the '--force-tls' option." }, #endif /* NV_X86_64 */ - { "kernel-name", 'k', NVGETOPT_STRING_ARGUMENT, + { "kernel-name", 'k', NVGETOPT_STRING_ARGUMENT, NULL, "Build and install the NVIDIA kernel module for the " "non-running kernel specified by [KERNEL-NAME] ([KERNEL-NAME] " "should be the output of `uname -r` when the target kernel is " @@ -337,10 +342,10 @@ static const NVGetoptOption __options[] = { "'/lib/modules/[KERNEL-NAME]/kernel/drivers/video/' and " "'/lib/modules/[KERNEL-NAME]/build/', respectively." }, - { "no-precompiled-interface", 'n', 0, + { "no-precompiled-interface", 'n', 0, NULL, "Disable use of precompiled kernel interfaces." }, - { "no-runlevel-check", NO_RUNLEVEL_CHECK_OPTION, 0, + { "no-runlevel-check", NO_RUNLEVEL_CHECK_OPTION, 0, NULL, "Normally, the installer checks the current runlevel and " "warns users if they are in runlevel 1: in runlevel 1, some " "services that are normally active are disabled (such as devfs), " @@ -348,36 +353,36 @@ static const NVGetoptOption __options[] = { "kernel module configuration files. This option disables the " "runlevel check." }, - { "no-abi-note", NO_ABI_NOTE_OPTION, 0, + { "no-abi-note", NO_ABI_NOTE_OPTION, 0, NULL, "The NVIDIA OpenGL libraries contain an OS ABI note tag, " "which identifies the minimum kernel version needed to use the " "library. This option causes the installer to remove this note " "from the OpenGL libraries during installation." }, - { "no-rpms", NO_RPMS_OPTION, 0, + { "no-rpms", NO_RPMS_OPTION, 0, NULL, "Normally, the installer will check for several rpms that " "conflict with the driver (specifically: NVIDIA_GLX and " "NVIDIA_kernel), and remove them if present. This option " "disables this check." }, - { "no-backup", 'b', 0, + { "no-backup", 'b', 0, NULL, "During driver installation, conflicting files are backed " "up, so that they can be restored when the driver is " "uninstalled. This option causes the installer to simply delete " "conflicting files, rather than back them up." }, - { "no-network", 'N', 0, + { "no-network", 'N', 0, NULL, "This option instructs the installer to not attempt to " "connect to the NVIDIA ftp site (for updated precompiled kernel " "interfaces, for example)." }, - { "no-recursion", NO_RECURSION_OPTION, 0, + { "no-recursion", NO_RECURSION_OPTION, 0, NULL, "Normally, nvidia-installer will recursively search for " "potentially conflicting libraries under the default OpenGL " "and X server installation locations. With this option set, " "the installer will only search in the top-level directories." }, - { "kernel-module-only", 'K', 0, + { "kernel-module-only", 'K', 0, NULL, "Install a kernel module only, and do not uninstall the " "existing driver. This is intended to be used to install kernel " "modules for additional kernels (in cases where you might boot " @@ -386,25 +391,27 @@ static const NVGetoptOption __options[] = { "installed driver must match the version of this kernel " "module." }, - { "no-kernel-module", NO_KERNEL_MODULE_OPTION, 0, + { "no-kernel-module", NO_KERNEL_MODULE_OPTION, 0, NULL, "Install everything but the kernel module, and do not remove any " "existing, possibly conflicting kernel modules. This can be " "useful in some DEBUG environments. If you use this option, you " "must be careful to ensure that a NVIDIA kernel module matching " "this driver version is installed seperately." }, - { "no-x-check", NO_X_CHECK_OPTION, 0, + { "no-x-check", NO_X_CHECK_OPTION, 0, NULL, "Do not abort the installation if nvidia-installer detects that " "an X server is running. Only under very rare circumstances should " "this option be used." }, { "precompiled-kernel-interfaces-path", - PRECOMPILED_KERNEL_INTERFACES_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, + PRECOMPILED_KERNEL_INTERFACES_PATH_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "Before searching for a precompiled kernel interface in the " ".run file, search in the specified directory." }, { "precompiled-kernel-interfaces-url", - PRECOMPILED_KERNEL_INTERFACES_URL_OPTION, NVGETOPT_STRING_ARGUMENT, + PRECOMPILED_KERNEL_INTERFACES_URL_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "If no precompiled kernel interfaces are found within the driver package " "or provided on the file system by the Linux distribution, check the " "specified URL for updates. NVIDIA does not intend to provide updated " @@ -412,11 +419,11 @@ static const NVGetoptOption __options[] = { "for distributing precompiled kernel interfaces in a local area " "network." }, - { "no-nouveau-check", 'z', 0, + { "no-nouveau-check", 'z', 0, NULL, "Normally, nvidia-installer aborts installation if the nouveau kernel " "driver is in use. Use this option to disable this check." }, - { "run-nvidia-xconfig", 'X', 0, + { "run-nvidia-xconfig", 'X', 0, NULL, "nvidia-installer can optionally invoke the nvidia-xconfig utility. " "This will update the system X configuration file so that the NVIDIA X " "driver is used. The pre-existing X configuration file will be backed " @@ -426,7 +433,7 @@ static const NVGetoptOption __options[] = { "'yes'. This is useful with the '--no-questions' or '--silent' " "options, which assume the default values for all questions." }, - { "force-selinux", FORCE_SELINUX_OPTION, NVGETOPT_STRING_ARGUMENT, + { "force-selinux", FORCE_SELINUX_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "Linux installations using SELinux (Security-Enhanced Linux) " "require that the security type of all shared libraries be set " "to 'shlib_t' or 'textrel_shlib_t', depending on the distribution. " @@ -441,19 +448,20 @@ static const NVGetoptOption __options[] = { "'no' (prevent setting of the security type), and 'default' " "(let nvidia-installer decide when to set the security type)." }, - { "selinux-chcon-type", SELINUX_CHCON_TYPE_OPTION, NVGETOPT_STRING_ARGUMENT, + { "selinux-chcon-type", SELINUX_CHCON_TYPE_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, "When SELinux support is enabled, nvidia-installer will try to determine " "which chcon argument to use by first trying 'textrel_shlib_t', then " "'texrel_shlib_t', then 'shlib_t'. Use this option to override this " "detection logic." }, - { "no-sigwinch-workaround", NO_SIGWINCH_WORKAROUND_OPTION, 0, + { "no-sigwinch-workaround", NO_SIGWINCH_WORKAROUND_OPTION, 0, NULL, "Normally, nvidia-installer ignores the SIGWINCH signal before it " "forks to execute commands, e.g. to build the kernel module, and " "restores the SIGWINCH signal handler after the child process " "has terminated. This option disables this behavior." }, - { "no-cc-version-check", NO_CC_VERSION_CHECK_OPTION, 0, + { "no-cc-version-check", NO_CC_VERSION_CHECK_OPTION, 0, NULL, "The NVIDIA kernel module should be compiled with the same compiler that " "was used to compile the currently running kernel. The layout of some " "Linux kernel data structures may be dependent on the version of gcc " @@ -464,19 +472,21 @@ static const NVGetoptOption __options[] = { "installation in case of failures. Use this option to override this " "check." }, - { "no-distro-scripts", NO_DISTRO_SCRIPTS_OPTION, 0, + { "no-distro-scripts", NO_DISTRO_SCRIPTS_OPTION, 0, NULL, "Normally, nvidia-installer will run scripts from /usr/lib/nvidia before " "and after installing or uninstalling the driver. Use this option to " "disable execution of these scripts." }, /* Orphaned options: These options were in the long_options table in * nvidia-installer.c but not in the help. */ - { "debug", 'd', 0, NULL }, - { "help-args-only", HELP_ARGS_ONLY_OPTION, 0, NULL }, - { "add-this-kernel", ADD_THIS_KERNEL_OPTION, 0, NULL }, - { "rpm-file-list", RPM_FILE_LIST_OPTION, NVGETOPT_STRING_ARGUMENT, NULL }, - { "no-rpms", NO_RPMS_OPTION, 0, NULL}, - { "advanced-options-args-only", ADVANCED_OPTIONS_ARGS_ONLY_OPTION, 0, NULL }, + { "debug", 'd', 0, NULL,NULL }, + { "help-args-only", HELP_ARGS_ONLY_OPTION, 0, NULL, NULL }, + { "add-this-kernel", ADD_THIS_KERNEL_OPTION, 0, NULL, NULL }, + { "rpm-file-list", RPM_FILE_LIST_OPTION, + NVGETOPT_STRING_ARGUMENT, NULL, NULL }, + { "no-rpms", NO_RPMS_OPTION, 0, NULL, NULL}, + { "advanced-options-args-only", ADVANCED_OPTIONS_ARGS_ONLY_OPTION, 0, + NULL, NULL }, { NULL, 0, 0, NULL }, }; @@ -33,7 +33,8 @@ CC ?= gcc LD ?= ld -CFLAGS ?= -Wall -fno-strict-aliasing +CFLAGS ?= +CFLAGS += -Wall -fno-strict-aliasing -Wno-unused-parameter CFLAGS += -O2 -fno-omit-frame-pointer CC_ONLY_CFLAGS ?= LDFLAGS ?= @@ -147,14 +148,15 @@ include $(wildcard $(OUTPUTDIR)/version.mk version.mk) # # Arguments: # $(1): CC command (CC or HOST_CC) -# $(2): object filename +# $(2): source filename +# $(3): object filename ############################################################################## ifeq ($(NV_AUTO_DEPEND),1) AUTO_DEP_CMD = && $($(1)) -MM $$(CFLAGS) $$< | $$(SED) \ -e "s,: ,: $$$$\(wildcard ," \ -e "s,\([^\\]\)$$$$,\1)," \ - -e "s;^$$(notdir $(2)): ;$(2): ;" \ + -e "s;^$$(addsuffix .o,$$(notdir $$(basename $(2)))): ;$(3): ;" \ > $$(@:.o=.d) else AUTO_DEP_CMD = @@ -244,7 +246,7 @@ define DEFINE_OBJECT_RULE_WITH_OBJECT_NAME $(3): $(2) @$(MKDIR) $(OUTPUTDIR) $$(call quiet_cmd,$(1)) -c $$< -o $$@ $$(CFLAGS) \ - $(call AUTO_DEP_CMD,$(1),$(3)) + $(call AUTO_DEP_CMD,$(1),$(2),$(3)) -include $$(call BUILD_DEPENDENCY_LIST,$(3)) @@ -1 +1 @@ -NVIDIA_VERSION = 256.53 +NVIDIA_VERSION = 260.19.04 |