summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Plattner <aplattner@nvidia.com>2009-07-01 13:43:54 -0700
committerAaron Plattner <aplattner@nvidia.com>2009-07-01 13:43:54 -0700
commite84e5f1692a9a527e438f13b37aca898aff19620 (patch)
treeebbb4e2634fe300c0de513c20e55661b8df920f5
parentc421c89c005c8efa83496cd1c4e928ea5982ff66 (diff)
173.14.19173.14.19
-rw-r--r--DRIVER_VERSION2
-rw-r--r--command-list.c52
-rw-r--r--misc.c143
3 files changed, 151 insertions, 46 deletions
diff --git a/DRIVER_VERSION b/DRIVER_VERSION
index 666195d..6bbdd8f 100644
--- a/DRIVER_VERSION
+++ b/DRIVER_VERSION
@@ -1 +1 @@
-173.14.18
+173.14.19
diff --git a/command-list.c b/command-list.c
index 9b02b45..2609d07 100644
--- a/command-list.c
+++ b/command-list.c
@@ -216,23 +216,34 @@ CommandList *build_command_list(Options *op, Package *p)
/* Add all the installable files to the list */
for (i = 0; i < p->num_entries; i++) {
+ /*
+ * Install first, then run execstack. This sets the selinux context on
+ * the installed file in the target filesystem, which is essentially
+ * guaranteed to support selinux attributes if selinux is enabled.
+ * However, the temporary filesystem containing the uninstalled file
+ * may be on a filesystem that doesn't support selinux attributes,
+ * such as NFS.
+ *
+ * See bug 530083 - "nvidia-installer: ERROR: Failed to execute
+ * execstack: Operation not supported".
+ */
+ if (p->entries[i].flags & installable_files) {
+ add_command(c, INSTALL_CMD,
+ p->entries[i].file,
+ p->entries[i].dst,
+ p->entries[i].mode);
+ }
+
if (op->selinux_enabled &&
(op->utils[EXECSTACK] != NULL) &&
((p->entries[i].flags & FILE_TYPE_SHARED_LIB) ||
(p->entries[i].flags & FILE_TYPE_XMODULE_SHARED_LIB))) {
tmp = nvstrcat(op->utils[EXECSTACK], " -c ",
- p->entries[i].file, NULL);
+ p->entries[i].dst, NULL);
add_command(c, RUN_CMD, tmp);
nvfree(tmp);
}
- if (p->entries[i].flags & installable_files) {
- add_command(c, INSTALL_CMD,
- p->entries[i].file,
- p->entries[i].dst,
- p->entries[i].mode);
- }
-
/*
* delete the temporary libGL.la and .desktop files generated
* based on templates earlier.
@@ -529,15 +540,18 @@ static void find_conflicting_libraries(Options *op,
FileList *l);
static ConflictingFileInfo __xfree86_libs[] = {
- { "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 }
+ { "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 },
+ { "libvdpau.", 9, /* strlen("libvdpau.") */ NULL },
+ { "libvdpau_trace.", 15, /* strlen("libvdpau_trace.") */ NULL },
+ { "libvdpau_nvidia.", 16, /* strlen("libvdpau_nvidia.") */ NULL },
+ { NULL, 0, NULL }
};
/*
@@ -701,6 +715,10 @@ static int ignore_conflicting_file(Options *op,
goto cleanup;
}
+ if (!stat_buf.st_size) {
+ 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)",
diff --git a/misc.c b/misc.c
index d4a1d59..3d5f181 100644
--- a/misc.c
+++ b/misc.c
@@ -2042,11 +2042,112 @@ Distribution get_distribution(Options *op)
} /* get_distribution() */
+
+/*
+ * get_xserver_information() - parse the versionString (from `X
+ * -version`) and assign relevant information that we infer from the X
+ * server version.
+ *
+ * Note: this implementation should be shared with nvidia-xconfig
+ */
+
+static int get_xserver_information(const char *versionString,
+ int *isXorg,
+ int *isModular,
+ int *autoloadsGLX,
+ int *supportsExtensionSection)
+{
+#define XSERVER_VERSION_FORMAT_1 "X Window System Version"
+#define XSERVER_VERSION_FORMAT_2 "X.Org X Server"
+
+ int major, minor, found;
+ const char *ptr;
+
+ /* check if this is an XFree86 X server */
+
+ if (strstr(versionString, "XFree86 Version")) {
+ *isXorg = FALSE;
+ *isModular = FALSE;
+ *autoloadsGLX = FALSE;
+ *supportsExtensionSection = FALSE;
+ return TRUE;
+ }
+
+ /* this must be an X.Org X server */
+
+ *isXorg = TRUE;
+
+ /* attempt to parse the major.minor version out of the string */
+
+ found = FALSE;
+
+ if (((ptr = strstr(versionString, XSERVER_VERSION_FORMAT_1)) != NULL) &&
+ (sscanf(ptr, XSERVER_VERSION_FORMAT_1 " %d.%d", &major, &minor) == 2)) {
+ found = TRUE;
+ }
+
+ if (!found &&
+ ((ptr = strstr(versionString, XSERVER_VERSION_FORMAT_2)) != NULL) &&
+ (sscanf(ptr, XSERVER_VERSION_FORMAT_2 " %d.%d", &major, &minor) == 2)) {
+ found = TRUE;
+ }
+
+ /* if we can't parse the version, give up */
+
+ if (!found) return FALSE;
+
+ /*
+ * isModular: X.Org X11R6.x X servers are monolithic, all others
+ * are modular
+ */
+
+ if (major == 6) {
+ *isModular = FALSE;
+ } else {
+ *isModular = TRUE;
+ }
+
+ /*
+ * supportsExtensionSection: support for the "Extension" xorg.conf
+ * section was added between X.Org 6.7 and 6.8. To account for
+ * the X server version wrap, it is easier to check for X servers
+ * that do not support the Extension section: 6.x (x < 8) X
+ * servers.
+ */
+
+ if ((major == 6) && (minor < 8)) {
+ *supportsExtensionSection = FALSE;
+ } else {
+ *supportsExtensionSection = TRUE;
+ }
+
+ /*
+ * support for autoloading GLX was added in X.Org 1.5. To account
+ * for the X server version wrap, it is easier to check for X
+ * servers that do not support GLX autoloading: 6.x, 7.x, or < 1.5
+ * X servers.
+ */
+
+ if ((major == 6) || (major == 7) || ((major == 1) && (minor < 5))) {
+ *autoloadsGLX = FALSE;
+ } else {
+ *autoloadsGLX = TRUE;
+ }
+
+ return TRUE;
+
+} /* get_xserver_information() */
+
+
+
/*
* check_for_modular_xorg() - run the X binary with the '-version'
* command line option and extract the version in an attempt to
* determine if it's part of a modular Xorg release. If the version
* can't be determined, we assume it's not.
+ *
+ * This should eventually get collapsed with xconfigGetXServerInUse()
+ * in nvidia-xconfig.
*/
#define OLD_VERSION_FORMAT "(protocol Version %d, revision %d, vendor release %d)"
@@ -2054,9 +2155,9 @@ Distribution get_distribution(Options *op)
int check_for_modular_xorg(Options *op)
{
- char *cmd = NULL, *ptr, *data = NULL;
+ char *cmd = NULL, *data = NULL;
int modular_xorg = FALSE;
- int dummy, release;
+ int dummy, ret;
if (!op->utils[XSERVER])
goto done;
@@ -2069,40 +2170,26 @@ int check_for_modular_xorg(Options *op)
}
/*
- * Check if this is an XFree86 release that identifies
- * itself as such in the version string.
+ * process the `X -version` output to infer if this X server is
+ * modular
*/
- if (strstr(data, "XFree86 Version"))
- goto done;
- /*
- * Check if this looks like an XFree86 release older
- * than XFree86 4.3.0.
- */
- if ((ptr = strstr(data, "(protocol Version")) != NULL &&
- sscanf(ptr, OLD_VERSION_FORMAT, &dummy, &dummy, &release) == 3) {
- goto done;
- }
+ ret = get_xserver_information(data,
+ &dummy, /* isXorg */
+ &modular_xorg, /* isModular */
+ &dummy, /* autoloadsGLX */
+ &dummy); /* supportsExtensionSection */
/*
- * Check if this looks like an XFree86 release between
- * XFree86 4.2 and 4.5, or an Xorg release.
+ * if get_xserver_information() failed, assume the X server is not
+ * modular
*/
- if ((ptr = strstr(data, "X Protocol Version")) != NULL &&
- sscanf(ptr, NEW_VERSION_FORMAT, &dummy, &dummy, &release) == 3) {
- modular_xorg = (release >= 7);
- goto done;
+ if (!ret) {
+ modular_xorg = FALSE;
}
- /*
- * If all else fails, check if this is an Xorg release
- * that identifies itself as such.
- */
- if ((ptr = strstr(data, "X Window System Version")) &&
- sscanf(ptr, "X Window System Version %d.", &release) == 1) {
- modular_xorg = (release >= 7);
- }
+ /* fall through */
done:
nvfree(data);