Comment 6 for bug 24672

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Fri, 28 Oct 2005 18:04:51 -0700
From: Jamie Heilman <email address hidden>
To: <email address hidden>
Cc: <email address hidden>
Subject: Re: /etc/init.d/nvidia-kernel contains bashisms

New version is still broken. The way 20051026+1 is written, if
NVIDIA_CARDS is 0 then make_nodes is still run, possibly creating
/dev/nvidiactl needlessly. Also, expr in bash apparently lets you get
away with the form of variable expansion you used, but dash does not.
Look at the patch I gave you again, it was correct, and now here's
patch against version 20051026+1:

@@ -6,7 +6,7 @@
 [ -r /etc/default/nvidia-kernel ] && . /etc/default/nvidia-kernel

 # test if anything is requested
-if [ -z "$NVIDIA_CARDS" ] || [ "$NVIDIA_CARDS" -lt 0 ]; then
+if [ -z "$NVIDIA_CARDS" ] || [ "$NVIDIA_CARDS" -lt 1 ]; then
   # Nothing to do but exit.
   exit 0
 fi
@@ -16,7 +16,7 @@
     mknod -m 0660 /dev/nvidiactl c 195 255
     chgrp video /dev/nvidiactl
   fi
- for i in $(seq 0 $((NVIDIA_CARDS - 1))); do
+ for i in $(seq 0 $(($NVIDIA_CARDS - 1))); do
     if ! [ -e /dev/nvidia$i ]; then
       mknod -m 0660 /dev/nvidia$i c 195 $i
       chgrp video /dev/nvidia$i

--
Jamie Heilman http://audible.transient.net/~jamie/
"Most people wouldn't know music if it came up and bit them on the ass."
                                                        -Frank Zappa