summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2009-01-30 18:54:17 -0800
committerAaron Plattner <aplattner@nvidia.com>2009-01-30 18:54:17 -0800
commitb438e2b0767ba9c1c97fa0e1aadc1e532e553cd7 (patch)
tree313919d82915998a1108f65a130751865a5ff63d
parentfe8a484a3e91f5f220ed1a52a8bd03b675874e41 (diff)
173.14.16173.14.16
-rw-r--r--DRIVER_VERSION2
-rw-r--r--backup.c6
-rw-r--r--command-list.c130
-rw-r--r--files.c6
-rw-r--r--install-from-cwd.c31
-rw-r--r--misc.c59
-rw-r--r--misc.h3
-rw-r--r--nvidia-installer.1.m443
-rw-r--r--nvidia-installer.c15
-rw-r--r--nvidia-installer.h82
-rw-r--r--option_table.h8
11 files changed, 307 insertions, 78 deletions
diff --git a/DRIVER_VERSION b/DRIVER_VERSION
index 1799f7a..32c2fc4 100644
--- a/DRIVER_VERSION
+++ b/DRIVER_VERSION
@@ -1 +1 @@
-173.14.15
+173.14.16
diff --git a/backup.c b/backup.c
index 40a421f..465cf05 100644
--- a/backup.c
+++ b/backup.c
@@ -534,7 +534,9 @@ static int do_uninstall(Options *op)
tmpstr = nvstrcat("Uninstalling ", b->description, " (",
b->version, "):", NULL);
-
+
+ run_distro_hook(op, "pre-uninstall");
+
ui_status_begin(op, tmpstr, "Uninstalling");
free(tmpstr);
@@ -656,6 +658,8 @@ static int do_uninstall(Options *op)
/* XXX what to do if this fails?... nothing */
}
+ run_distro_hook(op, "post-uninstall");
+
free_backup_info(b);
return TRUE;
diff --git a/command-list.c b/command-list.c
index d98b2e0..9b02b45 100644
--- a/command-list.c
+++ b/command-list.c
@@ -29,6 +29,8 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/mman.h>
#include <fts.h>
#include <unistd.h>
#include <dirent.h>
@@ -65,7 +67,7 @@ static void find_conflicting_kernel_modules(Options *op,
Package *p,
FileList *l);
-static void find_existing_files(Package *p, FileList *l, unsigned int);
+static void find_existing_files(Package *p, FileList *l, uint64_t);
static void condense_file_list(Package *p, FileList *l);
@@ -95,7 +97,7 @@ CommandList *build_command_list(Options *op, Package *p)
FileList *l;
CommandList *c;
int i, cmd;
- unsigned int installable_files;
+ uint64_t installable_files;
char *tmp;
installable_files = get_installable_file_mask(op);
@@ -505,6 +507,15 @@ int execute_command_list(Options *op, CommandList *c,
typedef struct {
const char *name;
int len;
+
+ /*
+ * if requiredString is non-NULL, then a file must have this
+ * string in order to be considered a conflicting file; we use
+ * this to only consider "libglx.*" files conflicts if they have
+ * the string "glxModuleData".
+ */
+
+ const char *requiredString;
} ConflictingFileInfo;
static void find_conflicting_files(Options *op,
@@ -518,15 +529,15 @@ static void find_conflicting_libraries(Options *op,
FileList *l);
static ConflictingFileInfo __xfree86_libs[] = {
- { "libGLcore.", 10 /* strlen("libGLcore.") */ },
- { "libGL.", 6 /* strlen("libGL.") */ },
- { "libGLwrapper.", 13 /* strlen("libGLwrapper.") */ },
- { "libglx.", 7 /* strlen("libglx.") */ },
- { "libXvMCNVIDIA", 13 /* strlen("libXvMCNVIDIA") */ },
- { "libnvidia-cfg.", 14 /* strlen("libnvidia-cfg.") */ },
- { "nvidia_drv.", 11 /* strlen("nvidia_drv.") */ },
- { "libcuda.", 8 /* strlen("libcuda.") */ },
- { NULL, 0 }
+ { "libGLcore.", 10, /* strlen("libGLcore.") */ NULL },
+ { "libGL.", 6, /* strlen("libGL.") */ NULL },
+ { "libGLwrapper.", 13, /* strlen("libGLwrapper.") */ NULL },
+ { "libglx.", 7, /* strlen("libglx.") */ "glxModuleData" },
+ { "libXvMCNVIDIA", 13, /* strlen("libXvMCNVIDIA") */ NULL },
+ { "libnvidia-cfg.", 14, /* strlen("libnvidia-cfg.") */ NULL },
+ { "nvidia_drv.", 11, /* strlen("nvidia_drv.") */ NULL },
+ { "libcuda.", 8, /* strlen("libcuda.") */ NULL },
+ { NULL, 0, NULL }
};
/*
@@ -564,13 +575,13 @@ static void find_conflicting_xfree86_libraries_fullpath(Options *op,
static ConflictingFileInfo __opengl_libs[] = {
- { "libGLcore.", 10 /* strlen("libGLcore.") */ },
- { "libGL.", 6 /* strlen("libGL.") */ },
- { "libnvidia-tls.", 14 /* strlen("libnvidia-tls.") */ },
- { "libGLwrapper.", 13 /* strlen("libGLwrapper.") */ },
- { "libnvidia-cfg.", 14 /* strlen("libnvidia-cfg.") */ },
- { "libcuda.", 8 /* strlen("libcuda.") */ },
- { NULL, 0 }
+ { "libGLcore.", 10, /* strlen("libGLcore.") */ NULL },
+ { "libGL.", 6, /* strlen("libGL.") */ NULL },
+ { "libnvidia-tls.", 14, /* strlen("libnvidia-tls.") */ NULL },
+ { "libGLwrapper.", 13, /* strlen("libGLwrapper.") */ NULL },
+ { "libnvidia-cfg.", 14, /* strlen("libnvidia-cfg.") */ NULL },
+ { "libcuda.", 8, /* strlen("libcuda.") */ NULL },
+ { NULL, 0, NULL }
};
/*
@@ -642,7 +653,7 @@ static void find_conflicting_kernel_modules(Options *op,
* FileList.
*/
-static void find_existing_files(Package *p, FileList *l, unsigned int flag)
+static void find_existing_files(Package *p, FileList *l, uint64_t flag)
{
int i;
struct stat stat_buf;
@@ -658,6 +669,82 @@ static void find_existing_files(Package *p, FileList *l, unsigned int flag)
+/*
+ * ignore_conflicting_file() - ignore (i.e., do not put it on the list
+ * of files to backup) the conflicting file 'filename' if requiredString
+ * is non-NULL and we cannot find the string in 'filename'.
+ */
+
+static int ignore_conflicting_file(Options *op,
+ const char *filename,
+ const char *requiredString)
+{
+ int fd = -1;
+ struct stat stat_buf;
+ char *file = MAP_FAILED;
+ int ret = FALSE;
+ int i, len;
+
+ /* if no requiredString, do not ignore this conflicting file */
+
+ if (!requiredString) return FALSE;
+
+ if ((fd = open(filename, O_RDONLY)) == -1) {
+ ui_error(op, "Unable to open '%s' for reading (%s)",
+ filename, strerror(errno));
+ goto cleanup;
+ }
+
+ if (fstat(fd, &stat_buf) == -1) {
+ ui_error(op, "Unable to determine size of '%s' (%s)",
+ filename, strerror(errno));
+ goto cleanup;
+ }
+
+ if ((file = mmap(0, stat_buf.st_size, PROT_READ,
+ MAP_FILE | MAP_SHARED, fd, 0)) == MAP_FAILED) {
+ ui_error(op, "Unable to map file '%s' for reading (%s)",
+ filename, strerror(errno));
+ goto cleanup;
+ }
+
+ /*
+ * if the requiredString is not found within the mapping of file,
+ * ignore the conflicting file; when scanning for the string,
+ * ensure that the string is either at the end of the file, or
+ * followed by '\0'.
+ */
+
+ ret = TRUE;
+
+ len = strlen(requiredString);
+
+ for (i = 0; (i + len) <= stat_buf.st_size; i++) {
+ if ((strncmp(&file[i], requiredString, len) == 0) &&
+ (((i + len) == stat_buf.st_size) || (file[i+len] == '\0'))) {
+ ret = FALSE;
+ break;
+ }
+ }
+
+ /* fall through to cleanup */
+
+ cleanup:
+
+ if (file != MAP_FAILED) {
+ munmap(file, stat_buf.st_size);
+ }
+
+ if (fd != -1) {
+ close(fd);
+ }
+
+ return ret;
+
+} /* ignore_conflicting_file() */
+
+
+
/*
* find_conflicting_files() - search for any conflicting
@@ -686,8 +773,11 @@ static void find_conflicting_files(Options *op,
case FTS_F:
case FTS_SLNONE:
for (i = 0; files[i].name; i++) {
- if (!strncmp(ent->fts_name, files[i].name, files[i].len))
+ if (!strncmp(ent->fts_name, files[i].name, files[i].len) &&
+ !ignore_conflicting_file(op, ent->fts_path,
+ files[i].requiredString)) {
add_file_to_list(NULL, ent->fts_path, l);
+ }
}
break;
diff --git a/files.c b/files.c
index 4b78619..4220f84 100644
--- a/files.c
+++ b/files.c
@@ -553,7 +553,7 @@ int set_destinations(Options *op, Package *p)
break;
case FILE_TYPE_UTILITY_LIB:
- case FILE_TYPE_UTILITY_SYMLINK:
+ case FILE_TYPE_UTILITY_LIB_SYMLINK:
prefix = op->utility_prefix;
dir = op->utility_libdir;
path = "";
@@ -603,6 +603,7 @@ int set_destinations(Options *op, Package *p)
break;
case FILE_TYPE_UTILITY_BINARY:
+ case FILE_TYPE_UTILITY_BIN_SYMLINK:
prefix = op->utility_prefix;
dir = op->utility_bindir;
path = "";
@@ -922,10 +923,9 @@ int add_kernel_module_to_package(Options *op, Package *p)
void remove_non_kernel_module_files_from_package(Options *op, Package *p)
{
int i;
- unsigned int flags;
for (i = 0; i < p->num_entries; i++) {
- flags = p->entries[i].flags & FILE_TYPE_MASK;
+ uint64_t flags = p->entries[i].flags & FILE_TYPE_MASK;
if ((flags != FILE_TYPE_KERNEL_MODULE) &&
(flags != FILE_TYPE_KERNEL_MODULE_CMD))
p->entries[i].flags &= ~FILE_TYPE_MASK;
diff --git a/install-from-cwd.c b/install-from-cwd.c
index c5ff042..78d4e29 100644
--- a/install-from-cwd.c
+++ b/install-from-cwd.c
@@ -80,6 +80,7 @@ int install_from_cwd(Options *op)
CommandList *c;
const char *msg;
int ret;
+ int ran_pre_install_hook = FALSE;
static const char edit_your_xf86config[] =
"Please update your XF86Config or xorg.conf file as "
@@ -127,6 +128,17 @@ int install_from_cwd(Options *op)
if (!check_for_existing_driver(op, p)) goto exit_install;
+ /* run the distro preinstall hook */
+
+ if (!run_distro_hook(op, "pre-install")) {
+ if (!ui_yes_no(op, TRUE,
+ "The distribution-provided pre-install script failed! "
+ "Continue installation anyway?")) {
+ goto failed;
+ }
+ }
+ ran_pre_install_hook = TRUE;
+
/* attempt to build a kernel module for the target kernel */
if (!op->no_kernel_module) {
@@ -226,7 +238,11 @@ int install_from_cwd(Options *op)
/* execute the command list */
if (!do_install(op, p, c)) goto failed;
-
+
+ /* run the distro postinstall script */
+
+ run_distro_hook(op, "post-install");
+
/*
* check that everything is installed properly (post-install
* sanity check)
@@ -299,7 +315,10 @@ int install_from_cwd(Options *op)
"on fixing installation problems in the README available "
"on the Linux driver download page at www.nvidia.com.");
}
-
+
+ if (ran_pre_install_hook)
+ run_distro_hook(op, "failed-install");
+
/* fall through into exit_install... */
exit_install:
@@ -684,12 +703,14 @@ static Package *parse_manifest (Options *op)
p->entries[n].flags |= FILE_TYPE_XLIB_SYMLINK;
else if (strcmp(flag, "TLS_SYMLINK") == 0)
p->entries[n].flags |= FILE_TYPE_TLS_SYMLINK;
- else if (strcmp(flag, "UTILITY_SYMLINK") == 0)
- p->entries[n].flags |= FILE_TYPE_UTILITY_SYMLINK;
+ else if (strcmp(flag, "UTILITY_LIB_SYMLINK") == 0)
+ p->entries[n].flags |= FILE_TYPE_UTILITY_LIB_SYMLINK;
else if (strcmp(flag, "INSTALLER_BINARY") == 0)
p->entries[n].flags |= FILE_TYPE_INSTALLER_BINARY;
else if (strcmp(flag, "UTILITY_BINARY") == 0)
p->entries[n].flags |= FILE_TYPE_UTILITY_BINARY;
+ else if (strcmp(flag, "UTILITY_BIN_SYMLINK") == 0)
+ p->entries[n].flags |= FILE_TYPE_UTILITY_BIN_SYMLINK;
else if (strcmp(flag, "DOT_DESKTOP") == 0)
p->entries[n].flags |= FILE_TYPE_DOT_DESKTOP;
else if (strcmp(flag, "XMODULE_SHARED_LIB") == 0)
@@ -829,7 +850,7 @@ void add_package_entry(Package *p,
char *name,
char *target,
char *dst,
- unsigned int flags,
+ uint64_t flags,
mode_t mode)
{
int n;
diff --git a/misc.c b/misc.c
index 10304ac..d4a1d59 100644
--- a/misc.c
+++ b/misc.c
@@ -1356,8 +1356,8 @@ void check_installed_files_from_package(Options *op, Package *p)
{
int i, ret = TRUE;
float percent;
- unsigned int installable_files;
-
+ uint64_t installable_files;
+
ui_status_begin(op, "Running post-install sanity check:", "Checking");
installable_files = get_installable_file_mask(op);
@@ -1499,9 +1499,9 @@ static int check_file(Options *op, const char *filename,
* should be considered installable.
*/
-unsigned int get_installable_file_mask(Options *op)
+uint64_t get_installable_file_mask(Options *op)
{
- unsigned int installable_files = FILE_TYPE_INSTALLABLE_FILE;
+ uint64_t installable_files = FILE_TYPE_INSTALLABLE_FILE;
if (!op->opengl_headers) installable_files &= ~FILE_TYPE_OPENGL_HEADER;
return installable_files;
@@ -2407,6 +2407,57 @@ int run_nvidia_xconfig(Options *op)
} /* run_nvidia_xconfig() */
+/*
+ * run_distro_hook() - run a distribution-provided hook script
+ */
+
+int run_distro_hook(Options *op, const char *hook)
+{
+ int ret, status, shouldrun = op->run_distro_scripts;
+ char *cmd = nvstrcat("/usr/lib/nvidia/", hook, NULL);
+
+ if (op->kernel_module_only) {
+ ui_expert(op,
+ "Not running distribution-provided %s script %s because "
+ "--kernel-module-only was specified.",
+ hook, cmd);
+ ret = TRUE;
+ goto done;
+ }
+
+ if (access(cmd, X_OK) < 0) {
+ /* it's okay if the script doesn't exist or isn't executable */
+ ui_expert(op, "No distribution %s script found.", hook);
+ ret = TRUE;
+ goto done;
+ }
+
+ /* in expert mode, ask before running distro hooks */
+ if (op->expert) {
+ shouldrun = ui_yes_no(op, shouldrun,
+ "Run distribution-provided %s script %s?",
+ hook, cmd);
+ }
+
+ if (!shouldrun) {
+ ui_expert(op,
+ "Not running distribution-provided %s script %s",
+ hook, cmd);
+ ret = TRUE;
+ goto done;
+ }
+
+ ui_status_begin(op, "Running distribution scripts", "Executing %s", cmd);
+ status = run_command(op, cmd, NULL, TRUE, 0, TRUE);
+ ui_status_end(op, "done.");
+
+ ret = (status == 0);
+
+done:
+ nvfree(cmd);
+ return ret;
+}
+
/*
* nv_format_text_rows() - this function breaks the given string str
diff --git a/misc.h b/misc.h
index 3c78b6d..72fced0 100644
--- a/misc.h
+++ b/misc.h
@@ -109,7 +109,7 @@ int do_install(Options *op, Package *p, CommandList *c);
void should_install_opengl_headers(Options *op, Package *p);
void should_install_compat32_files(Options *op, Package *p);
void check_installed_files_from_package(Options *op, Package *p);
-unsigned int get_installable_file_mask(Options *op);
+uint64_t get_installable_file_mask(Options *op);
int tls_test(Options *op, int compat_32_libs);
int check_runtime_configuration(Options *op, Package *p);
void collapse_multiple_slashes(char *s);
@@ -119,6 +119,7 @@ int check_for_running_x(Options *op);
int check_for_modular_xorg(Options *op);
int check_for_nvidia_graphics_devices(Options *op, Package *p);
int run_nvidia_xconfig(Options *op);
+int run_distro_hook(Options *op, const char *hook);
TextRows *nv_format_text_rows(const char *prefix, const char *buf,
int width, int word_boundary);
diff --git a/nvidia-installer.1.m4 b/nvidia-installer.1.m4
index ff8e1da..21b55ac 100644
--- a/nvidia-installer.1.m4
+++ b/nvidia-installer.1.m4
@@ -1,7 +1,7 @@
dnl This file is to be preprocessed by m4.
changequote([[[, ]]])dnl
define(__OPTIONS__, [[[include([[[options.1.inc]]])dnl]]])dnl
-.\" Copyright (C) 2005 NVIDIA Corporation.
+.\" Copyright (C) 2005-2009 NVIDIA Corporation.
.\"
__HEADER__
.\" Define the URL macro and then load the URL package if it exists.
@@ -9,7 +9,7 @@ __HEADER__
\\$2 \(laURL: \\$1 \(ra\\$3
..
.if \n[.g] .mso www.tmac
-.TH nvidia\-installer 1 2005-09-01 "nvidia\-installer __VERSION__"
+.TH nvidia\-installer 1 2009-01-09 "nvidia\-installer __VERSION__"
.SH NAME
nvidia\-installer \- install, upgrade, or uninstall the NVIDIA Accelerated Graphics Driver Set
.SH SYNOPSIS
@@ -85,6 +85,43 @@ is released under the GPL and available here:
Patches are welcome.
dnl Call gen-manpage-opts to generate this section.
__OPTIONS__
+.SH "DISTRIBUTION HOOK SCRIPTS"
+.PP
+Because the NVIDIA installer may interact badly with distribution packages that contain the NVIDIA driver,
+.B nvidia\-installer
+provides a mechanism for the distribution to handle manual installation of the driver.
+If they exist,
+.B nvidia\-installer
+will run the following scripts:
+.RS
+\(bu /usr/lib/nvidia/pre\-install
+.br
+\(bu /usr/lib/nvidia/pre\-uninstall
+.br
+\(bu /usr/lib/nvidia/post\-uninstall
+.br
+\(bu /usr/lib/nvidia/post\-install
+.br
+\(bu /usr/lib/nvidia/failed\-install
+.RE
+Note that if installation of a new driver requires uninstallation of a previously installed driver, the
+.B pre\-
+and
+.B post\-uninstall
+scripts will be called
+.I after
+the
+.B pre\-install
+script.
+If the install fails, the installer will execute
+.B /usr/lib/nvidia/failed\-install
+instead of
+.BR /usr/lib/nvidia/post\-install .
+These scripts should not require user interaction.
+.PP
+Use the
+.B \-\-no\-distro\-scripts
+option to disable execution of these scripts.
.SH EXAMPLES
.TP
.B nvidia\-installer \-\-latest
@@ -112,4 +149,4 @@ NVIDIA Corporation
.BR nvidia-settings (1),
.I /usr/share/doc/NVIDIA_GLX-1.0/README.txt
.SH COPYRIGHT
-Copyright \(co 2005 NVIDIA Corporation.
+Copyright \(co 2005-2009 NVIDIA Corporation.
diff --git a/nvidia-installer.c b/nvidia-installer.c
index 394be97..b21143f 100644
--- a/nvidia-installer.c
+++ b/nvidia-installer.c
@@ -32,6 +32,7 @@
#include <limits.h>
#include <string.h>
#include <ctype.h>
+#include <libgen.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -201,6 +202,7 @@ Options *parse_commandline(int argc, char *argv[])
{
Options *op;
int c, option_index = 0;
+ char *program_name;
const int num_opts = sizeof(__options) / sizeof(__options[0]) - 1;
/* Allocate space for the long options. */
@@ -248,6 +250,7 @@ Options *parse_commandline(int argc, char *argv[])
op->selinux_option = SELINUX_DEFAULT;
op->sigwinch_workaround = TRUE;
+ op->run_distro_scripts = TRUE;
while (1) {
@@ -430,6 +433,9 @@ Options *parse_commandline(int argc, char *argv[])
case NO_CC_VERSION_CHECK_OPTION:
op->ignore_cc_version_check = TRUE;
break;
+ case NO_DISTRO_SCRIPTS_OPTION:
+ op->run_distro_scripts = FALSE;
+ break;
default:
fmterr("");
@@ -481,6 +487,15 @@ Options *parse_commandline(int argc, char *argv[])
op->installer_prefix = op->utility_prefix;
}
+ /*
+ * if the installer was invoked as "nvidia-uninstall", perform an
+ * uninstallation.
+ */
+ program_name = strdup(argv[0]);
+ if (strcmp(basename(program_name), "nvidia-uninstall") == 0)
+ op->uninstall = TRUE;
+ free(program_name);
+
return (op);
} /* parse_commandline() */
diff --git a/nvidia-installer.h b/nvidia-installer.h
index 509e441..a292f1f 100644
--- a/nvidia-installer.h
+++ b/nvidia-installer.h
@@ -29,6 +29,7 @@
#define __NVIDIA_INSTALLER_H__
#include <sys/types.h>
+#include <stdint.h>
/*
@@ -92,9 +93,9 @@ typedef enum {
} Distribution;
-typedef unsigned int uint32;
-typedef unsigned short uint16;
-typedef unsigned char uint8;
+typedef uint32_t uint32;
+typedef uint16_t uint16;
+typedef uint8_t uint8;
@@ -139,6 +140,7 @@ typedef struct __options {
int sigwinch_workaround;
int no_x_check;
int no_nvidia_xconfig_question;
+ int run_distro_scripts;
char *opengl_prefix;
char *opengl_libdir;
@@ -226,8 +228,8 @@ typedef struct __package_entry {
* field is assigned by the set_destinations()
* function.
*/
-
- unsigned int flags;
+
+ uint64_t flags;
mode_t mode;
ino_t inode;
@@ -292,43 +294,44 @@ typedef struct {
/* file types */
-#define FILE_TYPE_MASK 0x01ffffff
-
-#define FILE_TYPE_KERNEL_MODULE_SRC 0x00000001
-#define FILE_TYPE_KERNEL_MODULE_CMD 0x00000002
-#define FILE_TYPE_OPENGL_HEADER 0x00000004
-#define FILE_TYPE_OPENGL_LIB 0x00000008
-#define FILE_TYPE_XLIB_STATIC_LIB 0x00000010
-#define FILE_TYPE_XLIB_SHARED_LIB 0x00000020
-#define FILE_TYPE_DOCUMENTATION 0x00000040
-#define FILE_TYPE_OPENGL_SYMLINK 0x00000080
-#define FILE_TYPE_XLIB_SYMLINK 0x00000100
-#define FILE_TYPE_KERNEL_MODULE 0x00000200
-#define FILE_TYPE_INSTALLER_BINARY 0x00000400
-#define FILE_TYPE_UTILITY_BINARY 0x00000800
-#define FILE_TYPE_LIBGL_LA 0x00001000
-#define FILE_TYPE_TLS_LIB 0x00002000
-#define FILE_TYPE_TLS_SYMLINK 0x00004000
-#define FILE_TYPE_UTILITY_LIB 0x00008000
-#define FILE_TYPE_DOT_DESKTOP 0x00010000
-#define FILE_TYPE_UTILITY_SYMLINK 0x00020000
-#define FILE_TYPE_XMODULE_SHARED_LIB 0x00040000
-#define FILE_TYPE_XMODULE_SYMLINK 0x00080000
+#define FILE_TYPE_MASK 0x00000000ffffffffULL
+
+#define FILE_TYPE_KERNEL_MODULE_SRC 0x0000000000000001ULL
+#define FILE_TYPE_KERNEL_MODULE_CMD 0x0000000000000002ULL
+#define FILE_TYPE_OPENGL_HEADER 0x0000000000000004ULL
+#define FILE_TYPE_OPENGL_LIB 0x0000000000000008ULL
+#define FILE_TYPE_XLIB_STATIC_LIB 0x0000000000000010ULL
+#define FILE_TYPE_XLIB_SHARED_LIB 0x0000000000000020ULL
+#define FILE_TYPE_DOCUMENTATION 0x0000000000000040ULL
+#define FILE_TYPE_OPENGL_SYMLINK 0x0000000000000080ULL
+#define FILE_TYPE_XLIB_SYMLINK 0x0000000000000100ULL
+#define FILE_TYPE_KERNEL_MODULE 0x0000000000000200ULL
+#define FILE_TYPE_INSTALLER_BINARY 0x0000000000000400ULL
+#define FILE_TYPE_UTILITY_BINARY 0x0000000000000800ULL
+#define FILE_TYPE_LIBGL_LA 0x0000000000001000ULL
+#define FILE_TYPE_TLS_LIB 0x0000000000002000ULL
+#define FILE_TYPE_TLS_SYMLINK 0x0000000000004000ULL
+#define FILE_TYPE_UTILITY_LIB 0x0000000000008000ULL
+#define FILE_TYPE_DOT_DESKTOP 0x0000000000010000ULL
+#define FILE_TYPE_UTILITY_LIB_SYMLINK 0x0000000000020000ULL
+#define FILE_TYPE_XMODULE_SHARED_LIB 0x0000000000040000ULL
+#define FILE_TYPE_XMODULE_SYMLINK 0x0000000000080000ULL
/* Create a symlink only if the file doesn't exist */
-#define FILE_TYPE_XMODULE_NEWSYM 0x00100000
-#define FILE_TYPE_MANPAGE 0x00200000
-#define FILE_TYPE_CUDA_HEADER 0x00400000
-#define FILE_TYPE_CUDA_LIB 0x00800000
-#define FILE_TYPE_CUDA_SYMLINK 0x01000000
+#define FILE_TYPE_XMODULE_NEWSYM 0x0000000000100000ULL
+#define FILE_TYPE_MANPAGE 0x0000000000200000ULL
+#define FILE_TYPE_CUDA_HEADER 0x0000000000400000ULL
+#define FILE_TYPE_CUDA_LIB 0x0000000000800000ULL
+#define FILE_TYPE_CUDA_SYMLINK 0x0000000001000000ULL
+#define FILE_TYPE_UTILITY_BIN_SYMLINK 0x0000000010000000ULL
/* file class: this is used to distinguish OpenGL libraries */
-#define FILE_CLASS_MASK 0xfe000000
+#define FILE_CLASS_MASK 0xf000000000000000ULL
-#define FILE_CLASS_NEW_TLS 0x02000000
-#define FILE_CLASS_CLASSIC_TLS 0x04000000
-#define FILE_CLASS_NATIVE 0x08000000
-#define FILE_CLASS_COMPAT32 0x10000000
+#define FILE_CLASS_NEW_TLS 0x1000000000000000ULL
+#define FILE_CLASS_CLASSIC_TLS 0x2000000000000000ULL
+#define FILE_CLASS_NATIVE 0x4000000000000000ULL
+#define FILE_CLASS_COMPAT32 0x8000000000000000ULL
#define FILE_TYPE_XLIB_LIB (FILE_TYPE_XLIB_STATIC_LIB | \
FILE_TYPE_XLIB_SHARED_LIB)
@@ -378,7 +381,8 @@ typedef struct {
FILE_TYPE_XLIB_SYMLINK | \
FILE_TYPE_TLS_SYMLINK | \
FILE_TYPE_XMODULE_SYMLINK | \
- FILE_TYPE_UTILITY_SYMLINK)
+ FILE_TYPE_UTILITY_LIB_SYMLINK| \
+ FILE_TYPE_UTILITY_BIN_SYMLINK)
#define FILE_TYPE_NEWSYM (FILE_TYPE_XMODULE_NEWSYM)
@@ -503,7 +507,7 @@ void add_package_entry(Package *p,
char *name,
char *target,
char *dst,
- unsigned int flags,
+ uint64_t flags,
mode_t mode);
/* XXX */
diff --git a/option_table.h b/option_table.h
index 8a0d2bb..0ee356a 100644
--- a/option_table.h
+++ b/option_table.h
@@ -52,7 +52,8 @@ enum {
X_LIBRARY_PATH_OPTION,
NO_KERNEL_MODULE_OPTION,
NO_X_CHECK_OPTION,
- NO_CC_VERSION_CHECK_OPTION
+ NO_CC_VERSION_CHECK_OPTION,
+ NO_DISTRO_SCRIPTS_OPTION
};
static const NVOption __options[] = {
@@ -429,6 +430,11 @@ static const NVOption __options[] = {
"installation in case of failures. Use this option to override this "
"check." },
+ { "no-distro-scripts", NO_DISTRO_SCRIPTS_OPTION, 0,
+ "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 },