diff -Nur modutils-2.3.8/ChangeLog modutils-2.3.9/ChangeLog --- modutils-2.3.8/ChangeLog Sat Dec 11 04:17:50 1999 +++ modutils-2.3.9/ChangeLog Sat Dec 25 14:38:26 1999 @@ -1,3 +1,19 @@ +1999-12-19 Keith Owens + + modutils 2.3.9 + + * Remove devfs.aliases, out of date and to be supplied by + devfsd, not modutils. + * util/alias.h (aliaslist): Add ppdev default alias. Tim Waugh + + * Redo the way the combined module recognizes its function. + Suggested by Stepan Kasal, different implementation by Keith Owens. + * Rationalize the code for common 32/64 bit architectures. + Keith Owens. + * Fix depmod error message. Keith Owens. + * Report correct module name on failure (Debian 53423). Keith Owens. + * Flush last message when using syslog. Maciej W. Rozycki. + 1999-12-11 Keith Owens modutils 2.3.8 diff -Nur modutils-2.3.8/depmod/Makefile.in modutils-2.3.9/depmod/Makefile.in --- modutils-2.3.8/depmod/Makefile.in Tue Dec 7 21:42:01 1999 +++ modutils-2.3.9/depmod/Makefile.in Sun Dec 19 20:23:21 1999 @@ -1,4 +1,4 @@ -# $Id: Makefile.in 1.8 Tue, 07 Dec 1999 21:42:01 +1100 keith $ +# $Id: Makefile.in 1.9 Sun, 19 Dec 1999 20:23:21 +1100 keith $ srcdir=@srcdir@ VPATH=@srcdir@ @@ -18,21 +18,24 @@ INSTALL = @INSTALL_LOCAL@ STRIP = @STRIP@ -DEFSNOARCH = -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS) -DEFS = $(DEFSNOARCH) -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) -OBJS = depmod.o +DEFSNOARCH := -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS) +DEFS := -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) +OBJS := depmod.o ifeq (@COMMON_sparc@,yes) -DEFSNOARCH += -DCOMMON_sparc -OBJS += depmod_64.o +DEFSNOARCH += -DCOMMON_3264 +DEFS += -DONLY_32 +DEFS64 := -DELF_MACHINE_H='"elf_sparc64.h"' -DARCH_sparc64 -DONLY_64 +OBJS += depmod_64.o +endif +# Rule for building 64 bit versions, only used when building common code +# for 32 and 64 bit systems. %_64.o: %.c - $(CC) $(CFLAGS) $(DEFSNOARCH) -DELF_MACHINE_H='"elf_sparc64.h"' \ - -DARCH_sparc64 -c -o $@ $< -endif + $(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS64) -c -o $@ $< %.o: %.c - $(CC) $(CFLAGS) $(DEFS) -c -o $@ $< + $(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS) -c -o $@ $< ###################################################################### @@ -55,7 +58,7 @@ $(INSTALL) $(STRIP) depmod $(sbindir) dep depend .depend: depmod.c - $(CC) -M $(CFLAGS) $(DEFS) $^ > .depend + $(CC) -M $(CFLAGS) $(DEFSNOARCH) $(DEFS) $^ > .depend ifeq (.depend,$(wildcard .depend)) include .depend diff -Nur modutils-2.3.8/depmod/depmod.c modutils-2.3.9/depmod/depmod.c --- modutils-2.3.8/depmod/depmod.c Tue Dec 7 21:42:01 1999 +++ modutils-2.3.9/depmod/depmod.c Mon Dec 20 12:34:51 1999 @@ -27,9 +27,13 @@ Fixes: Add -r flag: Keith Owens October 1999. + + Rationalize common code for 32/64 bit architectures. + Fix error message for modules.dep. + Keith Owens December 1999 */ -#ident "$Id: depmod.c 1.5 Tue, 07 Dec 1999 21:42:01 +1100 keith $" +#ident "$Id: depmod.c 1.7 Mon, 20 Dec 1999 12:34:51 +1100 keith $" #include #include @@ -54,14 +58,6 @@ #include "config.h" #include "modstat.h" -#if defined(COMMON_sparc) -#if defined(ARCH_sparc) -#define main depmod32_main -#elif defined(ARCH_sparc64) -#define main depmod64_main -#endif -#endif - #define ALLOC_MODULE 5000 /* Number of modules we can handle... */ #define ALLOC_SYM 10000 /* Number of symbols allocated per chunk */ @@ -106,6 +102,11 @@ static int showerror; /* Shows undefined symbols */ static int verbose; /* Print all modules visiteds */ +extern int depmod_main(int argc, char **argv); +extern int depmod_main_32(int argc, char **argv); +extern int depmod_main_64(int argc, char **argv); + + /* * Create a symbol definition. * Add defined symbol to the head of the list of defined symbols. @@ -486,7 +487,7 @@ if (pdepfile != NULL) { if ((out = fopen(pdepfile, "w")) == NULL) { - error("Can't open %s", pdepfile); + error("Can't open %s for writing", pdepfile); exit(-1); } } @@ -546,7 +547,11 @@ } } -static void usage() +/* For common 3264, only compile the usage message once, in the 64 bit version */ +#if defined(COMMON_3264) && defined(ONLY_32) +extern void depmod_usage(void); /* Use the copy in the 64 bit version */ +#else /* Common 64 bit version or any non common code - compile usage routine */ +void depmod_usage(void) { fprintf(stderr, "depmod " MODUTILS_VERSION "\n" @@ -576,8 +581,29 @@ "Option '-F kernelsyms': use the file instead of the current kernel symbols.\n" ); } +#endif /* defined(COMMON_3264) && defined(ONLY_32) */ + +#if defined(COMMON_3264) && defined(ONLY_32) +#define DEPMOD_MAIN depmod_main_32 /* 32 bit version */ +#elif defined(COMMON_3264) && defined(ONLY_64) +#define DEPMOD_MAIN depmod_main_64 /* 64 bit version */ +#else +#define DEPMOD_MAIN depmod_main /* Not common 3264 code */ +#endif -int main(int argc, char *argv[]) +/* For common 3264 code, add an overall depmod_main, in the 64 bit version. */ +#if defined(COMMON_3264) && defined(ONLY_64) +int depmod_main(int argc, char **argv) +{ + struct utsname u; + if (!uname (&u) && !strcmp (u.machine, "64")) + return depmod_main_64(argc, argv); + else + return depmod_main_32(argc, argv); +} +#endif /* defined(COMMON_3264) && defined(ONLY_64) */ + +int DEPMOD_MAIN(int argc, char **argv) { int ret = -1; int stdmode = 0; @@ -623,7 +649,7 @@ case '?': case 'h': - usage(); + depmod_usage(); return 0; break; @@ -709,20 +735,12 @@ return ret; } -#if defined(COMMON_sparc) && defined(ARCH_sparc) - -#undef main - -extern int depmod64_main(int argc, char **argv); - -int -main(int argc, char **argv) +/* For common 3264 code, only compile main in the 64 bit version. */ +#if defined(COMMON_3264) && defined(ONLY_32) +/* Use the main in the 64 bit version */ +#else +int main(int argc, char **argv) { - struct utsname u; - - if (!uname (&u) && !strcmp (u.machine, "sparc64")) - return depmod64_main(argc, argv); - else - return depmod32_main(argc, argv); + return depmod_main(argc, argv); } -#endif +#endif /* defined(COMMON_3264) && defined(ONLY_32) */ diff -Nur modutils-2.3.8/devfs.aliases modutils-2.3.9/devfs.aliases --- modutils-2.3.8/devfs.aliases Fri Oct 8 20:23:53 1999 +++ modutils-2.3.9/devfs.aliases Thu Jan 1 10:00:00 1970 @@ -1,90 +0,0 @@ -##################################################################### -# -# This is a set of aliases you can use for supporting devfs: -# -# Put this file in e.g. "/etc/devfs.aliases" -# (I am sure a better file name and directory can be found :-) -# -# Include the following three lines (without the comment character) -# in your /etc/modules.conf: -# -# if -f /etc/devfs.aliases -# include /etc/devfs.aliases -# endif -# -# That's it! -# -# Aliases supplied by Richard Gooch -# Modprobe support by Bjorn Ekwall -# -##################################################################### -# Some specials. -alias /dev/initctl off -alias /dev/log off -alias /dev/fd off -alias /dev/stdin off -alias /dev/stdout off -alias /dev/stderr off - -# Soundcard: alias for gen_sound needed! -alias /dev/sound gen_sound -alias /dev/audio gen_sound -alias /dev/mixer gen_sound -alias /dev/dsp gen_sound -alias /dev/dspW gen_sound -alias /dev/midi gen_sound - -# Floppies -alias /dev/fd?* floppy # Note the '?', i.e. shell globbing! -alias /dev/floppy floppy - -# SCSI HDD -alias /dev/sd* sd - -# SCSI tapes -alias /dev/st* st -alias /dev/nst* st - -# SCSI CD-ROMs -alias /dev/sr* sr_mod - -# SCSI generic -alias /dev/sg* sg - -# IDE CD-ROMs -alias /dev/ide/cd ide-cd - -# IDE CD-floppies -alias /dev/ide/fd ide-floppy - -# RAMDISCs -alias /dev/rd rd -alias /dev/ram* rd - -# Loop devices -alias /dev/loop* loop - -# Parallel port printers -alias /dev/printers lp -alias /dev/lp* lp - -# Joysticks -alias /dev/js* joystick - -# Meta devices -alias /dev/md* md - -# Serial ports -alias /dev/tts serial -alias /dev/ttyS* serial -alias /dev/cua* serial - -# Miscellaneous devices -alias /dev/watchdog gen_watchdog # alias for gen_watchdog needed! -alias /dev/atibm atixlmouse -alias /dev/inportbm msbusmouse -alias /dev/logibm busmouse - -# Video capture devices: alias for gen_video needed! -alias /dev/video* gen_video -alias /dev/vbi* gen_video diff -Nur modutils-2.3.8/include/version.h modutils-2.3.9/include/version.h --- modutils-2.3.8/include/version.h Fri Nov 26 01:08:49 1999 +++ modutils-2.3.9/include/version.h Sat Dec 25 14:34:16 1999 @@ -1 +1 @@ -#define MODUTILS_VERSION "2.3.8" +#define MODUTILS_VERSION "2.3.9" diff -Nur modutils-2.3.8/insmod/Makefile.in modutils-2.3.9/insmod/Makefile.in --- modutils-2.3.8/insmod/Makefile.in Sat Dec 11 04:17:50 1999 +++ modutils-2.3.9/insmod/Makefile.in Sat Dec 25 14:34:16 1999 @@ -1,4 +1,4 @@ -# $Id: Makefile.in 1.15 Sat, 11 Dec 1999 04:17:50 +1100 keith $ +# $Id: Makefile.in 1.17 Sat, 25 Dec 1999 14:34:16 +1100 keith $ srcdir=@srcdir@ VPATH=@srcdir@ @@ -19,50 +19,51 @@ INSTALL = @INSTALL_LOCAL@ STRIP = @STRIP@ -DEFSNOARCH = -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS) -DEFS = $(DEFSNOARCH) -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) +DEFSNOARCH := -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS) +DEFS := -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) -PROGS = insmod modprobe rmmod lsmod ksyms modinfo +PROGS := insmod modprobe rmmod lsmod ksyms modinfo # COMB is the list of utilities to combine with insmod into one executable -COMB = @COMBINE_rmmod@ @COMBINE_modprobe@ @COMBINE_lsmod@ @COMBINE_ksyms@ -COMBDEFS = $(addprefix -DCOMBINE_, $(COMB)) -COMB_STATIC = $(addsuffix .static, $(COMB)) +COMB := @COMBINE_rmmod@ @COMBINE_modprobe@ @COMBINE_lsmod@ @COMBINE_ksyms@ +COMBDEFS := $(addprefix -DCOMBINE_, $(COMB)) +COMB_STATIC := $(addsuffix .static, $(COMB)) -TARGETS_REAL = $(filter-out $(COMB),$(PROGS)) -TARGETS = $(PROGS) +TARGETS_REAL := $(filter-out $(COMB),$(PROGS)) +TARGETS := $(PROGS) ifeq ($(insmod_static),yes) -TARGETS_REAL += insmod.static -TARGETS += insmod.static $(COMB_STATIC) +TARGETS_REAL += insmod.static +TARGETS += insmod.static $(COMB_STATIC) endif -INSMODOBJS = insmod.o -MODINFOOBJS = modinfo.o +INSMODOBJS := insmod.o +MODINFOOBJS := modinfo.o ifeq (@COMMON_sparc@,yes) -INSMODOBJS += insmod_64.o -MODINFOOBJS += modinfo_64.o -DEFSNOARCH += -DCOMMON_sparc +INSMODOBJS += insmod_64.o +MODINFOOBJS += modinfo_64.o +DEFSNOARCH += -DCOMMON_3264 +DEFS += -DONLY_32 +DEFS64 := -DELF_MACHINE_H='"elf_sparc64.h"' -DARCH_sparc64 -DONLY_64 endif -INSMODOBJS += $(addsuffix .o, $(COMB)) +INSMODOBJS += $(addsuffix .o, $(COMB)) #===================================================================== # Rule for building "to-be-combined" modutils object files %.o: %.c - $(CC) $(CFLAGS) $(DEFS) $(COMBDEFS) -c -o $@ $< + $(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS) $(COMBDEFS) -c -o $@ $< -ifeq (@COMMON_sparc@,yes) +# Rule for building 64 bit versions, only used when building common code +# for 32 and 64 bit systems. %_64.o: %.c - $(CC) $(CFLAGS) $(DEFSNOARCH) -DELF_MACHINE_H='"elf_sparc64.h"' \ - -DARCH_sparc64 $(COMBDEFS) -c -o $@ $< -endif + $(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS64) $(COMBDEFS) -c -o $@ $< # Rule for building "normal" modutils executables (non-combined) %: %.c ../util/libutil.a - $(CC) $(CFLAGS) $(DEFS) -o $@ $^ $(LDFLAGS) + $(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS) -o $@ $^ $(LDFLAGS) #===================================================================== @@ -91,8 +92,8 @@ $(INSTALL) $$i $(sbindir); done; for i in $(COMB); do \ ln -sf insmod $(sbindir)/$$i; \ - test "$(insmod_static)" = yes && \ - ln -sf insmod.static $(sbindir)/$$i.static; \ + (test "$(insmod_static)" = yes && \ + ln -sf insmod.static $(sbindir)/$$i.static) || true; \ done clean: @@ -105,7 +106,7 @@ rm -f Makefile dep depend .depend: $(addsuffix .c, $(PROGS)) - $(CC) -M $(CFLAGS) $(DEFS) $^ > .depend + $(CC) -M $(CFLAGS) $(DEFSNOARCH) $(DEFS) $^ > .depend ifeq (.depend,$(wildcard .depend)) include .depend diff -Nur modutils-2.3.8/insmod/insmod.c modutils-2.3.9/insmod/insmod.c --- modutils-2.3.8/insmod/insmod.c Sat Dec 11 04:17:50 1999 +++ modutils-2.3.9/insmod/insmod.c Sun Dec 19 20:23:21 1999 @@ -39,9 +39,12 @@ More flexible recognition of the way the utility was called. Suggested by Stepan Kasal, implemented in a different way by Keith Owens December 1999. + + Rationalize common code for 32/64 bit architectures. + Keith Owens December 1999. */ -#ident "$Id: insmod.c 1.9 Sat, 11 Dec 1999 04:17:50 +1100 keith $" +#ident "$Id: insmod.c 1.10 Sun, 19 Dec 1999 20:23:21 +1100 keith $" #include #include @@ -65,16 +68,6 @@ #include "modstat.h" #include "config.h" -#if defined(COMMON_sparc) -#if defined(ARCH_sparc) -#define main insmod32_main -#elif defined(ARCH_sparc64) -#define main insmod64_main -#endif -#elif defined(COMBINE_rmmod) || defined(COMBINE_modprobe) || defined(COMBINE_ksyms) || defined(COMBINE_lsmod) -#define main insmod_main -#endif - #define STRVERSIONLEN 32 /*======================================================================*/ @@ -89,6 +82,14 @@ static int n_ext_modules_used; static int m_has_modinfo; +extern int insmod_main(int argc, char **argv); +extern int insmod_main_32(int argc, char **argv); +extern int insmod_main_64(int argc, char **argv); +extern int modprobe_main(int argc, char **argv); +extern int rmmod_main(int argc, char **argv); +extern int ksyms_main(int argc, char **argv); +extern int lsmod_main(int argc, char **argv); + /*======================================================================*/ /* Get the kernel version in the canonical integer form. */ @@ -1061,10 +1062,11 @@ /* end compat */ /************************************************************************/ -#if defined(COMMON_sparc) && !defined(ARCH_sparc) -extern void insmod_usage(void); -#else -/* Print the usage message. */ + +/* For common 3264 code, only compile the usage message once, in the 64 bit version */ +#if defined(COMMON_3264) && defined(ONLY_32) +extern void insmod_usage(void); /* Use the copy in the 64 bit version */ +#else /* Common 64 bit version or any non common code - compile usage routine */ void insmod_usage(void) { fputs("Usage:\n" @@ -1092,9 +1094,17 @@ ,stderr); exit(1); } +#endif /* defined(COMMON_3264) && defined(ONLY_32) */ + +#if defined(COMMON_3264) && defined(ONLY_32) +#define INSMOD_MAIN insmod_main_32 /* 32 bit version */ +#elif defined(COMMON_3264) && defined(ONLY_64) +#define INSMOD_MAIN insmod_main_64 /* 64 bit version */ +#else +#define INSMOD_MAIN insmod_main /* Not common code */ #endif -int main(int argc, char **argv) +int INSMOD_MAIN(int argc, char **argv) { int k_version; int k_crcs; @@ -1405,88 +1415,91 @@ return exit_status; } -#if defined(COMMON_sparc) && defined(ARCH_sparc) -extern int insmod64_main(int argc, char **argv); - -#undef main - -#if defined(COMBINE_rmmod) || defined(COMBINE_modprobe) || defined(COMBINE_ksyms) || defined(COMBINE_lsmod) -#define main insmod_main -#endif - -int main(int argc, char **argv) +/* For common 3264 code, add an overall insmod_main, in the 64 bit version. */ +#if defined(COMMON_3264) && defined(ONLY_64) +int insmod_main(int argc, char **argv) { struct utsname u; - - if (!uname (&u) && !strcmp (u.machine, "sparc64")) - return insmod64_main(argc, argv); + if (!uname (&u) && !strcmp (u.machine, "64")) + return insmod_main_64(argc, argv); else - return insmod32_main(argc, argv); + return insmod_main_32(argc, argv); } +#endif /* defined(COMMON_3264) && defined(ONLY_64) */ -#endif - -#if !defined(COMMON_sparc) || !defined(ARCH_sparc64) -#if defined(COMBINE_rmmod) || defined(COMBINE_modprobe) || defined(COMBINE_ksyms) || defined(COMBINE_lsmod) - -#undef main - -#ifdef COMBINE_modprobe -extern int modprobe_main(int argc, char **argv); -#endif -#ifdef COMBINE_rmmod -extern int rmmod_main(int argc, char **argv); -#endif -#ifdef COMBINE_ksyms -extern int ksyms_main(int argc, char **argv); -#endif -#ifdef COMBINE_lsmod -extern int lsmod_main(int argc, char **argv); -#endif +/* For common 3264 code, only compile main in the 64 bit version. */ +#if defined(COMMON_3264) && defined(ONLY_32) +/* Use the main in the 64 bit version */ +#else +/* This mainline looks at the name it was invoked under, checks that the name + * contains exactly one of the possible combined targets and invokes the + * corresponding handler for that function. + */ int main(int argc, char **argv) { + /* List of possible program names and the corresponding mainline routines */ + static struct { char *name; int (*handler)(int, char **); } mains[] = + { + { "insmod", &insmod_main }, + #ifdef COMBINE_modprobe + { "modprobe", &modprobe_main }, + #endif + #ifdef COMBINE_rmmod + { "rmmod", &rmmod_main }, + #endif + #ifdef COMBINE_ksyms + { "ksyms", &ksyms_main }, + #endif + #ifdef COMBINE_lsmod + { "lsmod", &lsmod_main }, + #endif + }; + #define MAINS_NO (sizeof(mains)/sizeof(mains[0])) + static int mains_match; + static int mains_which; + char *p = strrchr(argv[0], '/'); + char error_id1[2048] = "The "; /* Way oversized */ + char error_id2[2048] = ""; /* Way oversized */ + int i; p = p ? p + 1 : argv[0]; - if (strstr(p, "insmod")) - return insmod_main(argc, argv); -#ifdef COMBINE_modprobe - else if (strstr(p, "modprobe")) - return modprobe_main(argc, argv); -#endif -#ifdef COMBINE_rmmod - else if (strstr(p, "rmmod")) - return rmmod_main(argc, argv); -#endif -#ifdef COMBINE_ksyms - else if (strstr(p, "ksyms")) - return ksyms_main(argc, argv); -#endif -#ifdef COMBINE_lsmod - else if (strstr(p, "lsmod")) - return lsmod_main(argc, argv); -#endif - else { - error("The insmod" -#ifdef COMBINE_modprobe - "/modprobe" -#endif -#ifdef COMBINE_rmmod - "/rmmod" -#endif -#ifdef COMBINE_ksyms - "/ksyms" -#endif -#ifdef COMBINE_lsmod - "/lsmod" -#endif - " combined binary is having an identity crisis.\n" - "Please give it a proper name."); - return 1; + for (i = 0; i < MAINS_NO; ++i) { + if (i) { + strcat(error_id1, "/"); + if (i == MAINS_NO-1) + strcat(error_id2, " or "); + else + strcat(error_id2, ", "); + } + strcat(error_id1, mains[i].name); + strcat(error_id2, mains[i].name); + if (strstr(p, mains[i].name)) { + ++mains_match; + mains_which = i; + } } -} -#endif /* Combined executables */ -#endif + /* Finish the error identifiers */ + if (MAINS_NO != 1) + strcat(error_id1, " combined"); + strcat(error_id1, " binary"); + + if (mains_match == 0 && MAINS_NO == 1) + ++mains_match; /* Not combined, any name will do */ + if (mains_match == 0) { + error("%s does not have a recognisable name, the name must contain one of %s.", + error_id1, error_id2); + return(1); + } + else if (mains_match > 1) { + error("%s has an ambiguous name, it must contain %s%s.", + error_id1, MAINS_NO == 1 ? "" : "exactly one of ", error_id2); + return(1); + } + else + return((mains[mains_which].handler)(argc, argv)); +} +#endif /* defined(COMMON_3264) && defined(ONLY_32) */ diff -Nur modutils-2.3.8/insmod/modinfo.c modutils-2.3.9/insmod/modinfo.c --- modutils-2.3.8/insmod/modinfo.c Sat Dec 11 04:17:50 1999 +++ modutils-2.3.9/insmod/modinfo.c Sun Dec 19 20:23:21 1999 @@ -25,9 +25,11 @@ * * optind++ in show_module_info, Salvador Ortiz Garcia * unified module path handling: Bjorn Ekwall February 1999 + * Rationalize common code for 32/64 bit architectures. + * Keith Owens December 1999. */ -#ident "$Id: modinfo.c 1.4 Sat, 11 Dec 1999 04:17:50 +1100 keith $" +#ident "$Id: modinfo.c 1.5 Sun, 19 Dec 1999 20:23:21 +1100 keith $" #include #include @@ -45,12 +47,16 @@ #include "version.h" #include "config.h" -#if defined(COMMON_sparc) -#if defined(ARCH_sparc) +extern int show_module_info(char *filename, char *fmtstr, int do_parameters); +extern int show_module_info_32(char *filename, char *fmtstr, int do_parameters); extern int show_module_info_64(char *filename, char *fmtstr, int do_parameters); -#elif defined(ARCH_sparc64) -#define show_module_info show_module_info_64 -#endif + +#if defined(COMMON_3264) && defined(ONLY_32) +#define SHOW_MODULE_INFO show_module_info_32 /* 32 bit version */ +#elif defined(COMMON_3264) && defined(ONLY_64) +#define SHOW_MODULE_INFO show_module_info_64 /* 64 bit version */ +#else +#define SHOW_MODULE_INFO show_module_info /* Not common 3264 code */ #endif static char *get_modinfo_value(struct obj_file *f, const char *key) @@ -275,7 +281,7 @@ } } -int show_module_info(char *filename, char *fmtstr, int do_parameters) +int SHOW_MODULE_INFO(char *filename, char *fmtstr, int do_parameters) { FILE *fp; struct obj_file *f; @@ -310,8 +316,23 @@ return 0; } -#if !defined(COMMON_sparc) || defined(ARCH_sparc) -void usage(void) +/* For common 3264 code, add an overall show_module_info, in the 64 bit version. */ +#if defined(COMMON_3264) && defined(ONLY_64) +int show_module_info(char *filename, char *fmtstr, int do_parameters) +{ + struct utsname u; + if (!uname (&u) && !strcmp (u.machine, "64")) + return show_module_info_32(filename, fmtstr, do_parameters); + else + return show_module_info_64(filename, fmtstr, do_parameters); +} +#endif /* defined(COMMON_3264) && defined(ONLY_64) */ + +/* For common 3264 code, only compile the usage message once, in the 64 bit version */ +#if defined(COMMON_3264) && defined(ONLY_32) +extern void modinfo_usage(void); /* Use the copy in the 64 bit version */ +#else /* Common 64 bit version or any non common code - compile usage routine */ +void modinfo_usage(void) { printf("usage: modinfo \n"); printf(" -a, --author display module author\n"); @@ -322,7 +343,13 @@ printf(" -V, --version show version\n"); printf(" -h, --help this usage screen\n"); } +#endif /* defined(COMMON_3264) && defined(ONLY_32) */ + +/* For common 3264 code, only compile main in the 64 bit version. */ +#if defined(COMMON_3264) && defined(ONLY_32) +/* Use the main in the 64 bit version */ +#else int main(int argc, char *argv[]) { static struct option long_opts[] = @@ -337,9 +364,6 @@ }; int do_parameters = 0, opt; char *fmtstr = NULL; -#if defined(COMMON_sparc) - struct utsname u; -#endif while ((opt = getopt_long(argc, argv, "adq:pVh", &long_opts[0], NULL)) != EOF) @@ -361,26 +385,18 @@ exit(0); case 'h': default: - usage(); + modinfo_usage(); exit(opt == 'h' ? 0 : 1); } if (optind >= argc) { - usage(); + modinfo_usage(); exit(1); } error_file = "modinfo"; - -#if defined(COMMON_sparc) - if (!uname (&u) && !strcmp (u.machine, "sparc64")) - while (optind < argc) - show_module_info_64(argv[optind++], fmtstr, do_parameters); - else -#endif while (optind < argc) show_module_info(argv[optind++], fmtstr, do_parameters); return 0; } - -#endif /* !defined(COMMON_sparc) || defined(ARCH_sparc) */ +#endif /* defined(COMMON_3264) && defined(ONLY_32) */ diff -Nur modutils-2.3.8/insmod/rmmod.c modutils-2.3.9/insmod/rmmod.c --- modutils-2.3.8/insmod/rmmod.c Sun Nov 21 15:19:53 1999 +++ modutils-2.3.9/insmod/rmmod.c Sat Dec 25 14:34:16 1999 @@ -24,7 +24,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: rmmod.c 1.5 Sun, 21 Nov 1999 15:19:53 +1100 keith $" +#ident "$Id: rmmod.c 1.6 Sat, 25 Dec 1999 14:34:16 +1100 keith $" #include #include @@ -106,7 +106,10 @@ for (i = optind; i < argc; ++i) { if (delete_module(argv[i]) < 0) { ++ret; - perror(argv[1]); + if (errno == ENOENT) + error("module %s is not loaded", argv[i]); + else + perror(argv[i]); } } snap_shot(module_names, n_module_names); diff -Nur modutils-2.3.8/man/kerneld.8 modutils-2.3.9/man/kerneld.8 --- modutils-2.3.8/man/kerneld.8 Wed Aug 25 16:26:49 1999 +++ modutils-2.3.9/man/kerneld.8 Sun Dec 19 20:23:21 1999 @@ -1,11 +1,16 @@ .\" Copyright (c) 1995 Bjorn Ekwall .\" This program is distributed according to the Gnu General Public License. .\" See the file COPYING in the kernel source directory /linux -.\" $Id: kerneld.8 1.1 Wed, 25 Aug 1999 16:26:49 +1000 keith $ +.\" $Id: kerneld.8 1.2 Sun, 19 Dec 1999 20:23:21 +1100 keith $ .\" .TH KERNELD 8 "May 14, 1995" Linux "Linux Extensions" .SH NAME kerneld \- perform kernel action in user space (such as on-demand loading of modules) +.SH WARNING +.B kerneld +is obsolete as of Linux kernel 2.1.90, it was replaced by the kmod +kernel thread and cron entries. Do not even think of using kerneld +unless you are running a 2.0 kernel. .SH SYNOPSIS .B kerneld [ debug ] [ keep ] [ delay= ] [ type= ] diff -Nur modutils-2.3.8/modutils.spec modutils-2.3.9/modutils.spec --- modutils-2.3.8/modutils.spec Wed Dec 8 00:11:22 1999 +++ modutils-2.3.9/modutils.spec Tue Dec 14 11:35:40 1999 @@ -1,6 +1,6 @@ Summary: Module utilities Name: modutils -Version: 2.3.8 +Version: 2.3.9 Release: 1 Copyright: GPL Group: Utilities/System diff -Nur modutils-2.3.8/obj/Makefile.in modutils-2.3.9/obj/Makefile.in --- modutils-2.3.8/obj/Makefile.in Sat Dec 11 04:17:50 1999 +++ modutils-2.3.9/obj/Makefile.in Sun Dec 19 20:23:21 1999 @@ -1,4 +1,4 @@ -# $Id: Makefile.in 1.9 Sat, 11 Dec 1999 04:17:50 +1100 keith $ +# $Id: Makefile.in 1.10 Sun, 19 Dec 1999 20:23:21 +1100 keith $ srcdir=@srcdir@ VPATH=@srcdir@ @@ -18,25 +18,27 @@ INSTALL = @INSTALL_LOCAL@ STRIP = @STRIP@ -DEFSNOARCH = -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS) -DEFS = $(DEFSNOARCH) -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) +DEFSNOARCH := -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS) +DEFS := -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) -LIBOBJ_OBJS := obj_common.o obj_load.o obj_reloc.o obj_$(ARCH).o -LIBOBJ_SRCS := $(LIBOBJ_OBJS:.o=.c) +LIBOBJ_OBJS := obj_common.o obj_load.o obj_reloc.o obj_$(ARCH).o +LIBOBJ_SRCS := $(LIBOBJ_OBJS:.o=.c) ifeq (@COMMON_sparc@,yes) - -LIBOBJ_OBJS += obj_common_64.o obj_load_64.o obj_reloc_64.o obj_sparc64_64.o -LIBOBJ_SRCS += obj_sparc64.c - -%_64.o: %.c - $(CC) $(CFLAGS) $(DEFSNOARCH) -DELF_MACHINE_H='"elf_sparc64.h"' \ - -DARCH_sparc64 -c -o $@ $< - +LIBOBJ_OBJS += obj_common_64.o obj_load_64.o obj_reloc_64.o obj_sparc64_64.o +LIBOBJ_SRCS += obj_sparc64.c +DEFSNOARCH += -DCOMMON_3264 +DEFS += -DONLY_32 +DEFS64 := -DELF_MACHINE_H='"elf_sparc64.h"' -DARCH_sparc64 -DONLY_64 endif %.o: %.c - $(CC) $(CFLAGS) $(DEFS) -c -o $@ $< + $(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS) -c -o $@ $< + +# Rule to make 64 bit versions, only used when building common code for +# 32 and 64 bit systems. +%_64.o: %.c + $(CC) $(CFLAGS) $(DEFSNOARCH) $(DEFS64) -c -o $@ $< ###################################################################### @@ -58,7 +60,7 @@ install-bin: all dep depend .depend: $(LIBOBJ_SRCS) - $(CC) -M $(CFLAGS) $(DEFS) $^ > .depend + $(CC) -M $(CFLAGS) $(DEFSNOARCH) $(DEFS) $^ > .depend ifeq (.depend,$(wildcard .depend)) include .depend diff -Nur modutils-2.3.8/util/alias.h modutils-2.3.9/util/alias.h --- modutils-2.3.8/util/alias.h Tue Oct 12 17:35:26 1999 +++ modutils-2.3.9/util/alias.h Fri Dec 17 10:13:34 1999 @@ -112,6 +112,7 @@ "char-major-57 esp", "char-major-58 esp", "char-major-63 kdebug", + "char-major-99 ppdev", "char-major-107 3dfx", /* from Tigran Aivazian */ "dos msdos", diff -Nur modutils-2.3.8/util/logger.c modutils-2.3.9/util/logger.c --- modutils-2.3.8/util/logger.c Wed Aug 25 16:26:49 1999 +++ modutils-2.3.9/util/logger.c Sat Dec 25 14:38:26 1999 @@ -20,7 +20,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#ident "$Id: logger.c 1.1 Wed, 25 Aug 1999 16:26:49 +1000 keith $" +#ident "$Id: logger.c 1.2 Sat, 25 Dec 1999 14:38:26 +1100 keith $" #include #include @@ -130,6 +130,8 @@ void setsyslog(const char *program) { openlog(program, LOG_CONS, LOG_DAEMON); +#ifdef STOREMSG atexit(dumpmsg); +#endif log = 1; }