summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Knoblich <stkn@gentoo.org>2005-02-14 20:23:45 +0000
committerStefan Knoblich <stkn@gentoo.org>2005-02-14 20:23:45 +0000
commit3263821c2da5eee485d53926221006c901e9041e (patch)
treec94fb4459ffcb778878369252608f1a8ef75cb17 /net-misc
parentsparc64 crosscompile hack. Tell users to re-emerge glibc if this is their fi... (diff)
downloadgentoo-2-3263821c2da5eee485d53926221006c901e9041e.tar.gz
gentoo-2-3263821c2da5eee485d53926221006c901e9041e.tar.bz2
gentoo-2-3263821c2da5eee485d53926221006c901e9041e.zip
Updated devfs26 patch (fixes 81834, see Changelog for details), ebuild sleeps once at the end of pkg_setup (and not after every message), devf26 use flag disabled udev support in zaptel to avoid possible conflicts
(Portage version: 2.0.51-r15)
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/zaptel/ChangeLog8
-rw-r--r--net-misc/zaptel/files/zaptel-1.0.4-experimental-devfs26.diff220
-rw-r--r--net-misc/zaptel/zaptel-1.0.4.ebuild48
3 files changed, 258 insertions, 18 deletions
diff --git a/net-misc/zaptel/ChangeLog b/net-misc/zaptel/ChangeLog
index 5c302290c034..a02db2c4eb68 100644
--- a/net-misc/zaptel/ChangeLog
+++ b/net-misc/zaptel/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-misc/zaptel
# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.30 2005/02/07 20:03:02 blubb Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.31 2005/02/14 20:23:45 stkn Exp $
+
+ 14 Feb 2005; Stefan Knoblich <stkn@gentoo.org>
+ +files/zaptel-1.0.4-experimental-devfs26.diff, zaptel-1.0.4.ebuild:
+ Updated devfs26 patch (fixes devfs_mk_symlink errors and fixes devices node if
+ >1 card/interface), devfs26 disables zaptel's udev support to avoid conflicts.
+ Made the ebuild sleep once in pkg_setup(), not multiple times.
07 Feb 2005; Simon Stelling <blubb@gentoo.org> zaptel-1.0.4.ebuild:
added ~amd64
diff --git a/net-misc/zaptel/files/zaptel-1.0.4-experimental-devfs26.diff b/net-misc/zaptel/files/zaptel-1.0.4-experimental-devfs26.diff
new file mode 100644
index 000000000000..e33002e57a2a
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel-1.0.4-experimental-devfs26.diff
@@ -0,0 +1,220 @@
+--- zaptel/zaptel.c.orig 2005-01-03 23:31:28.266487240 +0100
++++ zaptel/zaptel.c 2005-01-03 23:20:16.149664528 +0100
+@@ -143,12 +143,14 @@
+
+ /* Here are a couple important little additions for devfs */
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ static devfs_handle_t zaptel_devfs_dir;
+ static devfs_handle_t channel;
+ static devfs_handle_t pseudo;
+ static devfs_handle_t ctl;
+ static devfs_handle_t timer;
+ #endif
++#endif
+
+ /* udev necessary data structures. Yeah! */
+ #ifdef CONFIG_ZAP_UDEV
+@@ -1087,6 +1089,7 @@
+ }
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ static devfs_handle_t register_devfs_channel(struct zt_chan *chan, devfs_handle_t dir)
+ {
+ char path[100];
+@@ -1129,6 +1132,36 @@
+
+ return chan_dev;
+ }
++#else
++static dev_t register_devfs_channel(struct zt_chan *chan, dev_t dir)
++{
++#ifdef HAS_DEVFS_MK_SYMLINK
++ char link[100];
++ char path[100];
++#endif
++ dev_t chan_dev;
++ umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
++
++ /* create /dev/zap/span%d/%d channel device node */
++ if ((chan_dev = devfs_mk_cdev(MKDEV(ZT_MAJOR, chan->channo), mode, "zap/span%d/%d", dir, chan->chanpos)) < 0) {
++ printk("zaptel: Something really bad happened. Unable to register devfs entry\n");
++ return 0;
++ }
++
++#ifdef HAS_DEVFS_MK_SYMLINK
++ /* link /dev/zap/span%d/%d -> /dev/zap/%d ?!? */
++ sprintf(path, "zap/span%d/%d", dir, chan->chanpos);
++ sprintf(link, "zap/%d", chan->channo);
++ devfs_mk_symlink(link, path);
++#else
++ /* register /dev/zap/%d channel node directly */
++ if(devfs_mk_cdev(MKDEV(ZT_MAJOR, chan->channo), mode, "zap/%d", chan->channo) < 0) {
++ printk("zaptel: Unable to register compat devfs entry\n");
++ }
++#endif
++ return chan_dev;
++}
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+
+ static int zt_chan_reg(struct zt_chan *chan)
+@@ -4304,6 +4337,7 @@
+ #endif
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ {
+ char span_name[50];
+ sprintf(span_name, "span%d", span->spanno);
+@@ -4313,6 +4347,15 @@
+ chan->fhandle = register_devfs_channel(chan, chan->span->dhandle); /* Register our stuff with devfs */
+ }
+ }
++#else
++ {
++ devfs_mk_dir("zap/span%d", span->spanno);
++ for (x = 0; x < span->channels; x++) {
++ struct zt_chan *chan = &span->chans[x];
++ register_devfs_channel(chan, span->spanno); /* Register our stuff with devfs */
++ }
++ }
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+
+ #ifdef CONFIG_ZAP_UDEV
+@@ -4360,11 +4403,22 @@
+ remove_proc_entry(tempfile, NULL);
+ #endif /* CONFIG_PROC_FS */
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ for (x = 0; x < span->channels; x++) {
+ devfs_unregister(span->chans[x].fhandle);
+ devfs_unregister(span->chans[x].fhandle_symlink);
+ }
+ devfs_unregister(span->dhandle);
++#else
++ for (x = 0; x < span->channels; x++) {
++ /* remove symlink/compat device first */
++ devfs_remove("zap/%d", span->chans[x].channo);
++ /* remove channel device */
++ devfs_remove("zap/span%d/%d", span->spanno, span->chans[x].chanpos);
++ }
++ /* remove span dir */
++ devfs_remove("zap/span%d", span->spanno);
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+
+ #ifdef CONFIG_ZAP_UDEV
+@@ -6301,6 +6355,7 @@
+ #endif /* CONFIG_ZAP_UDEV */
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ {
+ umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
+ devfs_register_chrdev(ZT_MAJOR, "zaptel", &zt_fops);
+@@ -6312,6 +6367,22 @@
+ ctl = devfs_register(zaptel_devfs_dir, "ctl", DEVFS_FL_DEFAULT, ZT_MAJOR, 0, mode, &zt_fops, NULL);
+ }
+ #else
++ {
++ umode_t mode = S_IFCHR|S_IRUGO|S_IWUGO;
++ if ((res = register_chrdev(ZT_MAJOR, "zaptel", &zt_fops)) < 0) {
++ printk(KERN_ERR "Unable to register for device on %d, error: %d\n", ZT_MAJOR, res);
++ return res;
++ }
++
++ devfs_mk_dir("zap");
++
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 253), mode, "zap/timer");
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 254), mode, "zap/channel");
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 255), mode, "zap/pseudo");
++ devfs_mk_cdev(MKDEV(ZT_MAJOR, 0), mode, "zap/ctl");
++ }
++#endif
++#else
+ if ((res = register_chrdev(ZT_MAJOR, "zaptel", &zt_fops))) {
+ printk(KERN_ERR "Unable to register tor device on %d\n", ZT_MAJOR);
+ return res;
+@@ -6342,6 +6413,7 @@
+ if (tone_zones[x])
+ kfree(tone_zones[x]);
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ devfs_unregister(timer);
+ devfs_unregister(channel);
+ devfs_unregister(pseudo);
+@@ -6357,6 +6429,16 @@
+ class_simple_destroy(zap_class);
+ #endif /* CONFIG_ZAP_UDEV */
+ unregister_chrdev(ZT_MAJOR, "zaptel");
++
++ devfs_remove("zap/timer");
++ devfs_remove("zap/ctl");
++ devfs_remove("zap/pseudo");
++ devfs_remove("zap/channel");
++
++ devfs_remove("zap");
++#endif
++#else
++ unregister_chrdev(ZT_MAJOR, "zaptel");
+ #endif
+ #ifdef CONFIG_ZAPTEL_WATCHDOG
+ watchdog_cleanup();
+--- zaptel/zaptel.h.orig 2005-01-03 23:31:32.029915112 +0100
++++ zaptel/zaptel.h 2005-01-03 23:20:18.380325416 +0100
+@@ -46,18 +46,17 @@
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ #define LINUX26
++/* devfs_mk_symlink has been removed in 2.6.10 */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
++#define HAS_DEVFS_MK_SYMLINK
++#endif
+ #endif
+
+ #include "ecdis.h"
+ #include "fasthdlc.h"
+ #endif
+ #ifdef CONFIG_DEVFS_FS
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+ #include <linux/devfs_fs_kernel.h>
+-#else
+-#undef CONFIG_DEVFS_FS
+-//#warning "Zaptel doesn't support DEVFS in post 2.4 kernels. Disabling DEVFS in zaptel"
+-#endif
+ #endif /* CONFIG_DEVFS_FS */
+ #include <linux/ioctl.h>
+
+@@ -65,6 +64,8 @@
+ #define ELAST 500
+ #endif
+
++
++
+ /* Per-span configuration values */
+ #define ZT_CONFIG_TXLEVEL 7 /* bits 0-2 are tx level */
+
+@@ -1123,8 +1124,10 @@
+ #endif
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ devfs_handle_t fhandle; /* File handle in devfs for the channel */
+ devfs_handle_t fhandle_symlink;
++#endif
+ #endif /* CONFIG_DEVFS_FS */
+ };
+
+@@ -1254,7 +1257,9 @@
+ int lastalarms; /* Previous alarms */
+
+ #ifdef CONFIG_DEVFS_FS
++#ifndef LINUX26
+ devfs_handle_t dhandle; /* Directory name */
++#endif
+ #endif
+ /* If the watchdog detects no received data, it will call the
+ watchdog routine */
diff --git a/net-misc/zaptel/zaptel-1.0.4.ebuild b/net-misc/zaptel/zaptel-1.0.4.ebuild
index 004a54d9ebfb..c303eccc3201 100644
--- a/net-misc/zaptel/zaptel-1.0.4.ebuild
+++ b/net-misc/zaptel/zaptel-1.0.4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.0.4.ebuild,v 1.4 2005/02/07 20:03:02 blubb Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.0.4.ebuild,v 1.5 2005/02/14 20:23:45 stkn Exp $
IUSE="devfs26"
@@ -19,6 +19,7 @@ DEPEND="virtual/libc
>=dev-libs/newt-0.50.0"
pkg_setup() {
+ local pause_sec=0
linux-info_pkg_setup
if ! linux_chkconfig_present PPP ; then
@@ -34,8 +35,7 @@ pkg_setup() {
einfo "CONFIG_PPP, CONFIG_PPP_ASYNC, CONFIG_PPP_DEFLATE"
einfo "and CONFIG_PPPOE."
einfo ""
- einfo "Sleeping 20 Seconds..."
- epause 20
+ pause_sec=10
fi
# show an nice warning message about zaptel not supporting devfs on 2.6
@@ -51,14 +51,20 @@ pkg_setup() {
einfo " 1. It's an ugly hack atm and needs a cleanup..."
einfo " 2. I was only abled to test loding / unloading with the ztd-eth driver..."
einfo " 3. I _really_ don't know if it works with real hardware..."
- eerror " 4. And more important: This is not officially supported by Digium / the Asterisk project!!!"
+ einfo " 4. It disables udev support to avoid conflicts"
+ eerror " 5. And more important: This is not officially supported by Digium / the Asterisk project!"
einfo ""
einfo "If you're still interested, abort now (ctrl+c) and enable the devfs26 USE-flag"
einfo "Feedback and bug-reports should go to: stkn@gentoo.org"
einfo "You have been warned!"
echo
- einfo "Sleeping 20 Seconds..."
- epause 20
+ pause_sec=$(($pause_sec + 20))
+ fi
+
+ # wait once, not multiple times
+ if [[ $pause_sec -gt 0 ]]; then
+ einfo "Sleeping $pause_sec seconds"
+ epause $pause_sec
fi
}
@@ -78,7 +84,11 @@ src_unpack() {
# devfs support
if use devfs26; then
einfo "Enabling experimental devfs support for linux-2.6..."
- epatch ${FILESDIR}/${PN}-1.0.0-experimental-devfs26.diff
+ epatch ${FILESDIR}/${PN}-1.0.4-experimental-devfs26.diff
+
+ # disable udev
+ sed -i -e "s:#define[\t ]\+\(CONFIG_ZAP_UDEV\):#undef \1:" \
+ zconfig.h
fi
# apply patch for gcc-3.4.x if that's the compiler in use...
@@ -97,8 +107,8 @@ src_compile() {
src_install() {
make INSTALL_PREFIX=${D} install || die
- dodoc ChangeLog README README.udev README.Linux26 README.fxsusb zaptel.init zaptel.sysconfig
- dodoc zaptel.conf.sample LICENSE
+ dodoc ChangeLog README README.udev README.Linux26 README.fxsusb zaptel.init
+ dodoc zaptel.conf.sample LICENSE zaptel.sysconfig
# additional tools
dobin ztmonitor ztspeed zttest
@@ -122,13 +132,17 @@ pkg_postinst() {
echo
einfo "Use the /etc/init.d/zaptel script to load zaptel.conf settings on startup!"
echo
+
+ # devfs26 disables udev ... so don't nag users
+ if ! use devfs26; then
# FIXME!! Can we (we should) do this automatically
- einfo "If you're using udev add the following to"
- einfo "/etc/udev/rules.d/50-udev.rules (as in README.udev):"
- einfo "# Section for zaptel device"
- einfo "KERNEL=\"zapctl\", NAME=\"zap/ctl\""
- einfo "KERNEL=\"zaptimer\", NAME=\"zap/timer\""
- einfo "KERNEL=\"zapchannel\", NAME=\"zap/channel\""
- einfo "KERNEL=\"zappseudo\", NAME=\"zap/pseudo\""
- einfo "KERNEL=\"zap[0-9]*\", NAME=\"zap/%n\""
+ einfo "If you're using udev add the following to"
+ einfo "/etc/udev/rules.d/50-udev.rules (as in README.udev):"
+ einfo "# Section for zaptel device"
+ einfo "KERNEL=\"zapctl\", NAME=\"zap/ctl\""
+ einfo "KERNEL=\"zaptimer\", NAME=\"zap/timer\""
+ einfo "KERNEL=\"zapchannel\", NAME=\"zap/channel\""
+ einfo "KERNEL=\"zappseudo\", NAME=\"zap/pseudo\""
+ einfo "KERNEL=\"zap[0-9]*\", NAME=\"zap/%n\""
+ fi
}