diff options
author | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-07-05 00:11:08 +0000 |
---|---|---|
committer | Alexandre Rostovtsev <tetromino@gentoo.org> | 2012-07-05 00:11:08 +0000 |
commit | 3dcadf8932d8ffa773be879dead3ac777f572023 (patch) | |
tree | f77ef2252b63603316540ccf89d1d80470e57c7a /sys-fs | |
parent | Restrict test for now (diff) | |
download | gentoo-2-3dcadf8932d8ffa773be879dead3ac777f572023.tar.gz gentoo-2-3dcadf8932d8ffa773be879dead3ac777f572023.tar.bz2 gentoo-2-3dcadf8932d8ffa773be879dead3ac777f572023.zip |
Version bump. Drop ancient versions incompatible with modern kernels.
(Portage version: 2.2.0_alpha115/cvs/Linux x86_64)
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/vhba/ChangeLog | 13 | ||||
-rw-r--r-- | sys-fs/vhba/files/1.2.1-kerneldir.patch | 12 | ||||
-rw-r--r-- | sys-fs/vhba/files/1.2.1-parallel_build.patch | 17 | ||||
-rw-r--r-- | sys-fs/vhba/files/vhba-1.0.0-makefile.patch | 36 | ||||
-rw-r--r-- | sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch | 19 | ||||
-rw-r--r-- | sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch | 98 | ||||
-rw-r--r-- | sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.33.patch | 14 | ||||
-rw-r--r-- | sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.34.patch | 15 | ||||
-rw-r--r-- | sys-fs/vhba/files/vhba-20101015-scsi-host-lock-push-down.patch | 56 | ||||
-rw-r--r-- | sys-fs/vhba/vhba-1.2.1.ebuild | 58 | ||||
-rw-r--r-- | sys-fs/vhba/vhba-20101015-r1.ebuild | 60 | ||||
-rw-r--r-- | sys-fs/vhba/vhba-20120422.ebuild | 83 |
12 files changed, 95 insertions, 386 deletions
diff --git a/sys-fs/vhba/ChangeLog b/sys-fs/vhba/ChangeLog index dae75149c9b9..7bbb3bac0484 100644 --- a/sys-fs/vhba/ChangeLog +++ b/sys-fs/vhba/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-fs/vhba # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/ChangeLog,v 1.33 2012/05/24 04:20:30 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/ChangeLog,v 1.34 2012/07/05 00:11:07 tetromino Exp $ + +*vhba-20120422 (05 Jul 2012) + + 05 Jul 2012; Alexandre Rostovtsev <tetromino@gentoo.org> + -files/1.2.1-kerneldir.patch, -files/vhba-1.2.1-kernel-2.6.33.patch, + -files/1.2.1-parallel_build.patch, -files/vhba-1.0.0-makefile.patch, + -files/vhba-1.0.0-scatterlist.patch, -files/vhba-1.0.0-scsicmnd.patch, + -vhba-1.2.1.ebuild, -files/vhba-1.2.1-kernel-2.6.34.patch, + -vhba-20101015-r1.ebuild, + -files/vhba-20101015-scsi-host-lock-push-down.patch, +vhba-20120422.ebuild: + Version bump. Drop ancient versions incompatible with modern kernels. 24 May 2012; Mike Frysinger <vapier@gentoo.org> vhba-1.2.1.ebuild, vhba-20101015-r1.ebuild, vhba-20110915.ebuild: diff --git a/sys-fs/vhba/files/1.2.1-kerneldir.patch b/sys-fs/vhba/files/1.2.1-kerneldir.patch deleted file mode 100644 index 7388d5414462..000000000000 --- a/sys-fs/vhba/files/1.2.1-kerneldir.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur vhba-module-1.2.1.orig/Makefile vhba-module-1.2.1/Makefile ---- vhba-module-1.2.1.orig/Makefile 2009-09-19 13:10:07.790478925 +0200 -+++ vhba-module-1.2.1/Makefile 2009-09-19 13:16:03.484646317 +0200 -@@ -9,7 +9,7 @@ - ifndef KERNELRELEASE - KERNELRELEASE := `uname -r` - endif --KDIR := /lib/modules/$(KERNELRELEASE)/build -+KDIR ?= /lib/modules/$(KERNELRELEASE)/build - KMAKE := $(MAKE) -C $(KDIR) M=$(PWD) - - all: kernel.api.h modules diff --git a/sys-fs/vhba/files/1.2.1-parallel_build.patch b/sys-fs/vhba/files/1.2.1-parallel_build.patch deleted file mode 100644 index 2de83a56375f..000000000000 --- a/sys-fs/vhba/files/1.2.1-parallel_build.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- vhba-module-1.2.1/Makefile.orig 2009-03-12 07:27:57.162795736 +0100 -+++ vhba-module-1.2.1/Makefile 2009-03-12 07:28:11.929429127 +0100 -@@ -12,12 +12,12 @@ - KDIR := /lib/modules/$(KERNELRELEASE)/build - KMAKE := $(MAKE) -C $(KDIR) M=$(PWD) - --all: kernel.api.h modules -+all: modules - - kernel.api.h: kat/*.c - kat/kat ${KDIR} $@ $^ - --modules: -+modules: kernel.api.h - $(KMAKE) modules - - module_install: diff --git a/sys-fs/vhba/files/vhba-1.0.0-makefile.patch b/sys-fs/vhba/files/vhba-1.0.0-makefile.patch deleted file mode 100644 index 289387005113..000000000000 --- a/sys-fs/vhba/files/vhba-1.0.0-makefile.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- vhba-module-1.0.0/Makefile 2007-12-20 02:56:57.000000000 +0100 -+++ vhba-module-new/Makefile 2008-01-10 21:59:56.000000000 +0100 -@@ -1,21 +1,20 @@ - VHBA_VERSION = 1.0.0 - PACKAGE = vhba-module-$(VHBA_VERSION) - --CFLAGS += -DVHBA_VERSION=\"$(VHBA_VERSION)\" -+EXTRA_CFLAGS += -DVHBA_VERSION=\"$(VHBA_VERSION)\" - - obj-m += vhba.o - - PWD ?= `pwd` - KDIR := /lib/modules/`uname -r`/build --KMAKE := $(MAKE) -C $(KDIR) M=$(PWD) - - all: modules - - modules: -- $(KMAKE) modules -+ $(MAKE) -C $(KDIR) M=$(PWD) modules - - module_install: -- $(KMAKE) modules_install -+ $(MAKE) -C $(KDIR) M=$(PWD) modules_install - - install: module_install - -@@ -24,7 +23,7 @@ - cp Makefile $(distdir) - - clean: -- $(KMAKE) clean -+ $(MAKE) -C $(KDIR) M=$(PWD) clean - rm -fr $(PACKAGE) - - dist: dist-gzip diff --git a/sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch b/sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch deleted file mode 100644 index 5473ac3dd50e..000000000000 --- a/sys-fs/vhba/files/vhba-1.0.0-scatterlist.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- vhba-module-1.0.0/vhba.c 2007-12-20 02:56:57.000000000 +0100 -+++ vhba-module-new/vhba.c 2008-01-06 08:49:18.000000000 +0100 -@@ -26,6 +26,7 @@ - #include <linux/platform_device.h> - #include <linux/miscdevice.h> - #include <linux/poll.h> -+#include <linux/scatterlist.h> - #include <asm/uaccess.h> - #include <scsi/scsi.h> - #include <scsi/scsi_host.h> -@@ -520,7 +521,7 @@ - } - uaddr += len; - -- kaddr = kmap_atomic(sg[i].page, KM_USER0); -+ kaddr = kmap_atomic(sg_page(&sg[i]), KM_USER0); - memcpy(kaddr + sg[i].offset, kbuf, len); - kunmap_atomic(kaddr, KM_USER0); - diff --git a/sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch b/sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch deleted file mode 100644 index bc8e64656dd6..000000000000 --- a/sys-fs/vhba/files/vhba-1.0.0-scsicmnd.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- vhba-module-org/vhba.c 2008-03-03 19:31:06.000000000 +0100 -+++ vhba-module-1.0.0/vhba.c 2008-03-03 20:04:30.000000000 +0100 -@@ -425,11 +425,11 @@ - ssize_t ret; - - scmd_dbg(cmd, "request %lu, cdb 0x%x, bufflen %d, use_sg %d\n", -- cmd->serial_number, cmd->cmnd[0], cmd->request_bufflen, cmd->use_sg); -+ cmd->serial_number, cmd->cmnd[0], cmd->sdb.length, cmd->sdb.table.nents); - - ret = sizeof(vreq); - if (DATA_TO_DEVICE(cmd->sc_data_direction)) -- ret += cmd->request_bufflen; -+ ret += cmd->sdb.length; - - if (ret > buf_len) - { -@@ -442,7 +442,7 @@ - vreq.lun = cmd->device->lun; - memcpy(vreq.cdb, cmd->cmnd, MAX_COMMAND_SIZE); - vreq.cdb_len = cmd->cmd_len; -- vreq.data_len = cmd->request_bufflen; -+ vreq.data_len = cmd->sdb.length; - - if (copy_to_user(buf, &vreq, sizeof(vreq))) - return -EFAULT; -@@ -452,7 +452,7 @@ - buf += sizeof(vreq); - - /* XXX use_sg? */ -- if (copy_to_user(buf, cmd->request_buffer, vreq.data_len)) -+ if (copy_to_user(buf, cmd->sdb.table.sgl, vreq.data_len)) - return -EFAULT; - } - -@@ -464,7 +464,7 @@ - ssize_t ret = 0; - - scmd_dbg(cmd, "response %lu, status %x, data len %d, use_sg %d\n", -- cmd->serial_number, res->status, res->data_len, cmd->use_sg); -+ cmd->serial_number, res->status, res->data_len, cmd->sdb.table.nents); - - if (res->status) - { -@@ -481,23 +481,23 @@ - - ret += res->data_len; - } -- else if (DATA_FROM_DEVICE(cmd->sc_data_direction) && cmd->request_bufflen) -+ else if (DATA_FROM_DEVICE(cmd->sc_data_direction) && cmd->sdb.length) - { - size_t to_read; - -- if (res->data_len > cmd->request_bufflen) -+ if (res->data_len > cmd->sdb.length) - { -- scmd_warn(cmd, "truncate data (%d < %d)\n", cmd->request_bufflen, res->data_len); -- res->data_len = cmd->request_bufflen; -+ scmd_warn(cmd, "truncate data (%d < %d)\n", cmd->sdb.length, res->data_len); -+ res->data_len = cmd->sdb.length; - } - - to_read = res->data_len; - -- if (cmd->use_sg) -+ if (cmd->sdb.table.nents) - { - unsigned char buf_stack[64]; - unsigned char *kaddr, *uaddr, *kbuf; -- struct scatterlist *sg = cmd->request_buffer; -+ struct scatterlist *sg = cmd->sdb.table.sgl; - int i; - - uaddr = (unsigned char *) buf; -@@ -507,7 +507,7 @@ - else - kbuf = buf_stack; - -- for (i = 0; i < cmd->use_sg; i++) -+ for (i = 0; i < cmd->sdb.table.nents; i++) - { - size_t len = (sg[i].length < to_read) ? sg[i].length : to_read; - -@@ -534,13 +534,13 @@ - } - else - { -- if (copy_from_user(cmd->request_buffer, buf, res->data_len)) -+ if (copy_from_user(cmd->sdb.table.sgl, buf, res->data_len)) - return -EFAULT; - - to_read -= res->data_len; - } - -- cmd->resid = to_read; -+ cmd->sdb.resid = to_read; - - ret += res->data_len - to_read; - } diff --git a/sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.33.patch b/sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.33.patch deleted file mode 100644 index 68e12dcb6ee2..000000000000 --- a/sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.33.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- trunk/vhba-module/kat/have_scsi_macros.c 2010/03/01 19:11:48 673 -+++ trunk/vhba-module/kat/have_scsi_macros.c 2010/03/05 10:50:24 674 -@@ -1,4 +1,3 @@ --#include <linux/autoconf.h> - #include <scsi/scsi_cmnd.h> - - void testfunc (void); ---- trunk/vhba-module/kat/scatterlist_has_page_link.c 2010/03/01 19:11:48 673 -+++ trunk/vhba-module/kat/scatterlist_has_page_link.c 2010/03/05 10:50:24 674 -@@ -1,4 +1,3 @@ --#include <linux/autoconf.h> - #include <linux/scatterlist.h> - - /* Note: scatterlist.page_link is used in kernel (2.6.24 <= version < X) */ diff --git a/sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.34.patch b/sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.34.patch deleted file mode 100644 index 1ec5112777c9..000000000000 --- a/sys-fs/vhba/files/vhba-1.2.1-kernel-2.6.34.patch +++ /dev/null @@ -1,15 +0,0 @@ -http://cdemu.svn.sourceforge.net/viewvc/cdemu/trunk/vhba-module/vhba.c?r1=678&r2=677&pathrev=678 -https://sourceforge.net/tracker/?func=detail&atid=603423&aid=2992162&group_id=93175 -http://bugs.gentoo.org/show_bug.cgi?id=317119 - ---- vhba.c 2010-04-26 19:35:04 +0000 -+++ vhba.c 2010-04-26 19:35:20 +0000 -@@ -26,6 +26,7 @@ - #include <linux/platform_device.h> - #include <linux/miscdevice.h> - #include <linux/poll.h> -+#include <linux/slab.h> - #include <asm/uaccess.h> - #include <scsi/scsi.h> - #include <scsi/scsi_host.h> - diff --git a/sys-fs/vhba/files/vhba-20101015-scsi-host-lock-push-down.patch b/sys-fs/vhba/files/vhba-20101015-scsi-host-lock-push-down.patch deleted file mode 100644 index e2b619c74ba8..000000000000 --- a/sys-fs/vhba/files/vhba-20101015-scsi-host-lock-push-down.patch +++ /dev/null @@ -1,56 +0,0 @@ -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/sys-fs/vhba/vhba-1.2.1.ebuild b/sys-fs/vhba/vhba-1.2.1.ebuild deleted file mode 100644 index 41f00d42e901..000000000000 --- a/sys-fs/vhba/vhba-1.2.1.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/vhba-1.2.1.ebuild,v 1.10 2012/05/24 04:20:30 vapier Exp $ - -EAPI="2" - -inherit linux-mod eutils user - -DESCRIPTION="Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite" -HOMEPAGE="http://cdemu.org" -SRC_URI="mirror://sourceforge/cdemu/vhba-module-${PV}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="" - -DEPEND="virtual/linux-sources" -RDEPEND="" - -S="${WORKDIR}/vhba-module-${PV}" -MODULE_NAMES="vhba(block:${S})" -BUILD_TARGETS="all" - -pkg_setup() { - CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG" - check_extra_config - BUILD_PARAMS="KDIR=${KV_DIR}" - linux-mod_pkg_setup -} - -src_prepare() { - epatch \ - "${FILESDIR}/${PV}-parallel_build.patch" \ - "${FILESDIR}/${PV}-kerneldir.patch" \ - "${FILESDIR}/${P}-kernel-2.6.33.patch" \ - "${FILESDIR}/${P}-kernel-2.6.34.patch" -} - -src_install() { - KV_OBJ="ko" - linux-mod_src_install || die "Error: installing module failed!" - UDEV_RULES="/etc/udev/rules.d/70-vhba.rules" - einfo "Generating UDEV-rules ..." - mkdir -p "${D}"/${UDEV_RULES%/*} - echo -e "# do not edit this file, it will be overwritten on update\n#" \ - > "${D}"/${UDEV_RULES} - echo -e "KERNEL==\"vhba_ctl\", NAME=\"%k\", MODE=\"0660\", OWNER=\"root\",GROUP=\"cdemu\"" >> "${D}"/${UDEV_RULES} -} - -pkg_postinst() { - einfo "Generating cdemu group ..." - enewgroup cdemu - - elog "Don't forget to add your user to the cdemu group " - elog "if you want to be able to use virtual cdemu devices." - linux-mod_pkg_postinst -} diff --git a/sys-fs/vhba/vhba-20101015-r1.ebuild b/sys-fs/vhba/vhba-20101015-r1.ebuild deleted file mode 100644 index 578e6d87380a..000000000000 --- a/sys-fs/vhba/vhba-20101015-r1.ebuild +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/vhba-20101015-r1.ebuild,v 1.6 2012/05/24 04:20:30 vapier Exp $ - -# Use svn snapshots: -# https://sourceforge.net/tracker/?func=detail&atid=603423&aid=3041832&group_id=93175 -# "As for the release, could you package the SVN version instead? I'd prefer -# if people used latest SVN at any time anyway..." -- Upstream - -EAPI="2" - -inherit linux-mod eutils user - -MY_P=vhba-module-${PV} -DESCRIPTION="Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite" -HOMEPAGE="http://cdemu.org" -SRC_URI="mirror://gentoo/${MY_P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="" - -DEPEND="virtual/linux-sources" -RDEPEND="" - -S=${WORKDIR}/${MY_P} -MODULE_NAMES="vhba(block:${S})" -BUILD_TARGETS=all - -pkg_setup() { - CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG" - check_extra_config - BUILD_PARAMS="KDIR=${KV_DIR}" - linux-mod_pkg_setup -} - -src_prepare() { - epatch "${FILESDIR}"/${P}-scsi-host-lock-push-down.patch -} - -src_install() { - linux-mod_src_install || die "Error: installing module failed!" - - einfo "Generating udev rules ..." - dodir /etc/udev/rules.d/ - cat > "${D}"/etc/udev/rules.d/70-vhba.rules <<-EOF || die - # do not edit this file, it will be overwritten on update - # - KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu" - EOF -} - -pkg_postinst() { - enewgroup cdemu - - elog "Don't forget to add your user to the cdemu group" - elog "if you want to be able to use virtual cdemu devices." - linux-mod_pkg_postinst -} diff --git a/sys-fs/vhba/vhba-20120422.ebuild b/sys-fs/vhba/vhba-20120422.ebuild new file mode 100644 index 000000000000..b4e8143d2bd0 --- /dev/null +++ b/sys-fs/vhba/vhba-20120422.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/vhba/vhba-20120422.ebuild,v 1.1 2012/07/05 00:11:07 tetromino Exp $ + +EAPI="4" + +inherit linux-mod user + +MY_P=vhba-module-${PV} +DESCRIPTION="Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite" +HOMEPAGE="http://cdemu.org" +SRC_URI="mirror://sourceforge/cdemu/${MY_P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~x86" +IUSE="" + +RDEPEND=">=sys-fs/udev-125" +DEPEND="" + +S=${WORKDIR}/${MY_P} +MODULE_NAMES="vhba(block:${S})" +BUILD_TARGETS=all + +pkg_setup() { + CONFIG_CHECK="~BLK_DEV_SR ~CHR_DEV_SG" + check_extra_config + BUILD_PARAMS="KDIR=${KV_DIR}" + linux-mod_pkg_setup + + enewgroup cdemu +} + +src_prepare() { + # Avoid "make jobserver unavailable" warning + sed -e 's:\t$(KMAKE):\t+$(KMAKE):g' -i Makefile || die "sed failed" +} + +src_install() { + dodoc AUTHORS ChangeLog README + linux-mod_src_install + + einfo "Generating udev rules ..." + dodir /lib/udev/rules.d/ + cat > "${D}"/lib/udev/rules.d/70-vhba.rules <<-EOF || die + # do not edit this file, it will be overwritten on update + # + KERNEL=="vhba_ctl", MODE="0660", OWNER="root", GROUP="cdemu" + EOF +} + +pkg_postinst() { + elog "Don't forget to add your user to the cdemu group if you want to" + elog "be able to use virtual cdemu devices." + + # Older versions of vhba installed their rule file in /etc/udev/rules.d, + # which overrides rules in /lib/udev/rules.d. We remove the old file + # automatically if it is identical to the default one installed by + # vhba-1.2.1 or 20101015-r1. Note that the comment at the top of the rules + # file states that it can be automatically overwritten by the system. + old_rules="${ROOT}etc/udev/rules.d/70-vhba.rules" + if [[ -f "${old_rules}" ]]; then + case "$(md5sum ${old_rules})" in + 2959b3cf61cfe6e466cc3516a7bc19de* | 1e7a7e5d6d28c811eeec98ec26ed5d28* ) + elog + elog "Removing old ${old_rules} ..." + rm -f "${old_rules}" || + eerror "Failed, please remove ${old_rules} manually." + ;; + * ) + ewarn + ewarn "The ${old_rules} file from a previous" + ewarn "installation of ${PN} is overriding ${P}'s" + ewarn "udev rules. Unless you had deliberately customized it," + ewarn "you should remove it." + ewarn + ;; + esac + fi + + linux-mod_pkg_postinst +} |