Re: [PATCH] modutils-2.1.121: make kerneld work with 2.0.x, &c

Steve Dodd (dirk@loth.demon.co.uk)
Tue, 19 Jan 1999 04:06:34 +0000


--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii

Hi,

On Tue, Jan 19, 1999 at 03:12:23AM +0000, Steve Dodd wrote:

> Here is a patch to modutils-2.1.121 which

Duh. Here is the patch. Really. Honestly.

-- 
Fortune: You will be attacked next Wednesday at 3:15 p.m. by six samuri
sword wielding purple fish glued to Harley-Davidson motorcycles.

--k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="modutils.patch"

diff -ur modutils-2.1.121/ChangeLog modutils-2.2.0-pre7/ChangeLog --- modutils-2.1.121/ChangeLog Mon Sep 14 19:53:29 1998 +++ modutils-2.2.0-pre7/ChangeLog Tue Jan 19 02:51:35 1999 @@ -1,3 +1,14 @@ +Tue Jan 19 02:49:27 GMT 1999 Steve Dodd <dirk@loth.demon.co.uk> + + * Added NEW_KERNELD_PROTOCOL into include/kerneld.h, but make + default to undefined, so kerneld works with 2.0.x kernels. + + * Added some warning messages to kerneld if your running kernel + version doesn't match your NEW_KERNELD_PROTOCOL setting, or if + you shouldn't be running kerneld at all! + + * Bumped the version number. + Sun Sep 13 09:52:39 PDT 1998 Richard Henderson <rth@cygnus.com> * Release version 2.1.121. diff -ur modutils-2.1.121/include/kerneld.h modutils-2.2.0-pre7/include/kerneld.h --- modutils-2.1.121/include/kerneld.h Mon Sep 14 19:55:00 1998 +++ modutils-2.2.0-pre7/include/kerneld.h Tue Jan 19 02:58:34 1999 @@ -6,6 +6,18 @@ #ident "$Id: kerneld.h,v 1.1 1998/04/25 20:02:37 rth Exp $" +/* + * Uncomment this line to get the 'new' kerneld protocol. Kernels 2.0.x + * do not use this new protocol (at least, not by default). I suspect + * some 2.1.x kernels may have done, but 2.2.x does not use kerneld and + * supercedes 2.1.x anyway. It seems to be sensible here to compile for + * compatability with 2.0.x, in case people want to dual boot for a + * while. Hence, this is NOT enabled by default (unlike modutils 2.1.121). + */ + +/* #define NEW_KERNELD_PROTOCOL +*/ + #define KERNELD_SYSTEM 1 #define KERNELD_REQUEST_MODULE 2 /* "insmod" */ #define KERNELD_RELEASE_MODULE 3 /* "rmmod" */ @@ -16,11 +28,21 @@ #define KERNELD_PNP 8 /* drivers/pnp/kerneld.c */ #define KERNELD_ARP 256 /* net/ipv4/arp.c */ +#ifdef NEW_KERNELD_PROTOCOL + #define OLDIPC_KERNELD 00040000 /* old kerneld message channel */ #define IPC_KERNELD 00140000 /* new kerneld message channel */ #define KDHDR (sizeof(long) + sizeof(short) + sizeof(short)) #define NULL_KDHDR 0, 2, 0 +#else /* NEW_KERNELD_PROTOCOL */ + +#define IPC_KERNELD 00040000 +#define KDHDR (sizeof(long)) +#define NULL_KDHDR 0 + +#endif /* NEW_KERNELD_PROTOCOL */ + #define KERNELD_MAXCMD 0x7ffeffff #define KERNELD_MINSEQ 0x7fff0000 /* "commands" legal up to 0x7ffeffff */ #define KERNELD_WAIT 0x80000000 @@ -30,8 +52,10 @@ { long mtype; long id; +#ifdef NEW_KERNELD_PROTOCOL short version; short pid; +#endif /* NEW_KERNELD_PROTOCOL */ char text[1]; }; diff -ur modutils-2.1.121/include/version.h modutils-2.2.0-pre7/include/version.h --- modutils-2.1.121/include/version.h Mon Sep 14 19:55:07 1998 +++ modutils-2.2.0-pre7/include/version.h Tue Jan 19 02:45:50 1999 @@ -1 +1 @@ -#define MODUTILS_VERSION "2.1.121" +#define MODUTILS_VERSION "2.2.0-pre7" diff -ur modutils-2.1.121/kerneld/kerneld.c modutils-2.2.0-pre7/kerneld/kerneld.c --- modutils-2.1.121/kerneld/kerneld.c Mon Sep 14 19:55:48 1998 +++ modutils-2.2.0-pre7/kerneld/kerneld.c Tue Jan 19 02:56:00 1999 @@ -777,6 +777,28 @@ struct utsname uts_info; struct sigaction sa; sigset_t hold_signals; + + uname(&uts_info); + +#ifdef NEW_KERNELD_PROTOCOL + if( uts_info.release[0] < '2' || ( uts_info.release[0] == '2' && + uts_info.release[2] == '0' ) ) { + printf( "kerneld: warning, kerneld compiled with NEW_KERNELD_PROTOCOL " + "running on\n\t kernel <= 2.0; may well not work correctly.\n" ); + } +#endif + + if( uts_info.release[0] == '2' && uts_info.release[2] == '1' ) { + printf( "kerneld: hmm, no idea whether this version of kerneld will " + "work with your 2.1.x kernel. Upgrade to 2.2.x?\n" ); + } + + if( uts_info.release[0] > '2' || ( uts_info.release[0] == '2' && + uts_info.release[2] > '1' ) ) { + printf( "kerneld: you almost certainly don't want to be running " + "kerneld with >= 2.2.x\n\t kernels; read /usr/src/linux/Document" + "ation/kmod.txt.\n" ); + } /* make me a daemon */ if ((pid = fork()) != 0) { @@ -797,7 +819,6 @@ setbuf(stdout, NULL); syslog (LOG_INFO,"started, pid=%d, qid=%d", getpid(), qid); - uname(&uts_info); sprintf(kd_dbmfile, "/lib/modules/%s/persist.gdbm", uts_info.release); gdbm_reload(0); /* dummy arg */

--k1lZvvs/B4yU6o8G--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/