summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile32
-rw-r--r--backup.c30
-rw-r--r--command-list.c57
-rw-r--r--conflicting-kernel-modules.c39
-rw-r--r--conflicting-kernel-modules.h26
-rw-r--r--dist-files.mk2
-rw-r--r--install-from-cwd.c56
-rw-r--r--kernel.c23
-rw-r--r--kernel.h2
-rw-r--r--nvidia-installer.h2
-rw-r--r--user-interface.c84
-rw-r--r--version.mk2
12 files changed, 194 insertions, 161 deletions
diff --git a/Makefile b/Makefile
index e34851b..5c87fc7 100644
--- a/Makefile
+++ b/Makefile
@@ -36,9 +36,12 @@ include utils.mk
NCURSES_CFLAGS ?=
NCURSES_LDFLAGS ?=
+NCURSES6_CFLAGS ?=
+NCURSES6_LDFLAGS ?=
PCI_CFLAGS ?=
PCI_LDFLAGS ?=
+BUILD_NCURSES6 = $(if $(NCURSES6_CFLAGS)$(NCURSES6_LDFLAGS),1,)
##############################################################################
# assign variables
@@ -61,8 +64,12 @@ else
endif
NCURSES_UI_C = ncurses-ui.c
+NCURSES_UI_O = $(call BUILD_OBJECT_LIST,$(NCURSES_UI_C))
NCURSES_UI_SO = $(OUTPUTDIR)/nvidia-installer-ncurses-ui.so
NCURSES_UI_SO_C = $(OUTPUTDIR)/g_$(notdir $(NCURSES_UI_SO:.so=.c))
+NCURSES6_UI_O = $(OUTPUTDIR)/ncurses6-ui.o
+NCURSES6_UI_SO = $(OUTPUTDIR)/nvidia-installer-ncurses6-ui.so
+NCURSES6_UI_SO_C = $(OUTPUTDIR)/g_$(notdir $(NCURSES6_UI_SO:.so=.c))
ifneq ($(NEED_TLS_TEST),)
TLS_TEST_C = $(OUTPUTDIR)/g_tls_test.c
@@ -133,7 +140,12 @@ 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) \
+NCURSES_UI_SO_SRC = $(NCURSES_UI_SO_C)
+
+NCURSES_UI_SO_SRC += $(if $(BUILD_NCURSES6),$(NCURSES6_UI_SO_C),)
+CFLAGS += $(if $(BUILD_NCURSES6),-DNV_INSTALLER_NCURSES6,)
+
+INSTALLER_SRC = $(SRC) $(NCURSES_UI_SO_SRC) $(TLS_TEST_C) $(TLS_TEST_DSO_C) \
$(RTLD_TEST_C) $(COMPAT_32_SRC) $(STAMP_C)
INSTALLER_OBJS = $(call BUILD_OBJECT_LIST,$(INSTALLER_SRC))
@@ -220,13 +232,20 @@ $(GEN_UI_ARRAY): gen-ui-array.c $(CONFIG_H)
$(call quiet_cmd,HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
$(HOST_BIN_LDFLAGS) $< -o $@
-$(NCURSES_UI_SO): $(call BUILD_OBJECT_LIST,ncurses-ui.c)
+$(NCURSES_UI_SO): $(NCURSES_UI_O)
$(call quiet_cmd,LINK) -shared $(NCURSES_LDFLAGS) \
$(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) $< -o $@ -lncurses $(LIBS)
+$(NCURSES6_UI_SO): $(NCURSES6_UI_O)
+ $(call quiet_cmd,LINK) -shared $(NCURSES6_LDFLAGS) \
+ $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) $< -o $@ -lncurses $(LIBS)
+
$(NCURSES_UI_SO_C): $(GEN_UI_ARRAY) $(NCURSES_UI_SO)
$(call quiet_cmd,GEN_UI_ARRAY) $(NCURSES_UI_SO) ncurses_ui_array > $@
+$(NCURSES6_UI_SO_C): $(GEN_UI_ARRAY) $(NCURSES6_UI_SO)
+ $(call quiet_cmd,GEN_UI_ARRAY) $(NCURSES6_UI_SO) ncurses6_ui_array > $@
+
ifneq ($(NEED_TLS_TEST),)
$(TLS_TEST_C): $(GEN_UI_ARRAY) $(TLS_TEST)
$(call quiet_cmd,GEN_UI_ARRAY) $(TLS_TEST) tls_test_array > $@
@@ -253,10 +272,15 @@ $(RTLD_TEST_32_C): $(GEN_UI_ARRAY) $(RTLD_TEST_32)
$(call BUILD_OBJECT_LIST,misc.c): CFLAGS += $(PCI_CFLAGS)
# ncurses-ui.c includes ncurses.h
-$(call BUILD_OBJECT_LIST,ncurses-ui.c): CFLAGS += $(NCURSES_CFLAGS) -fPIC
+$(NCURSES_UI_O): CFLAGS += $(NCURSES_CFLAGS)
+$(NCURSES6_UI_O): CFLAGS += $(NCURSES6_CFLAGS)
+
+# build the ncurses ui DSO as position-indpendent code
+$(NCURSES_UI_O) $(NCURSES6_UI_O): CFLAGS += -fPIC
# define the rule to build each object file
$(foreach src,$(ALL_SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
+$(eval $(call DEFINE_OBJECT_RULE_WITH_OBJECT_NAME,TARGET,$(NCURSES_UI_C),$(NCURSES6_UI_O)))
# define a rule to build each makeself-help-script object file
$(foreach src,$(MAKESELF_HELP_SCRIPT_SRC),\
@@ -276,7 +300,7 @@ $(CONFIG_H): $(VERSION_MK)
@ $(ECHO) -n "#define PROGRAM_NAME " >> $@
@ $(ECHO) "\"$(NVIDIA_INSTALLER_PROGRAM_NAME)\"" >> $@
-$(call BUILD_OBJECT_LIST,$(ALL_SRC)): $(CONFIG_H)
+$(call BUILD_OBJECT_LIST,$(ALL_SRC)) $(NCURSES6_UI_O): $(CONFIG_H)
$(call BUILD_MAKESELF_OBJECT_LIST,$(MAKESELF_HELP_SCRIPT_SRC)): $(CONFIG_H)
clean clobber:
diff --git a/backup.c b/backup.c
index c2439c5..c2ff404 100644
--- a/backup.c
+++ b/backup.c
@@ -41,13 +41,12 @@
#include "crc.h"
#include "misc.h"
#include "kernel.h"
+#include "conflicting-kernel-modules.h"
#define BACKUP_DIRECTORY "/var/lib/nvidia"
#define BACKUP_LOG (BACKUP_DIRECTORY "/log")
#define BACKUP_MKDIR_LOG (BACKUP_DIRECTORY "/dirs")
-#define RMMOD_MODULE_NAME "nvidia"
-
@@ -623,18 +622,6 @@ static int rmdir_recursive(Options *op)
-/* unload_nvidia_module() - unload nvidia${suffix}.ko, ignoring failures. */
-
-static void unload_nvidia_module(Options *op, const char *suffix)
-{
- char *name;
- name = nvstrcat(RMMOD_MODULE_NAME, suffix, NULL);
- rmmod_kernel_module(op, name);
- nvfree(name);
-}
-
-
-
/*
* do_uninstall() - this function uninstalls a previously installed
* driver, by parsing the BACKUP_LOG file.
@@ -839,21 +826,10 @@ static int do_uninstall(Options *op, const char *version)
* might not have existed at all.
*/
- unload_nvidia_module(op, "-uvm");
-
- unload_nvidia_module(op, "");
-
- for (i = 0; i < NV_MAX_MODULE_INSTANCES; i++) {
- char num[5];
- memset(num, 0, sizeof(num));
- snprintf(num, sizeof(num), "%d", i);
- num[sizeof(num) - 1] = '\0';
-
- unload_nvidia_module(op, num);
+ for (i = 0; i < num_conflicting_kernel_modules; i++) {
+ rmmod_kernel_module(op, conflicting_kernel_modules[i]);
}
- unload_nvidia_module(op, "-frontend");
-
run_distro_hook(op, "post-uninstall");
free_backup_info(b);
diff --git a/command-list.c b/command-list.c
index c9ff683..fada288 100644
--- a/command-list.c
+++ b/command-list.c
@@ -43,6 +43,7 @@
#include "files.h"
#include "kernel.h"
#include "manifest.h"
+#include "conflicting-kernel-modules.h"
static void free_file_list(FileList* l);
@@ -59,9 +60,7 @@ static void find_conflicting_opengl_libraries(Options *,
const char *,
FileList *);
-static void find_conflicting_kernel_modules(Options *op,
- Package *p,
- FileList *l);
+static void find_conflicting_kernel_modules(Options *op, FileList *l);
static void find_existing_files(Package *p, FileList *l,
PackageEntryFileTypeList *file_type_list);
@@ -115,8 +114,9 @@ CommandList *build_command_list(Options *op, Package *p)
/* find any possibly conflicting modules and/or libraries */
- if (!op->no_kernel_module || op->dkms)
- find_conflicting_kernel_modules(op, p, l);
+ if (!op->no_kernel_module || op->dkms) {
+ find_conflicting_kernel_modules(op, l);
+ }
/* check the conflicting file list for any installed kernel modules */
@@ -770,13 +770,13 @@ static void find_conflicting_opengl_libraries(Options *op,
* modules under the kernel module installation prefix.
*/
-static void find_conflicting_kernel_modules(Options *op,
- Package *p, FileList *l)
+static void find_conflicting_kernel_modules(Options *op, FileList *l)
{
- int i = 0, n = 0;
- ConflictingFileInfo files[2];
+ int i = 0;
+ ConflictingFileInfo *files;
char *paths[3];
char *tmp = get_kernel_name(op);
+ char **filenames;
/* Don't descend into the "build" or "source" directories; these won't
* contain modules, and may be symlinks back to an actual source tree. */
@@ -786,9 +786,6 @@ static void find_conflicting_kernel_modules(Options *op,
{ 0, NULL }
};
- memset(files, 0, sizeof(files));
- files[1].name = NULL;
- files[1].len = 0;
if (op->kernel_module_installation_path) {
paths[i++] = op->kernel_module_installation_path;
}
@@ -798,18 +795,25 @@ static void find_conflicting_kernel_modules(Options *op,
}
paths[i] = NULL;
-
+
+ /* Build the list of conflicting kernel modules */
+
+ files = nvalloc((num_conflicting_kernel_modules + 1) * sizeof(files[0]));
+ filenames = nvalloc(num_conflicting_kernel_modules * sizeof(filenames[0]));
+
+ for (i = 0; i < num_conflicting_kernel_modules; i++) {
+ filenames[i] = nvstrcat(conflicting_kernel_modules[i], ".ko", NULL);
+ files[i].name = filenames[i];
+ files[i].len = strlen(filenames[i]);
+ }
+
for (i = 0; paths[i]; i++) {
- for (n = 0; p->bad_module_filenames[n]; n++) {
- /*
- * Recursively search for this conflicting kernel module
- * relative to the current prefix.
- */
- files[0].name = p->bad_module_filenames[n];
- files[0].len = strlen(files[0].name);
+ /*
+ * Recursively search for the conflicting kernel modules
+ * relative to the current prefix.
+ */
- find_conflicting_files(op, paths[i], files, l, skipdirs);
- }
+ find_conflicting_files(op, paths[i], files, l, skipdirs);
}
/* free any paths we nvstrcat()'d above */
@@ -818,7 +822,14 @@ static void find_conflicting_kernel_modules(Options *op,
nvfree(paths[i]);
}
-} /* find_conflicting_kernel_modules() */
+ /* free the kernel module names */
+
+ for (i = 0; i < num_conflicting_kernel_modules; i++) {
+ nvfree(filenames[i]);
+ }
+ nvfree(filenames);
+ nvfree(files);
+}
diff --git a/conflicting-kernel-modules.c b/conflicting-kernel-modules.c
new file mode 100644
index 0000000..4d9e890
--- /dev/null
+++ b/conflicting-kernel-modules.c
@@ -0,0 +1,39 @@
+/*
+ * nvidia-installer: A tool for installing NVIDIA software packages on
+ * Unix and Linux systems.
+ *
+ * Copyright (C) 2015 NVIDIA Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * 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, see <http://www.gnu.org/licenses>.
+ */
+
+#include "common-utils.h"
+
+/*
+ * A list of kernel modules that will conflict with this driver installation.
+ * The list should be maintained in reverse dependency order; i.e., it should
+ * be possible to unload kernel modules one at a time, in the order that they
+ * appear in this list.
+ */
+
+const char * const conflicting_kernel_modules[] = {
+ "nvidia-uvm",
+ "nvidia-drm",
+ "nvidia-modeset",
+ "nvidia",
+ "nvidia0", "nvidia1", "nvidia2", "nvidia3",
+ "nvidia4", "nvidia5", "nvidia6", "nvidia7",
+ "nvidia-frontend",
+};
+
+const int num_conflicting_kernel_modules = ARRAY_LEN(conflicting_kernel_modules);
diff --git a/conflicting-kernel-modules.h b/conflicting-kernel-modules.h
new file mode 100644
index 0000000..892a5a6
--- /dev/null
+++ b/conflicting-kernel-modules.h
@@ -0,0 +1,26 @@
+/*
+ * nvidia-installer: A tool for installing NVIDIA software packages on
+ * Unix and Linux systems.
+ *
+ * Copyright (C) 2015 NVIDIA Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * 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, see <http://www.gnu.org/licenses>.
+ */
+
+#ifndef __CONFLICTING_KERNEL_MODULES_H__
+#define __CONFLICTING_KERNEL_MODULES_H__
+
+extern const char * const conflicting_kernel_modules[];
+extern const int num_conflicting_kernel_modules;
+
+#endif
diff --git a/dist-files.mk b/dist-files.mk
index b08a951..d9fd878 100644
--- a/dist-files.mk
+++ b/dist-files.mk
@@ -44,6 +44,7 @@ SRC += update.c
SRC += user-interface.c
SRC += sanity.c
SRC += manifest.c
+SRC += conflicting-kernel-modules.c
DIST_FILES := $(SRC)
@@ -63,6 +64,7 @@ DIST_FILES += snarf.h
DIST_FILES += update.h
DIST_FILES += user-interface.h
DIST_FILES += manifest.h
+DIST_FILES += conflicting-kernel-modules.h
DIST_FILES += COPYING
DIST_FILES += README
diff --git a/install-from-cwd.c b/install-from-cwd.c
index e9e0812..d6275ab 100644
--- a/install-from-cwd.c
+++ b/install-from-cwd.c
@@ -111,7 +111,7 @@ int install_from_cwd(Options *op)
/* make sure the kernel module is unloaded */
- if (!check_for_unloaded_kernel_module(op, p)) goto failed;
+ if (!check_for_unloaded_kernel_module(op)) goto failed;
/* ask the user to accept the license */
@@ -663,7 +663,7 @@ int add_this_kernel(Options *op)
static Package *parse_manifest (Options *op)
{
char *buf, *c, *flag, *tmpstr, *module_suffix = "";
- int done, n, line;
+ int done, line;
int fd, ret, len = 0;
struct stat stat_buf;
Package *p;
@@ -732,46 +732,14 @@ static Package *parse_manifest (Options *op)
nvfree(tmpstr);
/*
- * the fifth line is a whitespace-separated list of kernel modules
- * to be unloaded before installing the new kernel module
+ * ignore the fifth and sixth lines
*/
line++;
- tmpstr = get_next_line(ptr, &ptr, manifest, len);
- if (!tmpstr) goto invalid_manifest_file;
-
- p->bad_modules = NULL;
- c = tmpstr;
- n = 0;
-
- do {
- n++;
- p->bad_modules = (char **)
- nvrealloc(p->bad_modules, n * sizeof(char *));
- p->bad_modules[n-1] = read_next_word(c, &c);
- } while (p->bad_modules[n-1]);
-
- /*
- * the sixth line is a whitespace-separated list of kernel module
- * filenames to be uninstalled before installing the new kernel
- * module
- */
-
+ nvfree(get_next_line(ptr, &ptr, manifest, len));
line++;
- tmpstr = get_next_line(ptr, &ptr, manifest, len);
- if (!tmpstr) goto invalid_manifest_file;
+ nvfree(get_next_line(ptr, &ptr, manifest, len));
- p->bad_module_filenames = NULL;
- c = tmpstr;
- n = 0;
-
- do {
- n++;
- p->bad_module_filenames = (char **)
- nvrealloc(p->bad_module_filenames, n * sizeof(char *));
- p->bad_module_filenames[n-1] = read_next_word(c, &c);
- } while (p->bad_module_filenames[n-1]);
-
/* the seventh line is the kernel module build directory */
line++;
@@ -1054,20 +1022,6 @@ static void free_package(Package *p)
nvfree(p->kernel_interface_filename);
nvfree(p->kernel_module_name);
- if (p->bad_modules) {
- for (i = 0; p->bad_modules[i]; i++) {
- nvfree(p->bad_modules[i]);
- }
- nvfree((char *) p->bad_modules);
- }
-
- if (p->bad_module_filenames) {
- for (i = 0; p->bad_module_filenames[i]; i++) {
- nvfree(p->bad_module_filenames[i]);
- }
- nvfree((char *) p->bad_module_filenames);
- }
-
nvfree(p->kernel_module_build_directory);
nvfree(p->uvm_module_build_directory);
diff --git a/kernel.c b/kernel.c
index 948ccd8..16aff2b 100644
--- a/kernel.c
+++ b/kernel.c
@@ -43,6 +43,7 @@
#include "precompiled.h"
#include "snarf.h"
#include "crc.h"
+#include "conflicting-kernel-modules.h"
/* local prototypes */
@@ -1723,11 +1724,11 @@ static void modprobe_remove_kernel_module_quiet(Options *op, const char *name)
* we can't unload it, then report an error and return FALSE;
*/
-int check_for_unloaded_kernel_module(Options *op, Package *p)
+int check_for_unloaded_kernel_module(Options *op)
{
- int n = 0;
+ int n;
int loaded = FALSE;
- unsigned int bits = 0;
+ unsigned long long int bits = 0;
/*
* We can skip this check if we are installing for a non-running
@@ -1752,30 +1753,27 @@ int check_for_unloaded_kernel_module(Options *op, Package *p)
return TRUE;
}
- while (p->bad_modules[n]) {
- if (check_for_loaded_kernel_module(op, p->bad_modules[n])) {
+ for (n = 0; n < num_conflicting_kernel_modules; n++) {
+ if (check_for_loaded_kernel_module(op, conflicting_kernel_modules[n])) {
loaded = TRUE;
bits |= (1 << n);
}
- n++;
}
if (!loaded) return TRUE;
/* one or more kernel modules is loaded... try to unload them */
- n = 0;
- while (p->bad_modules[n]) {
+ for (n = 0; n < num_conflicting_kernel_modules; n++) {
if (!(bits & (1 << n))) {
- n++;
continue;
}
- rmmod_kernel_module(op, p->bad_modules[n]);
+ rmmod_kernel_module(op, conflicting_kernel_modules[n]);
/* check again */
- if (check_for_loaded_kernel_module(op, p->bad_modules[n])) {
+ if (check_for_loaded_kernel_module(op, conflicting_kernel_modules[n])) {
ui_error(op, "An NVIDIA kernel module '%s' appears to already "
"be loaded in your kernel. This may be because it is "
"in use (for example, by the X server), but may also "
@@ -1787,11 +1785,10 @@ int check_for_unloaded_kernel_module(Options *op, Package *p)
"error may have occured that has corrupted the NVIDIA "
"kernel module's usage count; the simplest remedy is "
"to reboot your computer.",
- p->bad_modules[n]);
+ conflicting_kernel_modules[n]);
return FALSE;
}
- n++;
}
return TRUE;
diff --git a/kernel.h b/kernel.h
index 1d02b5d..56edbc2 100644
--- a/kernel.h
+++ b/kernel.h
@@ -41,7 +41,7 @@ int build_kernel_interface (Options*, Package*,
PrecompiledFileInfo **);
int test_kernel_module (Options*, Package*);
int load_kernel_module (Options*, Package*);
-int check_for_unloaded_kernel_module (Options*, Package*);
+int check_for_unloaded_kernel_module (Options*);
PrecompiledInfo *find_precompiled_kernel_interface (Options*, Package*);
char *get_kernel_name (Options*);
KernelConfigOptionStatus test_kernel_config_option (Options*, Package*,
diff --git a/nvidia-installer.h b/nvidia-installer.h
index 2a89639..b1edacf 100644
--- a/nvidia-installer.h
+++ b/nvidia-installer.h
@@ -383,8 +383,6 @@ typedef struct __package {
char *kernel_module_filename;
char *kernel_interface_filename;
char *kernel_module_name;
- char **bad_modules;
- char **bad_module_filenames;
char *kernel_module_build_directory;
char *uvm_module_build_directory;
char *precompiled_kernel_interface_directory;
diff --git a/user-interface.c b/user-interface.c
index 8009672..0bd0540 100644
--- a/user-interface.c
+++ b/user-interface.c
@@ -59,6 +59,10 @@ extern InstallerUI stream_ui_dispatch_table;
extern const char ncurses_ui_array[];
extern const int ncurses_ui_array_size;
+#if defined(NV_INSTALLER_NCURSES6)
+extern const char ncurses6_ui_array[];
+extern const int ncurses6_ui_array_size;
+#endif
/* struct describing the ui data */
@@ -98,74 +102,76 @@ int ui_init(Options *op)
int i;
user_interface_attribute_t ui_list[] = {
/* { "nvidia-installer GTK+ user interface", NULL, NULL, 0 }, */
+#if defined(NV_INSTALLER_NCURSES6)
+ { "ncurses6", "nvidia-installer ncurses v6 user interface", NULL,
+ ncurses6_ui_array, ncurses6_ui_array_size },
+#endif
{ "ncurses", "nvidia-installer ncurses user interface", NULL,
ncurses_ui_array, ncurses_ui_array_size },
{ "none", NULL, NULL, NULL, 0 }
};
-
+
/* dlopen() the appropriate ui shared lib */
-
+
__ui = NULL;
- if (op->ui_str) {
- for (i = 0; i < ARRAY_LEN(ui_list); i++) {
- if (strcmp(op->ui_str, ui_list[i].name) == 0) {
- break;
+ if (!op->silent) {
+ if (op->ui_str) {
+ for (i = 0; i < ARRAY_LEN(ui_list); i++) {
+ if (strcmp(op->ui_str, ui_list[i].name) == 0) {
+ break;
+ }
}
- }
- if (i == ARRAY_LEN(ui_list)) {
- log_printf(op, NULL, "Invalid \"ui\" option: %s", op->ui_str);
+ if (i == ARRAY_LEN(ui_list)) {
+ log_printf(op, NULL, "Invalid \"ui\" option: %s", op->ui_str);
+ i = 0;
+ }
+ } else {
i = 0;
}
- } else {
- i = 0;
- }
- if (op->silent) {
- i = 1;
- }
-
- for (; ui_list[i].descr && !__ui; i++) {
-
- if (!extract_user_interface(op, &ui_list[i])) continue;
-
- handle = dlopen(ui_list[i].filename, RTLD_NOW);
-
- if (handle) {
- __ui = dlsym(handle, "ui_dispatch_table");
- if (__ui && __ui->detect(op)) {
- log_printf(op, NULL, "Using: %s", ui_list[i].descr);
- __extracted_user_interface_filename = ui_list[i].filename;
- break;
+ for (; ui_list[i].descr && !__ui; i++) {
+
+ if (!extract_user_interface(op, &ui_list[i])) continue;
+
+ handle = dlopen(ui_list[i].filename, RTLD_NOW);
+
+ if (handle) {
+ __ui = dlsym(handle, "ui_dispatch_table");
+ if (__ui && __ui->detect(op)) {
+ log_printf(op, NULL, "Using: %s", ui_list[i].descr);
+ __extracted_user_interface_filename = ui_list[i].filename;
+ break;
+ } else {
+ log_printf(op, NULL, "Unable to initialize: %s",
+ ui_list[i].descr);
+ dlclose(handle);
+ __ui = NULL;
+ }
} else {
- log_printf(op, NULL, "Unable to initialize: %s",
- ui_list[i].descr);
- dlclose(handle);
- __ui = NULL;
+ log_printf(op, NULL, "Unable to load: %s", ui_list[i].descr);
+ log_printf(op, NULL, "");
}
- } else {
- log_printf(op, NULL, "Unable to load: %s", ui_list[i].descr);
- log_printf(op, NULL, "");
}
}
-
+
/* fall back to the always built-in stream ui */
if (!__ui) {
__ui = &stream_ui_dispatch_table;
log_printf(op, NULL, "Using built-in stream user interface");
}
-
+
/*
* init the ui
*
* XXX if init() fails, we should try to fall back to the build-in
* stream ui.
*/
-
+
if (!__ui->init(op, nv_format_text_rows)) return FALSE;
-
+
/* handle some common signals */
signal(SIGHUP, ui_signal_handler);
diff --git a/version.mk b/version.mk
index 9cb195e..b77a6a6 100644
--- a/version.mk
+++ b/version.mk
@@ -1 +1 @@
-NVIDIA_VERSION = 340.96
+NVIDIA_VERSION = 340.98