public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] fix os release detection in module-init-tools-0.9.6
@ 2002-12-28 10:38 Zhuang, Louis
  2002-12-29  5:54 ` Rusty Russell
  0 siblings, 1 reply; 11+ messages in thread
From: Zhuang, Louis @ 2002-12-28 10:38 UTC (permalink / raw)
  To: Rusty Russell; +Cc: 'linux-kernel@vger.kernel.org'

> Now, why do you want /proc/ksyms exactly?  I'm not hugely opposed to
> it, but it's rarely what people actually want, since it contains only
> exported symbols.
The two things make me want ksyms... ;-)
First, if I'm a stranger to a system, how can I know if a feature
(preemptive, for example) is on/off on that?
Second, when module version is back, how can I know what is the magic
version number on the system?

Yours truly,
  - Louis

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCH] fix os release detection in module-init-tools-0.9.6
@ 2002-12-28  5:49 Zhuang, Louis
  2002-12-28  6:12 ` Rusty Russell
  0 siblings, 1 reply; 11+ messages in thread
From: Zhuang, Louis @ 2002-12-28  5:49 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'; +Cc: 'rusty@rustcorp.com.au'

Dear Rusty,
	IMHO, try_old_version can tell kernel release better with this
patch, don't you? ;->
  - Louis

diff -Nur module-init-tools-0.9.6/backwards_compat.c
module-init-tools-0.9.6-lz1/backwards_compat.c
--- module-init-tools-0.9.6/backwards_compat.c	2002-12-21
12:31:11.000000000 +0800
+++ module-init-tools-0.9.6-lz1/backwards_compat.c	2002-12-28
13:29:50.000000000 +0800
@@ -4,6 +4,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/utsname.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -59,10 +60,14 @@
 static void try_old_version(const char *progname, char *argv[])
 {
 	struct stat buf;
-	/* 2.2 and 2.4 have a syscall.  2.0 doesn't, but does have
-           /proc/ksyms */
+	struct utsname un;
+
+	uname(&un);
+	
+	/* 2.2 and 2.4 have a syscall.  2.0 doesn't, so we compare
+	   release */
 	if (query_module(NULL, 0, NULL, 0, NULL) == 0
-	    || stat("/proc/ksyms", &buf) == 0)
+	    || strncmp("2.0", un.release, 3) == 0)
 		exec_old(progname, argv);
 }
 #else /* CONFIG_NO_BACKWARDS_COMPAT */

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-01-02 16:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-28 10:38 [PATCH] fix os release detection in module-init-tools-0.9.6 Zhuang, Louis
2002-12-29  5:54 ` Rusty Russell
2002-12-29 18:33   ` Randy.Dunlap
2003-01-01 15:51     ` Bill Davidsen
2003-01-01 16:23       ` John Bradford
2003-01-01 18:53         ` Randy.Dunlap
2003-01-02 12:47           ` Bill Davidsen
2003-01-02 13:07             ` John Bradford
2003-01-02 16:22             ` Randy.Dunlap
  -- strict thread matches above, loose matches on Subject: below --
2002-12-28  5:49 Zhuang, Louis
2002-12-28  6:12 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox