diff options
author | Stefan Knoblich <stkn@gentoo.org> | 2005-02-14 20:23:45 +0000 |
---|---|---|
committer | Stefan Knoblich <stkn@gentoo.org> | 2005-02-14 20:23:45 +0000 |
commit | 7820cbbbc2335b771a4edeb70d0bfcb351986c8f (patch) | |
tree | b177f4e6afaf894a6654c566639f4ac089177d1f /net-misc/zaptel | |
parent | sparc64 crosscompile hack. Tell users to re-emerge glibc if this is their fi... (diff) | |
download | historical-7820cbbbc2335b771a4edeb70d0bfcb351986c8f.tar.gz historical-7820cbbbc2335b771a4edeb70d0bfcb351986c8f.tar.bz2 historical-7820cbbbc2335b771a4edeb70d0bfcb351986c8f.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
Package-Manager: portage-2.0.51-r15
Diffstat (limited to 'net-misc/zaptel')
-rw-r--r-- | net-misc/zaptel/ChangeLog | 8 | ||||
-rw-r--r-- | net-misc/zaptel/Manifest | 9 | ||||
-rw-r--r-- | net-misc/zaptel/files/zaptel-1.0.4-experimental-devfs26.diff | 220 | ||||
-rw-r--r-- | net-misc/zaptel/zaptel-1.0.4.ebuild | 48 |
4 files changed, 263 insertions, 22 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/Manifest b/net-misc/zaptel/Manifest index 3bf2f7a31427..346af624a685 100644 --- a/net-misc/zaptel/Manifest +++ b/net-misc/zaptel/Manifest @@ -1,20 +1,19 @@ -MD5 a6bf35a78c7bd4309f9a0c3706729ef5 ChangeLog 5026 +MD5 192f812c33e375b45183281e122a69d4 ChangeLog 5372 MD5 44cf247f04cc83413fcb40ed59d0847a metadata.xml 248 MD5 8d66c378ea6b3b3f7bb2ee1fd2b6e51c zaptel-0.9.1.ebuild 3526 MD5 57a33550baf4bda34695fa3cb84a8012 zaptel-1.0.0.ebuild 3059 MD5 cfce09091affa8e8668e7a22801ac097 zaptel-1.0.1.ebuild 3186 MD5 eaa764a27a800be752aba85a7df8d342 zaptel-1.0.2.ebuild 3127 MD5 7245a92de844119cd4351807007616f0 zaptel-1.0.3.ebuild 3532 -MD5 63f6fb9ff3bd0ae81d46ef5644bd7f4b zaptel-1.0.4.ebuild 4132 -MD5 c80f1e0e4038771d3e3bc08284ecf917 files/zaptel-0.9.1-modulesd.diff 1941 +MD5 89874e5cbdf7262fe23db47cdb5a538e zaptel-1.0.4.ebuild 4473 MD5 3921a7fd4a60c8785d510e857ff2eabe files/digest-zaptel-0.9.1 64 MD5 9cf4f1d646d216441b7f4508ac7c0e8b files/digest-zaptel-1.0.0 64 MD5 dbd81e086a8331bea5752bf92e288f43 files/digest-zaptel-1.0.1 64 MD5 c05b7e3e46911ab74b865d91e7b85d42 files/digest-zaptel-1.0.2 64 MD5 66c86744220e6716f15393caf0ee408d files/digest-zaptel-1.0.3 64 MD5 051e2ff3f1222e2b551a70e9cd1b31f0 files/digest-zaptel-1.0.4 64 -MD5 fae1145da422b8838c2a6ac3405dc4c4 files/zaptel.confd 371 MD5 1dcd4bcf154cf1140d716eeeb8892ef3 files/zaptel-0.9.1-experimental-devfs26.diff 6432 +MD5 c80f1e0e4038771d3e3bc08284ecf917 files/zaptel-0.9.1-modulesd.diff 1941 MD5 60910db3ceada75031a91d419832871d files/zaptel-1.0.0-experimental-devfs26.diff 5474 MD5 c80f1e0e4038771d3e3bc08284ecf917 files/zaptel-1.0.0-modulesd.diff 1941 MD5 648b9f0335741cf4aea7542ffe4705c6 files/zaptel-1.0.1-modulesd.diff 1837 @@ -23,5 +22,7 @@ MD5 9abebf47ce7e7122a184a62e5baed146 files/zaptel-1.0.3-gcc34.patch 1540 MD5 e5a799243335f31a494bb4f90edbb9e4 files/zaptel-1.0.3-gentoo.diff 3456 MD5 fea918445512e51f2019ff20d78a7926 files/zaptel-install_prefix-typo.patch 486 MD5 e6a38926132312059bd3a8a712d8d88e files/zaptel-mkdir-usrincludelinux.patch 469 +MD5 fae1145da422b8838c2a6ac3405dc4c4 files/zaptel.confd 371 MD5 f8cae0c00456dbf7b7ece1959dbbd779 files/zaptel.rc6 903 MD5 090668aabb8e77cfd0d83835f52bd105 files/zaptel-1.0.4-gcc34.patch 821 +MD5 d40a84eeea5866a3afbac2603e970e7b files/zaptel-1.0.4-experimental-devfs26.diff 5982 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 } |