summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorlukem <lukem>2001-08-09 08:16:43 +0000
committerlukem <lukem>2001-08-09 08:16:43 +0000
commitd9a7aa05e27ac45c968debde92c613a9fb11d70f (patch)
treeea119380d8493ee7c7a1b21d541ec12ce242391c /sysutils
parente4782222cd000058cf37b34cceca0f91a6c7b59c (diff)
downloadpkgsrc-d9a7aa05e27ac45c968debde92c613a9fb11d70f.tar.gz
Package of the development version of sysutils/cdrecord
The stable version is currently 1.10, this is 1.11a34
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/cdrecord-devel/patches/patch-ai113
1 files changed, 113 insertions, 0 deletions
diff --git a/sysutils/cdrecord-devel/patches/patch-ai b/sysutils/cdrecord-devel/patches/patch-ai
new file mode 100644
index 00000000000..8a0a735e026
--- /dev/null
+++ b/sysutils/cdrecord-devel/patches/patch-ai
@@ -0,0 +1,113 @@
+$NetBSD: patch-ai,v 1.1.1.1 2001/08/09 08:16:43 lukem Exp $
+
+I know this patch is an ugly hack. But at least it makes "cdrecord -scanbus"
+more usefull, which in turn makes xcdroast work. Feel free to implement
+this cleanly however...
+
+Thorsten Frueauf <frueauf@netbsd.org>, 2001.02.10
+
+--- libscg/scsi-bsd.c.orig Sun Mar 18 15:10:21 2001
++++ libscg/scsi-bsd.c Mon Aug 6 14:55:09 2001
+@@ -48,7 +48,7 @@
+ * Choose your name instead of "schily" and make clear that the version
+ * string is related to a modified source.
+ */
+-LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.40"; /* The version for this transport*/
++LOCAL char _scg_trans_version[] = "scsi-bsd.c-1.40nb1"; /* The version for this transport*/
+
+ #define MAX_SCG 16 /* Max # of SCSI controllers */
+ #define MAX_TGT 16
+@@ -108,7 +108,7 @@
+ * return "schily" for the SCG_AUTHOR request.
+ */
+ case SCG_AUTHOR:
+- return (_scg_auth_schily);
++ return ("frueauf");
+ case SCG_SCCS_ID:
+ return (__sccsid);
+ }
+@@ -130,6 +130,15 @@
+ register int l;
+ register int nopen = 0;
+ char devname[64];
++#if defined(__NetBSD__)
++ struct scsi_addr mysaddr;
++#if defined(__i386__)
++ char slicename[] = "d"; /* i386 is special */
++#else
++ char slicename[] = "c"; /* this is what the rest uses */
++#endif
++ char *myslicename = slicename;
++#endif
+
+ if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) {
+ errno = EINVAL;
+@@ -156,6 +165,60 @@
+ if ((device != NULL && *device != '\0') || (busno == -2 && tgt == -2))
+ goto openbydev;
+
++
++/*
++ * I know of no method in NetBSD to probe the scsibus and get the mapping
++ * busnumber,target,lun --> devicename.
++ *
++ * Because of this implement a true bruteforce hack to find
++ * out what cdroms there are.
++ *
++ * Note that this method only finds cd0-cd7. Anything higher
++ * than this needs additional tweaks.
++ *
++ * Feel free to implement this cleanly if you have better knowledge.
++ * Until then this helps to get -scanbus und thus xcdroast working :-)
++ *
++ */
++#if defined(__NetBSD__)
++ if (busno >= 0 && tgt >= 0 && tlun >= 0) {
++ for (l=0; l < MAX_LUN ; l++) {
++ sprintf(devname, "/dev/rcd%d%s", l, myslicename);
++ f = open(devname, O_RDWR);
++ if (f >= 0) {
++ if (ioctl(f, SCIOCIDENTIFY, &mysaddr) < 0) {
++ close(f);
++ errno = EINVAL;
++ return (0);
++ }
++ if (busno == SADDR_BUS(mysaddr) && tgt == SADDR_TARGET(mysaddr) && tlun == SADDR_LUN(mysaddr)) {
++ scglocal(scgp)->scgfiles[busno][tgt][tlun] = f;
++ return(1);
++ }
++ } else goto openbydev;
++ }
++ } else for (l=0; l < MAX_LUN ; l++) {
++ sprintf(devname, "/dev/rcd%d%s", l, myslicename);
++ f = open(devname, O_RDWR);
++ if (f >= 0) {
++ if (ioctl(f, SCIOCIDENTIFY, &mysaddr) < 0) {
++ close(f);
++ errno = EINVAL;
++ return (0);
++ }
++ scg_scsibus(scgp) = busno = SADDR_BUS(mysaddr);
++ scg_target(scgp) = tgt = SADDR_TARGET(mysaddr);
++ if ((tlun >= 0) && (tlun != SADDR_LUN(mysaddr))) {
++ close(f);
++ errno = EINVAL;
++ return (0);
++ }
++ scg_lun(scgp) = tlun = SADDR_LUN(mysaddr);
++ if (scg_setup(scgp, f, busno, tgt, tlun))
++ nopen++;
++ }
++ }
++#else /* not __NetBSD__ */
+ if (busno >= 0 && tgt >= 0 && tlun >= 0) {
+
+ js_snprintf(devname, sizeof(devname),
+@@ -192,6 +255,7 @@
+ }
+ }
+ }
++#endif /* end of not __NetBSD__ */
+ /*
+ * Could not open /dev/su-* or got dev=devname:b,l,l / dev=devname:@,l
+ * We do the apropriate tests and try our best.