diff options
author | root <root@rshg054.dnsready.net> | 2012-03-27 00:01:20 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-03-27 00:01:20 +0000 |
commit | c8729cab8302ab82e01135a22fb9fa9704f1559b (patch) | |
tree | f272d52815dcaf543aaf60177bdfc7d28e22e201 /community-testing | |
parent | cf507a0dbf5ee8258e49256049b420ac8e191387 (diff) |
Tue Mar 27 00:01:20 UTC 2012
Diffstat (limited to 'community-testing')
-rw-r--r-- | community-testing/cdemu-daemon/PKGBUILD | 32 | ||||
-rw-r--r-- | community-testing/cdemu-daemon/cdemu-daemon.install | 20 | ||||
-rw-r--r-- | community-testing/cdemu-daemon/cdemud.conf | 11 | ||||
-rw-r--r-- | community-testing/cdemu-daemon/cdemud.rc | 8 | ||||
-rw-r--r-- | community-testing/cdemu-daemon/system.patch | 45 | ||||
-rw-r--r-- | community-testing/vhba-module/60-vhba.rules | 1 | ||||
-rw-r--r-- | community-testing/vhba-module/PKGBUILD | 42 | ||||
-rw-r--r-- | community-testing/vhba-module/vhba-kernel2.6.37.patch | 56 | ||||
-rw-r--r-- | community-testing/vhba-module/vhba-module.install | 22 |
9 files changed, 209 insertions, 28 deletions
diff --git a/community-testing/cdemu-daemon/PKGBUILD b/community-testing/cdemu-daemon/PKGBUILD index b757373de..87eb6bd8e 100644 --- a/community-testing/cdemu-daemon/PKGBUILD +++ b/community-testing/cdemu-daemon/PKGBUILD @@ -1,36 +1,35 @@ -# $Id: PKGBUILD 68321 2012-03-21 15:58:26Z schiv $ +# $Id: PKGBUILD 68476 2012-03-25 14:38:03Z schiv $ # Maintainer: Ray Rashif <schiv@archlinux.org> # Contributor: Mateusz Herych <heniekk@gmail.com> # Contributor: Charles Lindsay <charles@chaoslizard.org> pkgname=cdemu-daemon pkgver=1.5.0 -pkgrel=3 +pkgrel=4 pkgdesc="CD/DVD-ROM device emulator daemon" arch=('i686' 'x86_64') url="http://cdemu.sourceforge.net/" license=('GPL') -depends=('dbus-glib' 'libdaemon' 'vhba-module' - 'dbus' "libmirage=$pkgver" 'libao') -optdepends=('alsa-lib: to enable the audio driver') +depends=('dbus' 'vhba-module>=20110915-5' 'libao' "libmirage=$pkgver") +optdepends=('alsa-lib: to enable the ALSA audio driver' + 'pulseaudio: to enable the PA audio driver') backup=('etc/conf.d/cdemud' 'etc/dbus-1/system.d/cdemud-dbus.conf') -install=cdemud.install +install=$pkgname.install source=("http://downloads.sourceforge.net/cdemu/$pkgname-$pkgver.tar.bz2" 'cdemud.conf' 'cdemud.rc' - '60-vhba.rules' - 'cdemu-daemon-system.patch') + 'system.patch') md5sums=('5ba780caa26d855942512b5b3c22405a' - 'd65c30651389900c46e62a9e5559b9d5' - 'ef47f06a3d4e07885bfbb57d4d6d0be4' - '549bd2d9696bd1884c8eed7193c00e21' - 'a3ae9c51c460d31a521dd00dd3f0a852') + '5d9e08255e45ca3c0987329b7920e206' + '4bbf42b69133e4e91c1be2c6825fa392' + '90a2516639c05737fa10a110a1cba467') build() { cd "$srcdir/$pkgname-$pkgver" - patch -Np0 -i $srcdir/cdemu-daemon-system.patch + # make things Arch-friendly + patch -Np1 -i "$srcdir/system.patch" ./configure --prefix=/usr \ --sysconfdir=/etc \ @@ -43,14 +42,11 @@ package() { make DESTDIR="$pkgdir" install + # the init stuff install -Dm644 "$srcdir/cdemud.conf" "$pkgdir/etc/conf.d/cdemud" install -Dm755 "$srcdir/cdemud.rc" "$pkgdir/etc/rc.d/cdemud" - # install udev rule for non-root mounting of iso's - install -Dm644 "$srcdir/60-vhba.rules" \ - "$pkgdir/lib/udev/rules.d/60-vhba.rules" - - # should we really be doing this? + # should we really be doing this? (for systemd) #install -d "$pkgdir/usr/lib/modules-load.d" #echo "vhba" > "$pkgdir/usr/lib/modules-load.d/cdemu.conf" } diff --git a/community-testing/cdemu-daemon/cdemu-daemon.install b/community-testing/cdemu-daemon/cdemu-daemon.install new file mode 100644 index 000000000..7a3e8a9f5 --- /dev/null +++ b/community-testing/cdemu-daemon/cdemu-daemon.install @@ -0,0 +1,20 @@ +post_upgrade() { + echo " > The 'cdemu' group is now created by vhba-module" + echo " >> you may have to re-add yourself to the group and relogin" + echo + echo " > Daemon can be used in session mode as user, simply run 'cdemud'" + echo " >> you do not need to use the init script in this case" + echo " >> put your configuration in ~/.cdemud instead" +} + +post_install () { + echo " > Add yourself to the 'cdemu' group for non-root access" + echo " > Start the daemon as root with /etc/rc.d/cdemud" + echo " > See /etc/conf.d/cdemud for further configuration" + echo + echo " > Daemon can be used in session mode as user, simply run 'cdemud'" + echo " >> you do not need to use the init script in this case" + echo " >> put your configuration in ~/.cdemud instead" +} + +# vim:set ts=2 sw=2 et: diff --git a/community-testing/cdemu-daemon/cdemud.conf b/community-testing/cdemu-daemon/cdemud.conf index 4e0e314f4..6f14947a6 100644 --- a/community-testing/cdemu-daemon/cdemud.conf +++ b/community-testing/cdemu-daemon/cdemud.conf @@ -1,12 +1,11 @@ # how many optical drives to emulate NUM_DEVICES=2 -# control device -CTL_DEVICE=/dev/vhba_ctl - -# audio backend (null or alsa) +# audio backend (null, alsa or pulse) AUDIO_DRIVER=null -DAEMON="/usr/bin/cdemud" +# log file +LOG_FILE=/var/log/cdemud.log + +# bus to use (system or session) BUS="system" -LOG_FILE="/var/log/cdemu.log" diff --git a/community-testing/cdemu-daemon/cdemud.rc b/community-testing/cdemu-daemon/cdemud.rc index 21cae0a26..e8dab1f08 100644 --- a/community-testing/cdemu-daemon/cdemud.rc +++ b/community-testing/cdemu-daemon/cdemud.rc @@ -14,20 +14,20 @@ case "$1" in stat_done fi - stat_busy "Waiting for $CTL_DEVICE" + stat_busy "Waiting for /dev/vhba_ctl" i=0 - until [ -c $CTL_DEVICE -o $i -ge 10 ]; do + until [ -c /dev/vhba_ctl -o $i -ge 10 ]; do i=`expr $i + 1` sleep 1 done - if [ -c $CTL_DEVICE ]; then + if [ -c /dev/vhba_ctl ]; then stat_done else stat_fail fi stat_busy "Starting cdemud" - cdemud --ctl-device=$CTL_DEVICE --bus=$BUS --num-devices=$NUM_DEVICES --audio-driver=$AUDIO_DRIVER --logfile=$LOG_FILE & + cdemud --ctl-device=/dev/vhba_ctl --bus=$BUS --num-devices=$NUM_DEVICES --audio-driver=$AUDIO_DRIVER --logfile=$LOG_FILE & if [ $? -ne 0 ]; then stat_fail else diff --git a/community-testing/cdemu-daemon/system.patch b/community-testing/cdemu-daemon/system.patch new file mode 100644 index 000000000..3c3d4b221 --- /dev/null +++ b/community-testing/cdemu-daemon/system.patch @@ -0,0 +1,45 @@ +diff -aur cdemu-daemon-1.5.0.orig/session/cdemu-daemon-session.sh cdemu-daemon-1.5.0/session/cdemu-daemon-session.sh +--- cdemu-daemon-1.5.0.orig/session/cdemu-daemon-session.sh 2012-03-25 16:35:40.577837996 +0800 ++++ cdemu-daemon-1.5.0/session/cdemu-daemon-session.sh 2012-03-25 16:39:12.180024983 +0800 +@@ -1,15 +1,15 @@ + #!/bin/sh + # Starts the CDEmu daemon instance on D-Bus *session* bus. Optional + # configuration (number of devices, audio driver, log file) are read +-# from ~/.cdemu-daemon ++# from ~/.cdemud + + # Default settings + NUM_DEVICES=2 +-AUDIO_DRIVER=pulse +-LOG_FILE=~/.cdemu-daemon.log ++AUDIO_DRIVER=null ++LOG_FILE=~/.cdemud.log + + # Read the settings +-CONFIG_FILE=~/.cdemu-daemon ++CONFIG_FILE=~/.cdemud + + if [ -f ${CONFIG_FILE} ]; then + . ${CONFIG_FILE}; +diff -aur cdemu-daemon-1.5.0.orig/system/cdemu-daemon-system.sh cdemu-daemon-1.5.0/system/cdemu-daemon-system.sh +--- cdemu-daemon-1.5.0.orig/system/cdemu-daemon-system.sh 2012-03-25 16:35:40.581171312 +0800 ++++ cdemu-daemon-1.5.0/system/cdemu-daemon-system.sh 2012-03-25 16:36:48.810801678 +0800 +@@ -1,15 +1,15 @@ + #!/bin/sh + # Starts the CDEmu daemon instance on D-Bus *system* bus. Optional + # configuration (number of devices, audio driver, log file) are read +-# from /etc/sysconfig/cdemu-daemon ++# from /etc/conf.d/cdemud + + # Default settings + NUM_DEVICES=2 + AUDIO_DRIVER=null +-LOG_FILE=/tmp/cdemu-daemon.log ++LOG_FILE=/var/log/cdemud.log + + # Read the settings +-CONFIG_FILE=/etc/sysconfig/cdemu-daemon ++CONFIG_FILE=/etc/conf.d/cdemud + + if [ -f ${CONFIG_FILE} ]; then + . ${CONFIG_FILE}; diff --git a/community-testing/vhba-module/60-vhba.rules b/community-testing/vhba-module/60-vhba.rules new file mode 100644 index 000000000..91de6f86a --- /dev/null +++ b/community-testing/vhba-module/60-vhba.rules @@ -0,0 +1 @@ +KERNEL=="vhba_ctl", NAME="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu" diff --git a/community-testing/vhba-module/PKGBUILD b/community-testing/vhba-module/PKGBUILD new file mode 100644 index 000000000..906869971 --- /dev/null +++ b/community-testing/vhba-module/PKGBUILD @@ -0,0 +1,42 @@ +# $Id: PKGBUILD 68474 2012-03-25 11:30:35Z schiv $ +# Maintainer: Ray Rashif <schiv@archlinux.org> +# Contributor: Mateusz Herych <heniekk@gmail.com> +# Contributor: Charles Lindsay <charles@chaoslizard.org> + +pkgname=vhba-module +pkgver=20110915 +_extramodules=extramodules-3.2-ARCH +pkgrel=5 +pkgdesc="Kernel module that emulates SCSI devices" +arch=('i686' 'x86_64') +url="http://cdemu.sourceforge.net/" +license=('GPL') +depends=('linux>=3.2' 'linux<3.3') +makedepends=('linux-headers>=3.2') +install=$pkgname.install +source=("http://downloads.sourceforge.net/cdemu/$pkgname-$pkgver.tar.bz2" + '60-vhba.rules') +md5sums=('8bb99b427ca67bad448f4dd211bdd1a2' + '549bd2d9696bd1884c8eed7193c00e21') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + _kernver="$(cat /lib/modules/$_extramodules/version)" + + make -j1 KDIR=/usr/src/linux-$_kernver +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + install -D vhba.ko "$pkgdir/lib/modules/$_extramodules/vhba.ko" + + sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='$_extramodules'/" \ + "$startdir/vhba-module.install" + + install -Dm644 "$srcdir/60-vhba.rules" \ + "$pkgdir/lib/udev/rules.d/60-vhba.rules" +} + +# vim:set ts=2 sw=2 et: diff --git a/community-testing/vhba-module/vhba-kernel2.6.37.patch b/community-testing/vhba-module/vhba-kernel2.6.37.patch new file mode 100644 index 000000000..e2b619c74 --- /dev/null +++ b/community-testing/vhba-module/vhba-kernel2.6.37.patch @@ -0,0 +1,56 @@ +From 9ad7ec7fae387f05249b9f4e6accb3bc3b0b8b0f Mon Sep 17 00:00:00 2001 +From: Alexandre Rostovtsev <tetromino@gmail.com> +Date: Thu, 6 Jan 2011 03:39:26 -0500 +Subject: [PATCH] Make vhba compatible with kernel 2.6.37 SCSI host API + +Due to the SCSI host lock push-down changes introduced in 2.6.37 (see +http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f281233d3eba15fb225d21ae2e228fd4553d824a +for more details), trying to use current vhba on 2.6.37 leads to oopses +and kernel panics - e.g. see http://bugs.gentoo.org/show_bug.cgi?id=350753 + +Add some #ifdefs to enable compatibility both with 2.6.37 and older API. +Note that if future kernel versions remove the DEF_SCSI_QCMD macro, this +issue will need to be revisited. + +Signed-off-by: Alexandre Rostovtsev <tetromino@gmail.com> +--- + vhba-module/vhba.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +diff --git a/vhba-module/vhba.c b/vhba-module/vhba.c +index 059f6ce..9d13016 100644 +--- a/vhba-module/vhba.c ++++ b/vhba-module/vhba.c +@@ -27,6 +27,7 @@ + #include <linux/miscdevice.h> + #include <linux/poll.h> + #include <linux/slab.h> ++#include <linux/version.h> + #ifdef CONFIG_COMPAT + #include <linux/compat.h> + #endif +@@ -363,7 +364,7 @@ static void vhba_free_command(struct vhba_command *vcmd) + spin_unlock_irqrestore(&vhost->cmd_lock, flags); + } + +-static int vhba_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) ++static int vhba_queuecommand_lck(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) + { + struct vhba_device *vdev; + int retval; +@@ -388,6 +389,12 @@ static int vhba_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn + return retval; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37) ++DEF_SCSI_QCMD(vhba_queuecommand) ++#else ++#define vhba_queuecommand vhba_queuecommand_lck ++#endif ++ + static int vhba_abort(struct scsi_cmnd *cmd) + { + struct vhba_device *vdev; +-- +1.7.3.4 + diff --git a/community-testing/vhba-module/vhba-module.install b/community-testing/vhba-module/vhba-module.install new file mode 100644 index 000000000..73029498f --- /dev/null +++ b/community-testing/vhba-module/vhba-module.install @@ -0,0 +1,22 @@ +post_upgrade() { + ! grep -q 'cdemu' /etc/group && groupadd cdemu + echo " > Updating module dependencies..." + EXTRAMODULES='extramodules-3.2-ARCH' + depmod $(cat /lib/modules/$EXTRAMODULES/version) +} + + +post_install() { + echo " > Adding 'cdemu' group" + ! grep -q 'cdemu' /etc/group && groupadd cdemu + echo " > Add 'vhba' to your modules array to autoload it" + post_upgrade +} + +post_remove() { + post_upgrade + echo "Removing 'cdemu' group" + groupdel cdemu +} + +# vim:set ts=2 sw=2 et: |