diff options
author | Marcelo Góes <vanquirius@gentoo.org> | 2008-05-20 02:24:04 +0000 |
---|---|---|
committer | Marcelo Góes <vanquirius@gentoo.org> | 2008-05-20 02:24:04 +0000 |
commit | bf6e21b2e11fdf6542bc69a4878f4b6c54818bd2 (patch) | |
tree | 8707e7e6c6e3359af3213106a76d9c221ae70c03 /app-cdr/cdemud/files | |
parent | Add vhba for bug 198672 - userspace cdemu. Thanks to Daniel Lin <ephemient at... (diff) | |
download | gentoo-2-bf6e21b2e11fdf6542bc69a4878f4b6c54818bd2.tar.gz gentoo-2-bf6e21b2e11fdf6542bc69a4878f4b6c54818bd2.tar.bz2 gentoo-2-bf6e21b2e11fdf6542bc69a4878f4b6c54818bd2.zip |
Add cdemud for bug 198672 - userspace cdemu. Thanks to Daniel Lin <ephemient at gmail
dot com>, Daniel Fullmer <cgibreak at gmail dot com>, Sebastian Stammler <stammler at
stud.tu-darmstadt.de>, Rafal Muzylo <galtgendo at o2 dot pl>, Jan Bessai <Jan.Bessai
at gmx dot de>, Pham Ngoc Hai <pngochai at yahoo dot com>, Petr Sykora <petr.sykora
at gmail dot com>, Dirk Best <fatplumber at gmx dot de>, Marcel Schmedes <sm at
kleinreich dot de>, Vladi <vladimir.elisseev at gmail dot com>, Ambroz BIzjak <ambro
at b4ever dot net> and anyone I missed.
(Portage version: 2.1.4.4)
Diffstat (limited to 'app-cdr/cdemud/files')
-rw-r--r-- | app-cdr/cdemud/files/cdemud.conf.d | 10 | ||||
-rw-r--r-- | app-cdr/cdemud/files/cdemud.init.d | 38 |
2 files changed, 48 insertions, 0 deletions
diff --git a/app-cdr/cdemud/files/cdemud.conf.d b/app-cdr/cdemud/files/cdemud.conf.d new file mode 100644 index 000000000000..063afbeb6978 --- /dev/null +++ b/app-cdr/cdemud/files/cdemud.conf.d @@ -0,0 +1,10 @@ +# Config file for /etc/init.d/cdemu-daemon + +CDEMUD_DEVICES=1 +#ifndef ALSA +CDEMUD_BACKEND=null +#else +CDEMUD_BACKEND=ALSA +CDEMUD_AUDIODEV=default +#endif + diff --git a/app-cdr/cdemud/files/cdemud.init.d b/app-cdr/cdemud/files/cdemud.init.d new file mode 100644 index 000000000000..7c06c9866549 --- /dev/null +++ b/app-cdr/cdemud/files/cdemud.init.d @@ -0,0 +1,38 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-cdr/cdemud/files/cdemud.init.d,v 1.1 2008/05/20 02:24:04 vanquirius Exp $ + +depend() { + need dbus +#ifdef ALSA + [ "${CDEMUD_BACKEND}" == ALSA ] && need alsasound +#endif +} + +start() { + ebegin "Loading CDemu userspace daemon" + if ! grep -qw vhba /proc/modules; then + /sbin/modprobe vhba || eerror $? "Error loading vhba module" + fi + i=0; until [ -c /dev/vhba_ctl ]; do ((i++<=10)) || break; sleep 1; done +#ifndef ALSA + CDEMUD_ARGS="-a null" +#else + if [ "${CDEMUD_BACKEND}" == ALSA ]; then + CDEMUD_ARGS="-a ${CDEMUD_BACKEND} -o ${CDEMUD_AUDIODEV:-default}" + else + CDEMUD_ARGS="-a null" + fi +#endif + CDEMUD_ARGS="-s -d -c /dev/vhba_ctl -n ${CDEMUD_DEVICES:-1} ${CDEMUD_ARGS}" + start-stop-daemon --quiet --start --exec /usr/bin/cdemud -- ${CDEMUD_ARGS} + eend $? +} + +stop() { + ebegin "Stopping CDemu userspace daemon" + /usr/bin/cdemud -k; status=$? + /sbin/rmmod vhba || eerror $? "Error unloading vhba module" + eend "${status}" +} |