diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2003-08-10 20:48:11 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2003-08-10 20:48:11 +0000 |
commit | d94e53a2a9a0c2b79706a2f5fd122982883bf0fc (patch) | |
tree | 2fb795c276b9c9fdfc877ab6facb8fb473113759 /sys-apps | |
parent | New version. Cleanups to devfsd quiet patch (diff) | |
download | historical-d94e53a2a9a0c2b79706a2f5fd122982883bf0fc.tar.gz historical-d94e53a2a9a0c2b79706a2f5fd122982883bf0fc.tar.bz2 historical-d94e53a2a9a0c2b79706a2f5fd122982883bf0fc.zip |
New version. Cleanups to devfsd quiet patch
Diffstat (limited to 'sys-apps')
5 files changed, 288 insertions, 6 deletions
diff --git a/sys-apps/module-init-tools/Manifest b/sys-apps/module-init-tools/Manifest index d73c448d3e27..a35d88d2e67b 100644 --- a/sys-apps/module-init-tools/Manifest +++ b/sys-apps/module-init-tools/Manifest @@ -1,14 +1,12 @@ -MD5 be19fa87e59e1cb61d98f3cc11c0b8ef ChangeLog 7089 +MD5 9ab24427665fce00218b4942723b14a7 ChangeLog 7485 MD5 677553c32e89612435d8adbb6051f3ee module-init-tools-0.9.12.ebuild 4545 MD5 3ba562f50268420056ee5a9447e6412e module-init-tools-0.9.10-r5.ebuild 4729 MD5 4d9578ca5f93a7ec63406b16bd813406 module-init-tools-0.9.12-r1.ebuild 4768 -MD5 a5a75e5330d23df0a6ecdf941266666a module-init-tools-0.9.13_pre2.ebuild 4788 -MD5 d65fe9ab2b7f139f7fbfd7f561b419f8 .module-init-tools-0.9.13_pre2.ebuild.swp 16384 +MD5 c8ccf3f7804e1772ef79b6633c5723c2 module-init-tools-0.9.13_pre2.ebuild 4672 MD5 e689a2069d63d7e2b802ebef7db506a0 module-init-tools-0.9.11-r3.ebuild 4540 MD5 5730ed074b4a6d84e113b52fff303f12 module-init-tools-0.9.11a.ebuild 4546 MD5 28295a2b93ba19ae91062a0078c078f6 files/module-init-tools-0.9.10-be-quiet-for-devfsd.patch 3327 MD5 060ce311606657915548168939e965b4 files/modutils-2.4.22-no-above-below.patch 382 -MD5 fce06786fbdfbae7b5d0f4562a77020a files/modprobe.devfs 4205 MD5 37cda221ca368a67d8a9fd8e6814f62c files/digest-module-init-tools-0.9.12 145 MD5 37cda221ca368a67d8a9fd8e6814f62c files/digest-module-init-tools-0.9.12-r1 145 MD5 ba1718dd25f5cbfac19958b1763691d9 files/module-init-tools-0.9.7-export-gpl.patch 592 @@ -16,10 +14,9 @@ MD5 45ebc93263c86224eb12c3f2c71d9275 files/module-init-tools-0.9.11-be-quiet-for MD5 cef78844d070f59100d7f47b62ecf5d8 files/digest-module-init-tools-0.9.10-r5 144 MD5 8fa0146b2762a25ceb1784a898ff3bc8 files/digest-module-init-tools-0.9.11-r3 144 MD5 06447c844280435b8a96e8b21f5b0a59 files/module-init-tools-0.9.12-includes-should-override.patch 524 -MD5 edda664f4d807a7929f17b58a76d00e6 files/module-init-tools-0.9.11a-modprobe-no_devfsd_hack.patch 761 MD5 71d2757ca730209482fea3cb89648a27 files/digest-module-init-tools-0.9.11a 407 -MD5 107745c71d83425ff63a9d6c7bb2c176 files/modprobe.default 5792 MD5 d35ab1ebe300cc5521be75eff43f9649 files/digest-module-init-tools-0.9.13_pre2 150 MD5 4df8ab0d7f4afe4d13b11732b8eb5508 files/module-init-tools-0.9.10-fix-recursion.patch 1986 MD5 37092cae20ec7562f89aea0205bda5c0 files/module-init-tools-0.9.10-use-modprobe_conf.patch 431 MD5 3bdd37447e200b986159c090991bd6be files/module-init-tools-0.9.10-no-stdout-on-log.patch 787 +MD5 86e20b45d2b65159d422d225468ef960 files/module-init-tools-0.9.13-quiet-on-devfsd-probe-aliases.patch 3490 diff --git a/sys-apps/module-init-tools/files/digest-module-init-tools-0.9.13_pre2 b/sys-apps/module-init-tools/files/digest-module-init-tools-0.9.13_pre2 new file mode 100644 index 000000000000..f31bba2b01dd --- /dev/null +++ b/sys-apps/module-init-tools/files/digest-module-init-tools-0.9.13_pre2 @@ -0,0 +1,2 @@ +MD5 22df9ab7a027718a3cd3fca37c280dd6 module-init-tools-0.9.13-pre2.tar.bz2 113419 +MD5 2c0cca3ef6330a187c6ef4fe41ecaa4d modutils-2.4.25.tar.bz2 220530 diff --git a/sys-apps/module-init-tools/files/module-init-tools-0.9.13-quiet-on-devfsd-probe-aliases.patch b/sys-apps/module-init-tools/files/module-init-tools-0.9.13-quiet-on-devfsd-probe-aliases.patch new file mode 100644 index 000000000000..8a6848cd8a8d --- /dev/null +++ b/sys-apps/module-init-tools/files/module-init-tools-0.9.13-quiet-on-devfsd-probe-aliases.patch @@ -0,0 +1,102 @@ +diff -urpN module-init-tools-0.9.13-pre2/modprobe.c module-init-tools-0.9.13-pre2.devfsd/modprobe.c +--- module-init-tools-0.9.13-pre2/modprobe.c 2003-07-16 09:32:49.000000000 +0200 ++++ module-init-tools-0.9.13-pre2.devfsd/modprobe.c 2003-08-10 20:55:15.281473776 +0200 +@@ -52,6 +52,8 @@ struct module { + + /* Do we use syslog or stderr for messages? */ + static int log; ++/* Should we be totally quiet? */ ++static int quiet = 0; + + static int getlen(const char *fmt, va_list ap) + { +@@ -70,6 +72,9 @@ static void message(const char *prefix, + va_list arglist; + int len; + ++ if (quiet) ++ return; ++ + va_start(arglist, fmt); + len = strlen(prefix) + getlen(fmt, arglist) + 1; + buf = malloc(len); +@@ -87,7 +92,7 @@ static void message(const char *prefix, + + #define warn(fmt, ...) message("WARNING: ", fmt , ## __VA_ARGS__) + #define fatal(fmt, ...) \ +- do { message("FATAL: ", fmt , ## __VA_ARGS__); exit(1); } while(0) ++ do { message("FATAL: ", fmt , ## __VA_ARGS__); if (quiet) exit(0); else exit(1); } while(0) + + static void grammar(const char *cmd, const char *filename, unsigned int line) + { +@@ -1098,6 +1103,7 @@ static struct option options[] = { { "ve + { "showconfig", 0, NULL, 'c' }, + { "autoclean", 0, NULL, 'k' }, + { "quiet", 0, NULL, 'q' }, ++ { "really-quiet", 0, NULL, 'Q' }, + { "show", 0, NULL, 'n' }, + { "dry-run", 0, NULL, 'n' }, + { "syslog", 0, NULL, 's' }, +@@ -1114,6 +1120,7 @@ static struct option options[] = { { "ve + { NULL, 0, NULL, 0 } }; + + #define DEFAULT_CONFIG "/etc/modprobe.conf" ++#define MODPROBE_DEVFSD_CONF "/etc/modprobe.devfs" + + int main(int argc, char *argv[]) + { +@@ -1153,7 +1160,7 @@ int main(int argc, char *argv[]) + try_old_version("modprobe", argv); + + uname(&buf); +- while ((opt = getopt_long(argc, argv, "vVC:o:rknqsclt:aif", options, NULL)) != -1){ ++ while ((opt = getopt_long(argc, argv, "vVC:o:rknqQsclt:aif", options, NULL)) != -1){ + switch (opt) { + case 'v': + add_to_env_var("-v"); +@@ -1206,6 +1213,10 @@ int main(int argc, char *argv[]) + add_to_env_var("-q"); + fail_if_already = 0; + break; ++ case 'Q': ++ add_to_env_var("-Q"); ++ quiet = 1; ++ break; + case 's': + add_to_env_var("-s"); + log = 1; +@@ -1266,7 +1277,7 @@ int main(int argc, char *argv[]) + if (strcmp("/etc/modules.conf", config) == 0) + config = NULL; + else if (strcmp("/etc/modules.devfs", config) == 0) +- config = "/etc/modprobe.devfs"; ++ config = MODPROBE_DEVFSD_CONF; + } + + /* -r only allows certain restricted options */ +@@ -1303,6 +1314,25 @@ int main(int argc, char *argv[]) + argv[optind], 0, + remove, &modoptions, &commands); + ++ /* We want absolutely no output and return 0 if: ++ * ++ * 1) our config file is /etc/modprobe.devfs or /etc/modules.devfs ++ * ++ * 2) the module name starting with '/dev/' ++ * ++ * 3) we are trying to probe an existing alias. ++ * ++ * This is to mimic behaviour from modutils so that we do fill the logs ++ * with errors if devfsd tries to probe aliases in modprobe.devfs */ ++ if (!quiet && !dump_only && config ++ && modname) { /* Are we trying to probe an alias? */ ++ if (strncmp(argv[optind], "/dev/", 5) == 0 ++ && (strcmp(MODPROBE_DEVFSD_CONF, config) == 0)) { ++ add_to_env_var("-Q"); ++ quiet = 1; ++ } ++ } ++ + /* No luck? Try symbol names, if starts with symbol:. */ + if (!modname && strncmp(argv[optind], "symbol:", strlen("symbol:")==0)) + modname = read_config(symfilename, 0, argv[optind], 0, diff --git a/sys-apps/module-init-tools/files/module-init-tools-0.9.7-export-gpl.patch b/sys-apps/module-init-tools/files/module-init-tools-0.9.7-export-gpl.patch new file mode 100644 index 000000000000..5387e0c6d6cb --- /dev/null +++ b/sys-apps/module-init-tools/files/module-init-tools-0.9.7-export-gpl.patch @@ -0,0 +1,12 @@ +--- module-init-tools-0.9.7/moduleops_core.c.chmou 2002-12-26 07:04:42.000000000 +0100 ++++ module-init-tools-0.9.7/moduleops_core.c 2003-01-14 21:24:17.000000000 +0100 +@@ -30,6 +30,9 @@ + ksyms = PERBIT(load_section)(module->mmap, "__ksymtab", &size); + for (i = 0; i < size / sizeof(struct PERBIT(kernel_symbol)); i++) + add_symbol(ksyms[i].name, module); ++ ksyms = PERBIT(load_section)(module->mmap, "__gpl_ksymtab", &size); ++ for (i = 0; i < size / sizeof(struct PERBIT(kernel_symbol)); i++) ++ add_symbol(ksyms[i].name, module); + } + + /* Calculate the dependencies for this module */ diff --git a/sys-apps/module-init-tools/module-init-tools-0.9.13_pre2.ebuild b/sys-apps/module-init-tools/module-init-tools-0.9.13_pre2.ebuild new file mode 100644 index 000000000000..30978eaafa90 --- /dev/null +++ b/sys-apps/module-init-tools/module-init-tools-0.9.13_pre2.ebuild @@ -0,0 +1,169 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/sys-apps/module-init-tools/module-init-tools-0.9.13_pre2.ebuild,v 1.1 2003/08/10 20:45:13 azarah Exp $ + +# This ebuild includes backwards compatability for stable 2.4 kernels +IUSE="" + +inherit flag-o-matic +inherit eutils + +MYP="${P/_pre/-pre}" +S="${WORKDIR}/${MYP}" +MODUTILS_PV="2.4.25" +DESCRIPTION="Kernel module tools for the development kernel >=2.5.48" +SRC_URI="mirror://kernel/linux/kernel/people/rusty/modules/${MYP}.tar.bz2 + mirror://kernel/linux/utils/kernel/modutils/v2.4/modutils-${MODUTILS_PV}.tar.bz2" +HOMEPAGE="http://www.kernel.org/pub/linux/kernel/people/rusty/modules" + +KEYWORDS="~x86 ~amd64 ~ppc ~sparc ~alpha mips ~arm" +LICENSE="GPL-2" +SLOT="0" + +DEPEND="virtual/glibc" +PROVIDE="virtual/modutils" + +src_unpack() { + unpack ${A} + + # With the b0rked modutils, "modprobe hid" does work. But if something + # (like hotplug) tries to auto-load hid (because another module needs it, + # via the kernel module auto-loader) and keybdev.o or mousedev.o don't + # exist, then the "above" clause fails and the hid module never gets + # loaded, and then things like USB will fail. Thus we remove it all + # together. + # + # <drobbins@gentoo.org> (26 Mar 2003) + cd ${WORKDIR}/modutils-${MODUTILS_PV} + epatch ${FILESDIR}/modutils-2.4.22-no-above-below.patch + + # Export GPL symbols - from MDK. + cd ${S}; epatch ${FILESDIR}/${PN}-0.9.7-export-gpl.patch + + # A hack to have absolutely no output if: + # + # 1) our config file is /etc/modprobe.devfs or /etc/modules.devfs + # + # 2) the module name starting with '/dev/' + # + # 3) we are trying to probe an existing alias. + # + # Rasionale: This is what modprobe from modutils does. + # + # <azarah@gentoo.org> (17 Mar 2003) + cd ${S}; epatch ${FILESDIR}/${PN}-0.9.13-quiet-on-devfsd-probe-aliases.patch + + cd ${S} + rm -f missing + automake --add-missing +} + +src_compile() { + local myconf= + + filter-flags -fPIC + + einfo "Building modutils..." + cd ${WORKDIR}/modutils-${MODUTILS_PV} + + econf \ + --disable-strip \ + --prefix=/ \ + --disable-insmod-static \ + --disable-zlib \ + ${myconf} + + emake || die "emake modutils failed" + einfo "Building module-init-tools..." + cd ${S} + + econf \ + --prefix=/ \ + ${myconf} + + emake || die "emake module-init-tools failed" +} + +src_install () { + + cd ${WORKDIR}/modutils-${MODUTILS_PV} + einstall prefix="${D}" + + docinto modutils-${MODUTILS_PV} + dodoc COPYING CREDITS ChangeLog NEWS README TODO + + cd ${S} + # This copies the old version of modutils to *.old so it still works + # with kernels <= 2.4; new versions will execve() the .old version if + # a 2.4 kernel is running... + # This code was borrowed from the module-init-tools Makefile + local runme= + local f= + for f in lsmod modprobe rmmod depmod insmod modinfo + do + if [ -L ${D}/sbin/${f} ] + then + einfo "Moving symlink $f to ${f}.old" + #runme = the target of the symlink with a .old tagged on. + runme=`ls -l ${D}/sbin/${f} | sed 's/.* -> //'`.old + [ ! -e ${D}/sbin/${runme} ] || einfo "${D}/sbin/${runme} not found" + ln -snf $runme ${D}/sbin/${f} || die + elif [ -e ${D}/sbin/${f} ] + then + einfo "Moving executable $f to ${f}.old" + fi + mv -f ${D}/sbin/${f} ${D}/sbin/${f}.old; + done + # Move the man pages as well. We only do this for the man pages of the + # tools that module-init-tools will replace. + for f in ${D}/usr/share/man/man8/{lsmod,modprobe,rmmod,depmod,insmod}.8 + do + mv -f ${f} ${f%\.*}.old.${f##*\.} + done + + einstall prefix=${D} + + # Install compat symlink + dosym ../bin/lsmod /sbin/lsmod + dosym ../sbin/insmod.old /bin/lsmod.old + # Install the modules.conf2modprobe.conf tool, so we can update + # modprobe.conf. + into / + dosbin ${S}/generate-modprobe.conf + # Create the new modprobe.conf + dodir /etc + rm -f ${D}/etc/modprobe.conf + if [ ! -f ${ROOT}/etc/modprobe.devfs ] + then + # Support file for the devfs hack .. needed else modprobe borks. + # Baselayout-1.8.6.3 or there abouts will have a modules-update that + # will correctly generate /etc/modprobe.devfs .... + echo "### This file is automatically generated by modules-update" \ + > ${D}/etc/modprobe.devfs + else + # This is dynamic, so we do not want this in the package ... + rm -f ${D}/etc/modprobe.devfs + fi + + doman *.[1-8] + docinto / + dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO +} + +pkg_postinst() { + if [ "${ROOT}" = "/" ] + then + einfo "Updating config files..." + if [ -x /sbin/modules-update ] + then + /sbin/modules-update + elif [ -x /sbin/update-modules ] + then + /sbin/update-modules + elif [ -x /usr/sbin/update-modules ] + then + /usr/sbin/update-modules + fi + fi +} + |