diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2018-03-14 16:52:56 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2018-03-14 16:52:56 -0700 |
commit | 513d9b56a03260e4bd213fe95a004f972d1b2909 (patch) | |
tree | 59bd709479415c5ed1cbbb36b8021937d2a7079e | |
parent | 8390b34838d614caf3d1f40027e5e5a747f56d6a (diff) |
390.42390.42
-rw-r--r-- | files.c | 66 | ||||
-rw-r--r-- | files.h | 1 | ||||
-rw-r--r-- | install-from-cwd.c | 4 | ||||
-rw-r--r-- | ncurses-ui.c | 27 | ||||
-rw-r--r-- | nvidia-installer-ui.h | 8 | ||||
-rw-r--r-- | nvidia-installer.c | 4 | ||||
-rw-r--r-- | nvidia-installer.h | 3 | ||||
-rw-r--r-- | option_table.h | 22 | ||||
-rw-r--r-- | stream-ui.c | 48 | ||||
-rw-r--r-- | user-interface.c | 14 | ||||
-rw-r--r-- | user-interface.h | 1 | ||||
-rw-r--r-- | version.mk | 2 |
12 files changed, 13 insertions, 187 deletions
@@ -925,72 +925,6 @@ int set_destinations(Options *op, Package *p) /* - * get_license_acceptance() - stat the license file to find out its - * length, open the file, mmap it, and pass it to the ui for - * acceptance. - */ - -int get_license_acceptance(Options *op) -{ - struct stat buf; - char *text = MAP_FAILED, *tmp = NULL; - int fd = -1, accepted = FALSE, size = 0; - - /* trivial accept if the user accepted on the command line */ - - if (op->accept_license) { - ui_log(op, "License accepted by command line option."); - return TRUE; - } - - if ((fd = open(LICENSE_FILE, 0x0)) == -1) goto done; - - if (fstat(fd, &buf) != 0) goto done; - - size = buf.st_size; - - if ((text = (char *) mmap(NULL, size, PROT_READ, - MAP_FILE|MAP_SHARED, - fd, 0x0)) == MAP_FAILED) goto done; - - /* - * the mmap'ed license file may not be NULL terminated, so copy it - * into a temporary buffer and explicity NULL terminate the string - */ - - tmp = nvalloc(size + 1); - memcpy(tmp, text, size); - tmp[size] = '\0'; - - if (!ui_display_license(op, tmp)) { - ui_message(op, "License not accepted. Aborting installation."); - } else { - ui_log(op, "License accepted."); - accepted = TRUE; - } - - done: - - nvfree(tmp); - - if (text == MAP_FAILED || fd == -1) { - ui_error(op, "Unable to open License file '%s' (%s)", - LICENSE_FILE, strerror(errno)); - } - - if (text != MAP_FAILED) { - munmap(text, size); - } - if (fd != -1) { - close(fd); - } - - return accepted; -} - - - -/* * get_prefixes() - if in expert mode, ask the user for the OpenGL and * XFree86 installation prefix. The default prefixes are already set * in parse_commandline(). @@ -31,7 +31,6 @@ char *write_temp_file(Options *op, const int len, const unsigned char *data, mode_t perm); void select_tls_class(Options *op, Package *p); /* XXX move? */ int set_destinations(Options *op, Package *p); /* XXX move? */ -int get_license_acceptance(Options *op); /* XXX move? */ int get_prefixes(Options *op); /* XXX move? */ void add_kernel_modules_to_package(Options *op, Package *p); void remove_non_kernel_module_files_from_package(Options *op, Package *p); diff --git a/install-from-cwd.c b/install-from-cwd.c index 43266a1..c35ade0 100644 --- a/install-from-cwd.c +++ b/install-from-cwd.c @@ -128,10 +128,6 @@ int install_from_cwd(Options *op) if (!check_for_unloaded_kernel_module(op)) goto failed; - /* ask the user to accept the license */ - - if (!get_license_acceptance(op)) goto exit_install; - ui_log(op, "Installing NVIDIA driver version %s.", p->version); /* diff --git a/ncurses-ui.c b/ncurses-ui.c index e28f229..6cded0b 100644 --- a/ncurses-ui.c +++ b/ncurses-ui.c @@ -154,7 +154,6 @@ static int nv_ncurses_init (Options*, static void nv_ncurses_set_title (Options*, const char*); static char *nv_ncurses_get_input (Options*, const char*, const char*); -static int nv_ncurses_display_license (Options*, const char*); static void nv_ncurses_message (Options*, const int level, const char*); static void nv_ncurses_command_output (Options*, const char*); @@ -247,7 +246,6 @@ InstallerUI ui_dispatch_table = { nv_ncurses_init, nv_ncurses_set_title, nv_ncurses_get_input, - nv_ncurses_display_license, nv_ncurses_message, nv_ncurses_command_output, nv_ncurses_approve_command_list, @@ -619,31 +617,6 @@ static char *nv_ncurses_get_input(Options *op, - -/* - * nv_ncurses_display_license() - print the text from the license file, - * prompt for acceptance from the user, and return whether or not the - * user accepted. - */ - -static int nv_ncurses_display_license(Options *op, const char *license) -{ - static const char *descr = "Please read the following LICENSE " - "and then select either \"Accept\" to accept the license " - "and continue with the installation, or select " - "\"Do Not Accept\" to abort the installation."; - - static const char *buttons[2] = {"Accept", "Do Not Accept"}; - - int ret = nv_ncurses_paged_prompt(op, descr, "NVIDIA Software License", - license, buttons, 2, 1); - - return ret == 0; -} /* nv_ncurses_display_license() */ - - - - /* * nv_ncurses_message() - print a message */ diff --git a/nvidia-installer-ui.h b/nvidia-installer-ui.h index 77feab0..4e561c4 100644 --- a/nvidia-installer-ui.h +++ b/nvidia-installer-ui.h @@ -65,14 +65,6 @@ typedef struct __nv_installer_ui { char *(*get_input)(Options *op, const char *def, const char *msg); - /* - * display_license - given the text from the license file, display - * the text to the user and prompt the user for acceptance. - * Returns whether or not the user accepted the license. - */ - - int (*display_license)(Options *op, const char *license); - /* * message - display a message at the specified message level; the * possible message levels are: diff --git a/nvidia-installer.c b/nvidia-installer.c index 1e6d6f6..9c01f9b 100644 --- a/nvidia-installer.c +++ b/nvidia-installer.c @@ -194,7 +194,7 @@ static void parse_commandline(int argc, char *argv[], Options *op) switch (c) { - case 'a': op->accept_license = TRUE; break; + case 'a': /* ignored (but retained for compatibility) */ break; case 'e': op->expert = TRUE; break; case 'v': print_version(); exit(0); break; case 'd': op->debug = TRUE; break; @@ -217,7 +217,7 @@ static void parse_commandline(int argc, char *argv[], Options *op) break; case 'X': op->run_nvidia_xconfig = TRUE; break; case 's': - op->silent = op->no_questions = op->accept_license = TRUE; + op->silent = op->no_questions = TRUE; op->ui_str = "none"; break; case 'z': op->no_nouveau_check = TRUE; break; diff --git a/nvidia-installer.h b/nvidia-installer.h index acca351..86e119d 100644 --- a/nvidia-installer.h +++ b/nvidia-installer.h @@ -108,7 +108,6 @@ typedef uint8_t uint8; typedef struct __options { - int accept_license; int expert; int uninstall; int skip_module_unload; @@ -523,8 +522,6 @@ typedef struct __package { #define DEFAULT_PROC_MOUNT_POINT "/proc" -#define LICENSE_FILE "LICENSE" - #define DEFAULT_LOG_FILE_NAME "/var/log/nvidia-installer.log" #define DEFAULT_UNINSTALL_LOG_FILE_NAME "/var/log/nvidia-uninstall.log" diff --git a/option_table.h b/option_table.h index c98b99a..571ee6c 100644 --- a/option_table.h +++ b/option_table.h @@ -110,13 +110,6 @@ enum { static const NVGetoptOption __options[] = { /* These options are printed by "nvidia-installer --help" */ - { "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)." }, - { "version", 'v', NVGETOPT_HELP_ALWAYS | NVGETOPT_OPTION_APPLIES_TO_NVIDIA_UNINSTALL, NULL, "Print the nvidia-installer version and exit." }, @@ -133,6 +126,14 @@ static const NVGetoptOption __options[] = { /* These options are only printed by "nvidia-installer --advanced-help" */ + { "accept-license", 'a', 0, NULL, + "This option is obsolete and ignored by nvidia-installer. It is " + "provided for compatibility with older versions of nvidia-installer, " + "which required this option for explicit license acceptance. " + "Use of the NVIDIA driver implies acceptance of the NVIDIA Software " + "License Agreement, contained in the file 'LICENSE' (in the top " + "level directory of the driver package)." }, + { "driver-info", 'i', 0, NULL, "Print information about the currently installed NVIDIA " "driver version." }, @@ -159,15 +160,12 @@ static const NVGetoptOption __options[] = { "Do not ask any questions; the default (normally 'yes') " "is assumed for " "all yes/no questions, and the default string is assumed in " - "any situation where the user is prompted for string input. " - "The one question that is not bypassed by this option is " - "license acceptance; the license may be accepted with the " - "commandline option '--accept-license'." }, + "any situation where the user is prompted for string input." }, { "silent", 's', NVGETOPT_OPTION_APPLIES_TO_NVIDIA_UNINSTALL, 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'." }, + "implies '--ui=none --no-questions'." }, { "x-prefix", X_PREFIX_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, "The prefix under which the X components of the " diff --git a/stream-ui.c b/stream-ui.c index 364ad0a..1fe3415 100644 --- a/stream-ui.c +++ b/stream-ui.c @@ -41,7 +41,6 @@ int stream_detect (Options*); int stream_init (Options*, FormatTextRows format_text_rows); void stream_set_title (Options*, const char*); char *stream_get_input (Options*, const char*, const char*); -int stream_display_license (Options*, const char*); void stream_message (Options*, int level, const char*); void stream_command_output (Options*, const char*); int stream_approve_command_list(Options*, CommandList*, const char*); @@ -60,7 +59,6 @@ InstallerUI stream_ui_dispatch_table = { stream_init, stream_set_title, stream_get_input, - stream_display_license, stream_message, stream_command_output, stream_approve_command_list, @@ -210,52 +208,6 @@ char *stream_get_input(Options *op, const char *def, const char *msg) /* - * stream_display_license() - print the text from the license file, - * prompt for acceptance from the user, and return whether or not the - * user accepted. - */ - -int stream_display_license(Options *op, const char *license) -{ - char *str; - - nv_info_msg(NULL, ""); - nv_info_msg(NULL, "Please read the following LICENSE and type \"" - "accept\" followed by the Enter key to accept the " - "license, or type anything else to not accept and " - "exit nvidia-installer."); - nv_info_msg(NULL, ""); - - nv_info_msg(NULL, "________"); - nv_info_msg(NULL, ""); - printf("%s", license); - nv_info_msg(NULL, "________"); - nv_info_msg(NULL, ""); - - printf("Accept? (Type \"Accept\" to accept, or anything else to abort): "); - fflush(stdout); - - str = fget_next_line(stdin, NULL); - if (strlen(str) < 6) { - free(str); - return FALSE; - } - - str[7] = '\0'; - - if (strcasecmp(str, "ACCEPT") == 0) { - free(str); - return TRUE; - } else { - free(str); - return FALSE; - } - -} /* stream_display_license() */ - - - -/* * stream_message() - print a message */ diff --git a/user-interface.c b/user-interface.c index f586f50..32b76e2 100644 --- a/user-interface.c +++ b/user-interface.c @@ -241,20 +241,6 @@ char *ui_get_input(Options *op, const char *def, const char *fmt, ...) /* - * ui_display_license() - */ - -int ui_display_license (Options *op, const char *license) -{ - if (op->silent) return TRUE; - - return __ui->display_license(op, license); - -} /* ui_display_license() */ - - - -/* * ui_error() - have the ui display an error message */ diff --git a/user-interface.h b/user-interface.h index ff8afd7..9ad2bda 100644 --- a/user-interface.h +++ b/user-interface.h @@ -36,7 +36,6 @@ extern const char * const CONTINUE_ABORT_CHOICES[]; int ui_init (Options*); void ui_set_title (Options*, const char*, ...) NV_ATTRIBUTE_PRINTF(2, 3); char *ui_get_input (Options*, const char*, const char*, ...) NV_ATTRIBUTE_PRINTF(3, 4); -int ui_display_license (Options*, const char*); void ui_error (Options*, const char*, ...) NV_ATTRIBUTE_PRINTF(2, 3); void ui_warn (Options*, const char*, ...) NV_ATTRIBUTE_PRINTF(2, 3); void ui_message (Options*, const char*, ...) NV_ATTRIBUTE_PRINTF(2, 3); @@ -1 +1 @@ -NVIDIA_VERSION = 390.25 +NVIDIA_VERSION = 390.42 |