summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2003-03-15 05:58:45 +0000
committerMartin Schlemmer <azarah@gentoo.org>2003-03-15 05:58:45 +0000
commitfe59f1043ff649840a13eb93a1e47285ca6d8316 (patch)
tree16b8a46d3fb878271acac7dbe1c85e24a29089ec /sys-apps
parentbump (diff)
downloadhistorical-fe59f1043ff649840a13eb93a1e47285ca6d8316.tar.gz
historical-fe59f1043ff649840a13eb93a1e47285ca6d8316.tar.bz2
historical-fe59f1043ff649840a13eb93a1e47285ca6d8316.zip
add module-init-tools-0.9.10-be-quiet-for-devfsd.patch; dont build modutils twice
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/module-init-tools/ChangeLog12
-rw-r--r--sys-apps/module-init-tools/files/digest-module-init-tools-0.9.10-r43
-rw-r--r--sys-apps/module-init-tools/files/module-init-tools-0.9.10-be-quiet-for-devfsd.patch80
-rw-r--r--sys-apps/module-init-tools/files/modutils-2.4.22-no-above-below.patch20
-rw-r--r--sys-apps/module-init-tools/module-init-tools-0.9.10-r4.ebuild223
5 files changed, 337 insertions, 1 deletions
diff --git a/sys-apps/module-init-tools/ChangeLog b/sys-apps/module-init-tools/ChangeLog
index 3002e7122096..2ec0c2750eeb 100644
--- a/sys-apps/module-init-tools/ChangeLog
+++ b/sys-apps/module-init-tools/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for sys-apps/module-init-tools
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/module-init-tools/ChangeLog,v 1.16 2003/03/10 20:34:06 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/module-init-tools/ChangeLog,v 1.17 2003/03/15 05:58:45 azarah Exp $
+
+*module-init-tools-0.9.10-r4 (15 March 2003)
+
+ 15 March 2003; Martin Schlemmer <azarah@gentoo.org> module-init-tools-0.9.10-r4 :
+ - Fix modprobe to handle calls from devfsd more like modprobe from modutils ...
+ it basically do not output and do not fail for invalid modules if:
+ 1) It was called with '-C /etc/modprobe.devfs'
+ 2) The module starts with '/dev'
+ - Redo the /sbin/modprobe.conf stuff to not build both modutils-2.4.22 and
+ 2.4.21.
*module-init-tools-0.9.10-r3 (10 March 2003)
diff --git a/sys-apps/module-init-tools/files/digest-module-init-tools-0.9.10-r4 b/sys-apps/module-init-tools/files/digest-module-init-tools-0.9.10-r4
new file mode 100644
index 000000000000..5d5b645cfd81
--- /dev/null
+++ b/sys-apps/module-init-tools/files/digest-module-init-tools-0.9.10-r4
@@ -0,0 +1,3 @@
+MD5 f8a88214e06d102a2044af3b95256f2a module-init-tools-0.9.10.tar.bz2 99143
+MD5 4c3a76d0917ea3b5309302d8f6c8806c modutils-2.4.21.tar.bz2 217896
+MD5 6c5d2a62ae98708f3ad0c57900d63919 modutils-2.4.22.tar.bz2 219457
diff --git a/sys-apps/module-init-tools/files/module-init-tools-0.9.10-be-quiet-for-devfsd.patch b/sys-apps/module-init-tools/files/module-init-tools-0.9.10-be-quiet-for-devfsd.patch
new file mode 100644
index 000000000000..5e1a00e9f412
--- /dev/null
+++ b/sys-apps/module-init-tools/files/module-init-tools-0.9.10-be-quiet-for-devfsd.patch
@@ -0,0 +1,80 @@
+--- module-init-tools-0.9.10/modprobe.c.orig 2003-03-15 06:51:14.000000000 +0200
++++ module-init-tools-0.9.10/modprobe.c 2003-03-15 07:24:21.000000000 +0200
+@@ -50,6 +50,8 @@
+
+ /* 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)
+ {
+@@ -68,6 +70,9 @@
+ va_list arglist;
+ int len;
+
++ if (quiet)
++ return;
++
+ va_start(arglist, fmt);
+ len = strlen(prefix) + getlen(fmt, arglist) + 1;
+ buf = malloc(len);
+@@ -85,7 +90,7 @@
+
+ #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)
+ {
+@@ -1175,6 +1180,13 @@
+ if (0 == strcmp(getenv("MODPROBE_LOG"), "1"))
+ log = 1;
+
++ /* If no logging, and we have 'MODPROBE_CONFIG=/etc/modprobe.devfs', then
++ * be totally quiet. Note that this catches recursive calls, so it should
++ * not be a first call to modprobe ... */
++ if ((!log) && (!config) && (getenv("MODPROBE_CONFIG")))
++ if (0 == strcmp(getenv("MODPROBE_CONFIG"), "/etc/modprobe.devfs"))
++ quiet = 1;
++
+ /* If logging was requested, do not output to stdout */
+ if (log) {
+ openlog("modprobe", 0, LOG_DAEMON);
+@@ -1226,6 +1238,35 @@
+ }
+ }
+
++ /* Another 'not so horrible' hack to have absolutely no output if we
++ * have no logging enabled, and our config file is /etc/modprobe.devfs
++ *
++ * Rasionale: This is what modprobe from modutils-2.4.22 does:
++ *
++ * gateway root # modprobe /dev/sd1
++ * modprobe: Can't locate module /dev/sd1
++ * gateway root # modprobe -C /etc/modules.conf /dev/sd1
++ * modprobe: Can't locate module /dev/sd1
++ * gateway root # modprobe -C /etc/modules.devfs /dev/sd1
++ * gateway root # modprobe foo
++ * modprobe: Can't locate module foo
++ * gateway root # modprobe -C /etc/modules.conf foo
++ * modprobe: Can't locate module foo
++ * gateway root # modprobe -C /etc/modules.devfs foo
++ * modprobe: Can't locate module foo
++ * gateway root #
++ * gateway root # modprobe -C /etc/modules.devfs /dev/sd1 && echo yes
++ * yes
++ * gateway root # modprobe -C /etc/modules.devfs foo && echo yes
++ * modprobe: Can't locate module foo
++ * gateway root #
++ */
++ if ((!log) && (!quiet) && (!dump_only) &&
++ (strncmp(argv[optind], "/dev/", 5) == 0) &&
++ ((config) && (0 == strcmp(config, "/etc/modprobe.devfs"))))
++ quiet = 1;
++
++
+ /* -r only allows certain restricted options */
+ if (remove) {
+ if (strcmp(optstring, "") != 0)
diff --git a/sys-apps/module-init-tools/files/modutils-2.4.22-no-above-below.patch b/sys-apps/module-init-tools/files/modutils-2.4.22-no-above-below.patch
new file mode 100644
index 000000000000..16e8c2e3155f
--- /dev/null
+++ b/sys-apps/module-init-tools/files/modutils-2.4.22-no-above-below.patch
@@ -0,0 +1,20 @@
+--- util/alias.h.orig 2003-03-15 07:30:21.000000000 +0200
++++ util/alias.h 2003-03-15 07:30:54.000000000 +0200
+@@ -245,9 +245,6 @@
+ */
+ char *above[] =
+ {
+- "hid keybdev mousedev",
+- "usbmouse hid",
+- "wacom evdev",
+ NULL /* marks the end of the list! */
+ };
+
+@@ -258,7 +255,6 @@
+ */
+ char *below[] =
+ {
+- "ov518_decomp ov511",
+ NULL /* marks the end of the list! */
+ };
+
diff --git a/sys-apps/module-init-tools/module-init-tools-0.9.10-r4.ebuild b/sys-apps/module-init-tools/module-init-tools-0.9.10-r4.ebuild
new file mode 100644
index 000000000000..e4e0d3fbcf5a
--- /dev/null
+++ b/sys-apps/module-init-tools/module-init-tools-0.9.10-r4.ebuild
@@ -0,0 +1,223 @@
+# 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.10-r4.ebuild,v 1.1 2003/03/15 05:58:45 azarah Exp $
+
+# This includes backwards compatability for stable kernels
+IUSE=""
+
+inherit flag-o-matic
+
+inherit eutils
+
+# Ok, theory of what we are doing is this: modprobe from modutils
+# later than 2.4.21 have hardcoded 'above' and 'below' stuff that
+# cause generate-modprobe.conf to generate a /etc/modprobe.conf with
+# invalid (linux-2.4) modules in it.
+#
+# Now, one solution is to only use modutils-2.4.21, but then we might
+# cause issues for users that still use 2.4 kernels, as later modutils
+# might fix things ...
+#
+# Solution: build insmod two times, once without the predefined 'above'
+# and 'below' stuff, and install insmod as /sbin/modprobe.conf,
+# and second time build current modutils as we would. Then we
+# tweak generate-modprobe.conf to rather use /sbin/modprobe.conf
+# to generate /etc/modprobe.conf ...
+#
+# <azarah@gentoo.org> (10 March 2003)
+
+MYP="${P/_pre1/-pre}"
+S="${WORKDIR}/${MYP}"
+MODUTILS_PV="2.4.22"
+DESCRIPTION="Kernel module tools for the development kernel >=2.5.48"
+SRC_URI="http://www.kernel.org/pub/linux/kernel/people/rusty/modules/${MYP}.tar.bz2
+ http://www.kernel.org/pub/linux/utils/kernel/modutils/v2.4/modutils-${MODUTILS_PV}.tar.bz2"
+HOMEPAGE="http://www.kernel.org/pub/linux/kernel/people/rusty/modules"
+
+KEYWORDS="~x86 ~ppc ~sparc ~alpha"
+LICENSE="GPL-2"
+SLOT="0"
+
+DEPEND="virtual/glibc"
+RDEPEND=">=sys-apps/devfsd-1.3.25-r1
+ >=sys-kernel/development-sources-2.5.48"
+
+pkg_setup() {
+ check_KV
+
+ if [ ! -f /lib/modules/${KV}/modules.dep ]
+ then
+ eerror "Please compile and install a kernel first!"
+ die "Please compile and install a kernel first!"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ # Fix recursive calls to modprobe not honoring -s, -q, -v and -C
+ epatch ${FILESDIR}/${P}-fix-recursion.patch
+ # Never output to stdout if logging was requested
+ epatch ${FILESDIR}/${P}-no-stdout-on-log.patch
+
+ # Use modprobe without 'above'/'below' stuff that we install as modprobe.conf
+ # when calling generate-modprobe.conf, as the newer modprobe (2.4.22 and later)
+ # generate /etc/modprobe.conf with invalid modules ...
+ epatch ${FILESDIR}/${P}-use-modprobe_conf.patch
+ # For the first run we will build insmod without the predefined
+ # 'above' and 'below' stuff.
+ cd ${WORKDIR}/modutils-${MODUTILS_PV}
+ epatch ${FILESDIR}/modutils-${MODUTILS_PV}-no-above-below.patch
+ cd ${S}
+
+ # If we call modprobe with '-C /dev/modules.conf' and the "module name"
+ # starts with '/dev', modprobe from modutils-2.4.22 do not print any
+ # errors:
+ #
+ # gateway root # modprobe /dev/sd1
+ # modprobe: Can't locate module /dev/sd1
+ # gateway root # modprobe -C /etc/modules.conf /dev/sd1
+ # modprobe: Can't locate module /dev/sd1
+ # gateway root # modprobe -C /etc/modules.devfs /dev/sd1
+ # gateway root # modprobe foo
+ # modprobe: Can't locate module foo
+ # gateway root # modprobe -C /etc/modules.conf foo
+ # modprobe: Can't locate module foo
+ # gateway root # modprobe -C /etc/modules.devfs foo
+ # modprobe: Can't locate module foo
+ # gateway root #
+ # gateway root # modprobe -C /etc/modules.devfs /dev/sd1 && echo yes
+ # yes
+ # gateway root # modprobe -C /etc/modules.devfs foo && echo yes
+ # modprobe: Can't locate module foo
+ # gateway root #
+ epatch ${FILESDIR}/${P}-be-quiet-for-devfsd.patch
+}
+
+src_compile() {
+ local myconf=
+
+ filter-flags -fPIC
+
+ einfo "Building modutils..."
+ cd ${WORKDIR}/modutils-${MODUTILS_PV}
+
+ econf \
+ --disable-strip \
+ --prefix=/ \
+ --enable-insmod-static \
+ --disable-zlib \
+ ${myconf}
+
+ emake || die "emake modultils failed"
+
+ # Ok, now create the real insmod
+ mv -f insmod/insmod insmod/modprobe.conf
+ EPATCH_OPTS="-R" \
+ epatch ${FILESDIR}/modutils-${MODUTILS_PV}-no-above-below.patch
+
+ emake || die "emake modultils 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}"
+
+ # Install /sbin/modprobe.conf used by generate-modprobe.conf
+ exeinto /sbin
+ doexe insmod/modprobe.conf
+
+ 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
+ # This code was borrowed from the module-init-tools Makefile
+ for f in lsmod modprobe rmmod depmod insmod; do
+ if [ -L ${D}/sbin/${f} ]; then
+ ln -sf `ls -l ${D}/sbin/${f} | \
+ sed 's/.* -> //'`.old ${D}/sbin/${f};
+ fi;
+ mv ${D}/sbin/${f} ${D}/sbin/${f}.old;
+ done
+# make prefix=${D} move-old-targets || die "Renaming old bins to *.old failed"
+
+ einstall prefix=${D}
+
+ # 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
+
+# This we should rather do in pkg_postinst(), else we confuse modules-update ...
+# if [ -f /etc/modules.conf ]; then
+# einfo "Generating /etc/modprobe.conf ..."
+# PATH="${D}/sbin:${PATH}" \
+# ${S}/generate-modprobe.conf ${D}/etc/modprobe.conf \
+# || die "Could not create modprobe.conf"
+# fi
+ 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
+
+ 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
+ # Notify user of evilness, hope for a better way ;-)
+ echo ""
+ einfo "This overwrites the modutils files, so if you remove this,"
+ einfo "remember to remerge modutils. However, this package has"
+ einfo "installed a copy of the modutils files with suffix .old"
+ einfo "in your /sbin directory, which will automatically be used"
+ einfo "when needed."
+ echo ""
+}
+
+
+
+pkg_postrm() {
+ if [ "$(best_version ${PN})" == "${CATEGORY}/${PF}" -a ! -f /sbin/insmod ]; then
+ ewarn "Uninstalling module-init-tools has left you"
+ ewarn "without a modutils installtion. we recommend"
+ ewarn "emerging modutils immediately or remerging"
+ ewarn "module-init-tools."
+ fi
+}
+