diff options
author | Daniel Black <dragonheart@gentoo.org> | 2004-08-13 12:59:34 +0000 |
---|---|---|
committer | Daniel Black <dragonheart@gentoo.org> | 2004-08-13 12:59:34 +0000 |
commit | b61c48f9156cfb4976ddc2a3e4270f041deb86ba (patch) | |
tree | 387568218d48a372b6ee67ce62e144adf55189e9 /net-dialup/slmodem | |
parent | Actually install the man pages not the output of docbook2man (Manifest recommit) (diff) | |
download | gentoo-2-b61c48f9156cfb4976ddc2a3e4270f041deb86ba.tar.gz gentoo-2-b61c48f9156cfb4976ddc2a3e4270f041deb86ba.tar.bz2 gentoo-2-b61c48f9156cfb4976ddc2a3e4270f041deb86ba.zip |
improves init scripts and provides fixes listed in bug #59244
Diffstat (limited to 'net-dialup/slmodem')
-rw-r--r-- | net-dialup/slmodem/ChangeLog | 11 | ||||
-rw-r--r-- | net-dialup/slmodem/files/digest-slmodem-2.9.9-r2 (renamed from net-dialup/slmodem/files/digest-slmodem-2.9.9) | 0 | ||||
-rw-r--r-- | net-dialup/slmodem/files/slmodem-2.9.conf | 5 | ||||
-rw-r--r-- | net-dialup/slmodem/files/slmodem-2.9.init | 37 | ||||
-rw-r--r-- | net-dialup/slmodem/slmodem-2.9.9-r2.ebuild (renamed from net-dialup/slmodem/slmodem-2.9.9.ebuild) | 39 |
5 files changed, 62 insertions, 30 deletions
diff --git a/net-dialup/slmodem/ChangeLog b/net-dialup/slmodem/ChangeLog index ad21cd0e474d..92ed4d24882a 100644 --- a/net-dialup/slmodem/ChangeLog +++ b/net-dialup/slmodem/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for net-dialup/slmodem # Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/ChangeLog,v 1.19 2004/08/02 03:21:13 dragonheart Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/ChangeLog,v 1.20 2004/08/13 12:59:34 dragonheart Exp $ + +*slmodem-2.9.9-r2 (13 Aug 2004) + + 13 Aug 2004; Daniel Black <dragonheart@gentoo.org> files/slmodem-2.9.conf, + files/slmodem-2.9.init, +slmodem-2.9.9-r2.ebuild, -slmodem-2.9.9.ebuild: + revision bump - improves init scripts and provides fixes listed in bug #59244. + Many thank to Stefan Schweizer <sschweizer@gmail.com> who summitted the init + script and fixes. Thanks also to Christian Roessner <info@roessner-net.com> + for sumbitting the bug 02 Aug 2004; Daniel Black <dragonheart@gentoo.org> metadata.xml: metadata updated. Dual maintence with spyderous diff --git a/net-dialup/slmodem/files/digest-slmodem-2.9.9 b/net-dialup/slmodem/files/digest-slmodem-2.9.9-r2 index 099d04f8b31f..099d04f8b31f 100644 --- a/net-dialup/slmodem/files/digest-slmodem-2.9.9 +++ b/net-dialup/slmodem/files/digest-slmodem-2.9.9-r2 diff --git a/net-dialup/slmodem/files/slmodem-2.9.conf b/net-dialup/slmodem/files/slmodem-2.9.conf index 745ab4ef0e16..221a47f1bb9b 100644 --- a/net-dialup/slmodem/files/slmodem-2.9.conf +++ b/net-dialup/slmodem/files/slmodem-2.9.conf @@ -25,11 +25,6 @@ NICE=-6 # PCICONF MODULE=slamr # or # USBCONF MODULE=slusb -# -# Non ALSA- use one of the following: -# PCICONF MDEV=/dev/slamr0 -# or -# USBCONF MDEV=/dev/slusb0 # this file must be kept in sync with: # /etc/devfs.d/slmodem (devfs) diff --git a/net-dialup/slmodem/files/slmodem-2.9.init b/net-dialup/slmodem/files/slmodem-2.9.init index cf73c450bbc3..e801ac9f94e5 100644 --- a/net-dialup/slmodem/files/slmodem-2.9.init +++ b/net-dialup/slmodem/files/slmodem-2.9.init @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/files/slmodem-2.9.init,v 1.8 2004/08/02 02:51:09 dragonheart Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/files/slmodem-2.9.init,v 1.9 2004/08/13 12:59:34 dragonheart Exp $ depend() { need logger @@ -33,27 +33,31 @@ function loadsmodule { if [ "$?" -gt 0 ] then eerror "Missing ${MODULE}. Please set up /etc/conf.d/slmodem" - eend 1; + return 1; fi + if [ -z "${MDEV}" ]; then MDEV="/dev/${MODULE}0"; fi + #sleep as per http://bugs.gentoo.org/show_bug.cgi?id=47947#c59 ebegin "Waiting for ${MODULE} modem driver initialisation" local COUNT=0 - echo -e "${NORMAL} " - echo -ne "${NORMAL}" + if [ "$RC_NOCOLOR" != "yes" ]; then + echo -e "\e[A\e[49G " + echo -ne "\e[A\e[49G" + fi while [ ! -c ${MDEV} -a ${COUNT} -lt 5 ]; do sleep 0.5 - echo -ne "." + echo -n "." COUNT=`expr ${COUNT} + 1` done - - echo -ne "\n" - + + if [ "$RC_NOCOLOR" != "yes" ]; then echo; fi + if [ ! -c ${MDEV} ]; then eerror "Module - ${MODULE} failed to initialise device ${MDEV}" - eend 1 + return 1 else eend 0 fi @@ -88,20 +92,23 @@ start() { stop() { ebegin "Shutting down slmodemd" start-stop-daemon --stop --quiet --pidfile /var/run/slmodemd.pid && rm /var/run/slmodemd.pid - eend ${?} + result=${?} + unlink ${LN_DEV} 2> /dev/null + eend ${result} if [ ! "${MODULE}" == "alsa" ]; then ebegin "Waiting for ${MODULE} modem driver unload" - echo -e "${NORMAL} " - echo -ne "${NORMAL}" + if [ "$RC_NOCOLOR" != "yes" ]; then + echo -e "\e[A\e[43G " + echo -ne "\e[A\e[43G" + fi for ((a=0,result=1; result==1 && a <= 5 ; a++)) do sleep 0.25 - echo -ne "." + echo -n "." modprobe -r slamr 2> /dev/null && result=0 done - echo -ne "\n" + if [ "$RC_NOCOLOR" != "yes" ]; then echo; fi eend ${result} fi - unlink ${LN_DEV} 2> /dev/null } diff --git a/net-dialup/slmodem/slmodem-2.9.9.ebuild b/net-dialup/slmodem/slmodem-2.9.9-r2.ebuild index ed01e8a6ccc3..95a2c1f1593e 100644 --- a/net-dialup/slmodem/slmodem-2.9.9.ebuild +++ b/net-dialup/slmodem/slmodem-2.9.9-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/slmodem-2.9.9.ebuild,v 1.3 2004/08/01 09:40:12 spyderous Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dialup/slmodem/slmodem-2.9.9-r2.ebuild,v 1.1 2004/08/13 12:59:34 dragonheart Exp $ inherit kmod eutils @@ -20,6 +20,11 @@ RDEPEND="virtual/libc alsa? ( media-libs/alsa-lib )" src_unpack() { + + ewarn "This ebuild is sensive to use flags (usb, alsa)." + ewarn "Please select approprately based on your hardware." + ewarn "use -usb if you have a PCI modem" + # Unpack and set some variables kmod_src_unpack @@ -72,9 +77,11 @@ src_install() { unset ARCH emake DESTDIR=${D} \ KERNEL_VER=${KV_VERSION_FULL} \ - install-drivers \ + install-drivers install-test\ || die "driver install failed" + mv ${D}/usr/sbin/modem_test ${D}/usr/sbin/slmodem_test + dosbin modem/slmodemd dodir /var/lib/slmodem fowners root:dialout /var/lib/slmodem @@ -87,16 +94,17 @@ src_install() { if use alsa then - sed -i -e "s/ALSA=.*/ALSA=yes/" -e "s:# DEV=/dev/ttySL0:DEV=/dev/ttySL0:" ${D}//etc/conf.d/slmodem + sed -i -e "s/# ALSACONF //g" ${D}/etc/conf.d/slmodem else - sed -i -e "s/ALSA=.*/ALSA=yes/" ${D}//etc/conf.d/slmodem + sed -i -e "s/# NONALSACONF //g" ${D}/etc/conf.d/slmodem if use usb then - sed -i -e "s:# DEV=/dev/slusb0:DEV=/dev/slusb0:" ${D}//etc/conf.d/slmodem + sed -i -e "s/# USBCONF //g" ${D}/etc/conf.d/slmodem else - sed -i -e "s:# DEV=/dev/slamr0:DEV=/dev/slamr0:" ${D}//etc/conf.d/slmodem + sed -i -e "s/# PCICONF //g" ${D}/etc/conf.d/slmodem fi fi + sed -i -e "s/ALSACONF//g" -e "s/PCICONF//g" -e "s/USBCONF//g" ${D}/etc/conf.d/slmodem # Make some devices if we aren't using devfs @@ -107,9 +115,11 @@ src_install() { insinto /etc/modules.d/; newins ${FILESDIR}/${PN}-2.9.modules ${PN} elif [ -e ${ROOT}/dev/.udev ] ; then # udev - # FIX Symlink + # check Symlink dodir /etc/udev/rules.d/ - echo 'KERNEL="slamr", NAME="slamr0", SYMLINK="modem"' > \ + echo 'KERNEL="slamr", NAME="slamr0" > \ + ${D}/etc/udev/rules.d/55-${PN}.rules + echo 'KERNEL="slusb", NAME="slusb0" >> \ ${D}/etc/udev/rules.d/55-${PN}.rules dodir /etc/udev/permissions.d echo 'slamr*:root:dialout:0660' > \ @@ -118,12 +128,21 @@ src_install() { make -C drivers DESTDIR=${D} KERNELRELEASE=1 KERNEL_VER=${KV_VERSION_FULL} install-devices fi + dodir /etc/hotplug + + #if [ -r ${ROOT}/etc/hotplug/blacklist ] + #then + # cp ${ROOT}/etc/hotplug/blacklist ${D}/etc/hotplug/ + #fi + + dodir /etc/hotplug/blacklist.d + echo -e "slusb\nslamr" >> ${D}/etc/hotplug/blacklist.d/55-${PN} } pkg_postinst() { kmod_pkg_postinst - #depmod -a + depmod -a # Make some devices if we aren't using devfs # If we are using devfs, restart it @@ -145,6 +164,8 @@ pkg_postinst() { einfo "You must edit /etc/conf.d/${PN} for your configuration" + ewarn "To avoid problems add slusb/slamr to /etc/hotplug/blacklist" + einfo "To add slmodem to your startup - type : rc-update add slmodem default" if use alsa; |