diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2008-10-29 16:17:00 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2008-10-29 16:17:00 -0700 |
commit | 93461d368967342e206d2f5fbe3eb0307af98bb4 (patch) | |
tree | 020457ee02a2f7f8b3f6c9450c1e5a0683ff281e | |
parent | 292703f5c8bfcda129f1b92fe9a77b289ee89342 (diff) |
71.86.0771.86.07
-rw-r--r-- | DRIVER_VERSION | 2 | ||||
-rw-r--r-- | kernel.c | 31 | ||||
-rw-r--r-- | misc.c | 4 | ||||
-rw-r--r-- | nvidia-installer.h | 2 | ||||
-rw-r--r-- | snarf.c | 6 | ||||
-rw-r--r-- | update.c | 9 |
6 files changed, 44 insertions, 10 deletions
diff --git a/DRIVER_VERSION b/DRIVER_VERSION index e1a9ec3..dd1ac03 100644 --- a/DRIVER_VERSION +++ b/DRIVER_VERSION @@ -1 +1 @@ -71.86.06 +71.86.07 @@ -668,8 +668,8 @@ void check_for_warning_messages(Options *op) int test_kernel_module(Options *op, Package *p) { char *cmd = NULL, *data; - int old_loglevel, new_loglevel = 0; - int ret, name[] = { CTL_KERN, KERN_PRINTK }; + int old_loglevel = 0, new_loglevel = 0; + int fd, ret, name[] = { CTL_KERN, KERN_PRINTK }; size_t len = sizeof(int); /* @@ -685,9 +685,17 @@ int test_kernel_module(Options *op, Package *p) * Save the original console loglevel to allow restoring it once * we're done. */ - if (!sysctl(name, 2, &old_loglevel, &len, NULL, 0)) { - new_loglevel = 2; /* KERN_CRIT */ - sysctl(name, 2, NULL, 0, &new_loglevel, len); + fd = open("/proc/sys/kernel/printk", O_RDWR); + if (fd >= 0) { + if (read(fd, &old_loglevel, 1) == 1) { + new_loglevel = '2'; /* KERN_CRIT */ + write(fd, &new_loglevel, 1); + } + } else { + if (!sysctl(name, 2, &old_loglevel, &len, NULL, 0)) { + new_loglevel = 2; /* KERN_CRIT */ + sysctl(name, 2, NULL, 0, &new_loglevel, len); + } } /* @@ -770,9 +778,16 @@ int test_kernel_module(Options *op, Package *p) nvfree(cmd); nvfree(data); - - if (new_loglevel != 0) sysctl(name, 2, NULL, 0, &old_loglevel, len); - + + if (fd >= 0) { + if (new_loglevel != 0) + write(fd, &old_loglevel, 1); + close(fd); + } else { + if (new_loglevel != 0) + sysctl(name, 2, NULL, 0, &old_loglevel, len); + } + return ret; } /* test_kernel_module() */ @@ -695,7 +695,9 @@ int find_system_utils(Options *op) { "grep", "grep" }, { "dmesg", "util-linux" }, { "tail", "coreutils" }, - { "cut", "coreutils" } + { "cut", "coreutils" }, + { "tr", "coreutils" }, + { "sed", "sed" } }; /* keep in sync with the SystemOptionalUtils enum type */ diff --git a/nvidia-installer.h b/nvidia-installer.h index 0e87fdf..e719b8a 100644 --- a/nvidia-installer.h +++ b/nvidia-installer.h @@ -46,6 +46,8 @@ typedef enum { DMESG, TAIL, CUT, + TR, + SED, MAX_SYSTEM_UTILS } SystemUtils; @@ -68,6 +68,12 @@ int snarf(Options *op, const char *url, int out_fd, uint32 flags) UrlResource *rsrc = NULL; int ret; + if (op->no_network) { + ui_error(op, "Unable to access file '%s', because the '--no-network' " + "commandline option was specified.", url); + return FALSE; + } + rsrc = url_resource_new(); rsrc->url = url_new(); rsrc->op = op; @@ -284,6 +284,15 @@ static int get_latest_driver_version_and_filename(Options *op, url = nvstrcat(op->ftp_site, "/XFree86/", INSTALLER_OS, "-", INSTALLER_ARCH, "/latest.txt", NULL); + /* check for no_network option */ + + if (op->no_network) { + ui_error(op, "Unable to determine most recent NVIDIA %s-%s driver " + "version: cannot access '%s', because the '--no-network' " + "commandline option was specified.", INSTALLER_OS, INSTALLER_ARCH, url); + goto done; + } + if ((fd = mkstemp(tmpfile)) == -1) { ui_error(op, "Unable to create temporary file (%s)", strerror(errno)); goto done; |