Date: Mon, 25 Jun 2001 07:50:00 -0400 From: James Halstead <James_Bond_79@yahoo.com> To: David Gilbert <dgilbert@velocet.ca> Cc: freebsd-hackers@freebsd.org Subject: Re: DVD IOCTLs on IDE? Message-ID: <01062507500001.00449@halstead007> In-Reply-To: <15158.36689.918629.862331@trooper.velocet.net> References: <15158.24886.958193.121109@trooper.velocet.net> <01062420555600.00449@halstead007> <15158.36689.918629.862331@trooper.velocet.net>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Sunday 24 June 2001 21:09, David Gilbert wrote:
> Could I have a copy of your patches? Where do I get xine?
The attached is a shell archive for a port I made out of the libcss from
livid. It compiles but i have no idea if it works. Please do not submit it to
the ports collection! all the patches are in the files/patch-* files.
As for xine, go to xine.sourceforge.net, hit the how to link, then choose
browseable html. Select the playing dvd's and there will be a link to the
captiancss page. It compiles cleanly on my 4.x system with ./configure
--prefix=/usr/X11R6; gmake; gmake install. If I remember right the makefiles
will work with the regular make as well if you don't have gmake installed.
There is also a link to the linux video site (where libcss comes from) and a
plugin to use libcss. However I cannot get the plugin for this one to compile
yet.
If you have any luck tell me. I have been able to watch encrypted dvd's but
it seems to like crashing when changing tracks. Also i have had a problem
where xine will stop running after a while, seems to be running out of shared
memory maps, something is not getting cleaned up properly.
> Dave.
James
[-- Attachment #2 --]
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# libcss
# libcss/pkg-descr
# libcss/pkg-plist
# libcss/files
# libcss/files/patch-aa
# libcss/files/patch-ag
# libcss/files/patch-ab
# libcss/files/patch-ac
# libcss/files/patch-ad
# libcss/files/patch-ae
# libcss/files/patch-af
# libcss/files/patches-ah
# libcss/distinfo
# libcss/pkg-comment
# libcss/Makefile
#
echo c - libcss
mkdir -p libcss > /dev/null 2>&1
echo x - libcss/pkg-descr
sed 's/^X//' >libcss/pkg-descr << 'END-of-libcss/pkg-descr'
XLibcss library as implemented in the livid project. Should work with xine to
Xplay encrypted dvd's
END-of-libcss/pkg-descr
echo x - libcss/pkg-plist
sed 's/^X//' >libcss/pkg-plist << 'END-of-libcss/pkg-plist'
Xbin/tstdvd
Xbin/dvdinfo
Xbin/reset_dvd
Xinclude/css.h
Xlib/libcss.so.1
Xlib/libcss.so
Xlib/libcss.la
Xlib/libcss.a
Xshare/aclocal/dvd.m4
END-of-libcss/pkg-plist
echo c - libcss/files
mkdir -p libcss/files > /dev/null 2>&1
echo x - libcss/files/patch-aa
sed 's/^X//' >libcss/files/patch-aa << 'END-of-libcss/files/patch-aa'
X--- configure.in.orig Wed Feb 14 19:40:02 2001
X+++ configure.in Wed Jun 20 16:33:24 2001
X@@ -43,15 +43,19 @@
X if test "x$enable_devel" = "xyes"; then
X CFLAGS="$CFLAGS -g3 -DDEVEL -DDEBUG"
X else
X- CFLAGS="$CFLAGS -O6 -fomit-frame-pointer -funroll-all-loops -D__OPTIMIZE__ -D__USE_STRING_INLINES"
X+ CFLAGS="$CFLAGS -O6 -fomit-frame-pointer -funroll-all-loops -D__OPTIMIZE__ -D__USE_STRING_INLINES \$(EXTRA_DEFS)"
X fi
X
X-
X dnl ==========
X dnl get location of kernel headers
X dnl ==========
X
X AC_C_KERNEL_INCLUDES
X+
X+dnl ==========
X+dnl Check if we're on FreeBSD
X+dnl ==========
X+AM_CONDITIONAL(FREEBSD, test `uname -s` = "FreeBSD")
X
X dnl ==========
X dnl Output configuration files
END-of-libcss/files/patch-aa
echo x - libcss/files/patch-ag
sed 's/^X//' >libcss/files/patch-ag << 'END-of-libcss/files/patch-ag'
X--- src/tstdvd.c.orig Tue Feb 13 16:59:27 2001
X+++ src/tstdvd.c Wed Jun 20 16:33:24 2001
X@@ -65,11 +65,19 @@
X perror("DVD vob file");
X return 0;
X }
X+#ifndef __FreeBSD__
X if (ioctl(fd, FIBMAP, &lba) != 0) {
X perror ("ioctl FIBMAP");
X close(fd);
X return 0;
X }
X+#else
X+ if (ioctl(fd, FIOGETLBA, &lba) != 0) {
X+ perror ("ioctl FIOGETLBA");
X+ close(fd);
X+ return 0;
X+ }
X+#endif
X
X close(fd);
X
END-of-libcss/files/patch-ag
echo x - libcss/files/patch-ab
sed 's/^X//' >libcss/files/patch-ab << 'END-of-libcss/files/patch-ab'
X--- src/Makefile.am.orig Thu Nov 2 14:06:41 2000
X+++ src/Makefile.am Wed Jun 20 16:33:24 2001
X@@ -10,17 +10,30 @@
X bin_PROGRAMS = tstdvd dvdinfo reset_dvd
X noinst_PROGRAMS = css_cat
X
X+if FREEBSD
X+EXTRA_DEFS = -D_THREAD_SAFE
X+LIBPTHREAD = -pthread
X+LIBDL =
X+else
X+EXTRA_DEFS =
X+LIBPTHREAD =
X+LIBDL = -ldl
X+endif
X+
X tstdvd_SOURCES = tstdvd.c
X tstdvd_DEPENDENCIES = libcss.la
X-tstdvd_LDADD = libcss.la -ldl
X+tstdvd_LDFLAGS = $(LIBPTHREAD)
X+tstdvd_LDADD = libcss.la $(LIBDL)
X
X css_cat_SOURCES = css_cat.c
X css_cat_DEPENDENCIES = libcss.la
X-css_cat_LDADD = libcss.la -ldl
X+css_cat_LDFLAGS = $(LIBPTHREAD)
X+css_cat_LDADD = libcss.la $(LIBDL)
X
X dvdinfo_SOURCES = dvdinfo.c
X dvdinfo_DEPENDENCIES = libcss.la
X-dvdinfo_LDADD = libcss.la -ldl
X+dvdinfo_LDFLAGS = $(LIBPTHREAD)
X+dvdinfo_LDADD = libcss.la $(LIBDL)
X
X reset_dvd_SOURCES = reset_dvd.c
X
END-of-libcss/files/patch-ab
echo x - libcss/files/patch-ac
sed 's/^X//' >libcss/files/patch-ac << 'END-of-libcss/files/patch-ac'
X--- src/css.c.orig Tue Feb 13 16:59:27 2001
X+++ src/css.c Wed Jun 20 16:33:24 2001
X@@ -30,7 +30,7 @@
X #include <sys/stat.h>
X #include <sys/types.h>
X #include <errno.h>
X-#if defined(__NetBSD__) || defined(__OpenBSD__)
X+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X # include <sys/dvdio.h>
X #elif defined(__linux__)
X # include <linux/cdrom.h>
X@@ -41,13 +41,17 @@
X #include "css_auth.h"
X #include "css.h"
X
X+#ifdef __FreeBSD__
X+typedef struct dvd_struct dvd_struct;
X+typedef struct dvd_authinfo dvd_authinfo;
X+#endif
X
X typedef struct {
X uint8_t Challenge[10];
X uint8_t Key1[LEN_KEY];
X uint8_t Key2[LEN_KEY];
X uint8_t KeyCheck[LEN_KEY];
X- uint8_t varient;
X+ uint8_t variant;
X } DiscKeys;
X
X DiscKeys discKeys;
X@@ -70,12 +74,13 @@
X #else
X #define _CSSPrintDebug(args...)
X #define _CSSPrintDebugBytes(descr, val, len)
X+#define _CSSPrintBytes(val, len)
X #endif
X
X /**
X * CSSAuthDrive
X * Determine if drive is authentic
X- * Return: -1 if failed, 0..32 = varient of CSS
X+ * Return: -1 if failed, 0..32 = variant of CSS
X **/
X
X
X@@ -90,8 +95,8 @@
X CryptKey1( i, disc->Challenge, disc->KeyCheck);
X
X if (memcmp (disc->KeyCheck, disc->Key1, LEN_KEY) == 0) {
X- _CSSPrintDebug ("Drive Authentic - using varient %d\n", i);
X- disc->varient = i;
X+ _CSSPrintDebug ("Drive Authentic - using variant %d\n", i);
X+ disc->variant = i;
X return i;
X }
X }
X@@ -119,6 +124,7 @@
X dvd_struct s;
X int i;
X
X+#ifndef __FreeBSD__
X s.type = DVD_STRUCT_DISCKEY;
X s.disckey.agid = agid;
X memset (s.disckey.value, 0, 2048);
X@@ -134,6 +140,29 @@
X _CSSPrintDebugBytes ("Received Disc Key", s.disckey.value, 10);
X
X memcpy (key_disc, s.disckey.value, 2048);
X+#else
X+ /*
X+ * FreeBSD's dvd_struct is not a union as it is with the other
X+ * platforms; hence, there are no additional sub-member
X+ * dereferences.
X+ */
X+
X+ s.format = DVD_STRUCT_DISCKEY;
X+ s.agid = agid;
X+ memset( s.data, 0, 2048);
X+
X+ if (ioctl( fd, DVDIOCREADSTRUCTURE, &s) < 0) {
X+ perror( "Could not read Disc Key");
X+ return -1;
X+ }
X+
X+ for( i=0; i<sizeof(s.data); i++)
X+ s.data[i] ^= key[4 - (i % LEN_KEY)];
X+
X+ _CSSPrintDebugBytes( "Received Disc Key", s.data, 10);
X+
X+ memcpy( key_disc, s.data, 2048);
X+#endif
X
X return 0;
X }
X@@ -156,6 +185,7 @@
X dvd_authinfo ai;
X int i;
X
X+#ifndef __FreeBSD__
X ai.type = DVD_LU_SEND_TITLE_KEY;
X
X ai.lstk.agid = agid;
X@@ -173,6 +203,25 @@
X _CSSPrintDebug (" CPM=%d, CP_SEC=%d, CGMS=%d\n", ai.lstk.cpm, ai.lstk.cp_sec, ai.lstk.cgms);
X
X memcpy (key_title, ai.lstk.title_key, LEN_KEY);
X+#else
X+ ai.format = DVD_REPORT_TITLE_KEY;
X+ ai.agid = agid;
X+ ai.lba = lba;
X+ memset( ai.keychal, 0, 10);
X+
X+ if (ioctl( fd, DVDIOCREPORTKEY, &ai)) {
X+ perror( "GetTitleKey failed");
X+ return -1;
X+ }
X+
X+ for( i=0; i<LEN_KEY; i++)
X+ ai.keychal[i] ^= key[4 - (i%LEN_KEY)];
X+
X+ _CSSPrintDebugBytes( "Received Title Key", ai.keychal, LEN_KEY);
X+ _CSSPrintDebug(" CPM=%d, CP_SEC=%d, CGMS=%d\n", ai.cpm, ai.cp_sec, ai.cgms);
X+
X+ memcpy( key_title, ai.keychal, LEN_KEY);
X+#endif
X
X return 0;
X }
X@@ -189,6 +238,7 @@
X {
X dvd_authinfo ai;
X
X+#ifndef __FreeBSD__
X ai.type = DVD_LU_SEND_ASF;
X ai.lsasf.asf = 0;
X
X@@ -198,6 +248,16 @@
X return 0;
X }
X }
X+#else
X+ ai.format = DVD_REPORT_ASF;
X+ ai.agid = 0;
X+ ai.asf = 0;
X+
X+ if (!(ioctl(fd, DVDIOCREPORTKEY, &ai))) {
X+ _CSSPrintDebug ("%sAuthenticated\n", (ai.asf) ? "" : "not");
X+ return 0;
X+ }
X+#endif
X perror ("GetASF");
X return -1;
X }
X@@ -214,18 +274,34 @@
X
X /* Init sequence, request AGID */
X for (tries = 1; tries < 4; ++tries) {
X- _CSSPrintDebug ("Request AGID [%d]...\n", tries);
X+ _CSSPrintDebug ("Request AGID [%d]...", tries);
X+#ifndef __FreeBSD__
X ai->type = DVD_LU_SEND_AGID;
X ai->lsa.agid = 0;
X rv = ioctl (fd, DVD_AUTH, ai);
X+#else
X+ ai->format = DVD_REPORT_AGID;
X+ ai->agid = 0;
X+ rv = ioctl( fd, DVDIOCREPORTKEY, ai);
X+#endif
X if (rv != -1) {
X // found key
X+ _CSSPrintDebug( "AGID %d\n", ai->agid);
X return( tries);
X }
X+ else {
X+ _CSSPrintDebug("\n");
X+ }
X perror ("N/A, invalidating");
X+#ifndef __FreeBSD__
X ai->type = DVD_INVALIDATE_AGID;
X ai->lsa.agid = 0;
X ioctl (fd, DVD_AUTH, ai);
X+#else
X+ ai->format = DVD_INVALIDATE_AGID;
X+ ai->agid = 0;
X+ ioctl (fd, DVDIOCREPORTKEY, ai);
X+#endif
X }
X
X _CSSPrintDebug ("Cannot get AGID\n");
X@@ -234,6 +310,7 @@
X }
X
X
X+#ifndef __FreeBSD__
X /**
X * Simulation of a non-CSS compliant host (i.e. the authentication fails,
X * but idea is here for a real CSS compliant authentication scheme).
X@@ -267,7 +344,7 @@
X
X _CSSPrintDebugBytes ("LU sent challenge", ai->hsc.chal, 10);
X
X- CryptKey2 (disc->varient, disc->Challenge, disc->Key2);
X+ CryptKey2 (disc->variant, disc->Challenge, disc->Key2);
X ai->type = DVD_HOST_SEND_KEY2;
X break;
X
X@@ -298,6 +375,7 @@
X
X return 0;
X }
X+#endif
X
X
X /**
X@@ -319,6 +397,7 @@
X for (i = 0; i < 10; ++i)
X disc->Challenge[i] = i;
X
X+#ifndef __FreeBSD__
X /* Send AGID to host */
X if (_CSSAuthHost(&ai, disc) < 0) {
X _CSSPrintDebug ("Send AGID to host failed\n");
X@@ -370,10 +449,85 @@
X _CSSPrintDebug ("DVD is authenticated\n");
X else if (ai.type == DVD_AUTH_FAILURE)
X _CSSPrintDebug ("DVD authentication failed\n");
X+#else
X+ agid = ai.agid;
X+
X+ /* Get challenge from host */
X+
X+ ai.format = DVD_SEND_CHALLENGE;
X+ for (i=0; i<10; ++i)
X+ ai.keychal[9-i] = disc->Challenge[i];
X+
X+ _CSSPrintDebug("Host sending challenge: ");
X+ _CSSPrintBytes(ai.keychal, 10);
X+ _CSSPrintDebug("\n");
X+
X+ /* Send challenge to LU */
X+
X+ if (ioctl(fd, DVDIOCSENDKEY, &ai) < 0) {
X+ _CSSPrintDebug("Send challenge to LU failed\n");
X+ return -1;
X+ }
X+
X+ /* Get key1 from LU */
X+
X+ ai.format = DVD_REPORT_KEY1;
X+ if (ioctl(fd, DVDIOCREPORTKEY, &ai) < 0) {
X+ _CSSPrintDebug("Get key1 from LU failed\n");
X+ return -1;
X+ }
X+
X+ /* Send key1 to host */
X+
X+ _CSSPrintDebug("LU sent key1: ");
X+ _CSSPrintBytes(ai.keychal, LEN_KEY);
X+ _CSSPrintDebug("\n");
X+
X+ if (_CSSAuthDrive( ai.keychal, disc) < 0) {
X+ _CSSPrintDebug("Send key1 to host failed\n");
X+ return -1;
X+ }
X+
X+ /* Get challenge from LU */
X+
X+ ai.format = DVD_REPORT_CHALLENGE;
X+ if (ioctl(fd, DVDIOCREPORTKEY, &ai) < 0) {
X+ _CSSPrintDebug("Get challenge from LU failed\n");
X+ return -1;
X+ }
X+
X+ /* Send challenge to host */
X+
X+ for (i=0; i<10; ++i)
X+ disc->Challenge[i] = ai.keychal[9-i];
X+
X+ _CSSPrintDebug("LU sent challenge: ");
X+ _CSSPrintBytes(disc->Challenge, 10);
X+ _CSSPrintDebug("\n");
X+
X+ CryptKey2(disc->variant, disc->Challenge, disc->Key2);
X+
X+ /* Get key2 from host */
X+
X+ ai.format = DVD_SEND_KEY2;
X+ for (i=0; i<LEN_KEY; ++i)
X+ ai.keychal[4-i] = disc->Key2[i];
X+
X+ _CSSPrintDebug("Host sending key 2: ");
X+ _CSSPrintBytes(disc->Key2, LEN_KEY);
X+ _CSSPrintDebug("\n");
X+
X+ /* Send key2 to LU */
X+ if (ioctl(fd, DVDIOCSENDKEY, &ai) < 0) {
X+ printf("Send key2 to LU failed (expected)\n");
X+ return -1;
X+ }
X+
X+#endif
X
X memcpy (disc->Challenge, disc->Key1, LEN_KEY);
X memcpy (disc->Challenge+LEN_KEY, disc->Key2, LEN_KEY);
X- CryptBusKey (disc->varient, disc->Challenge, disc->KeyCheck);
X+ CryptBusKey (disc->variant, disc->Challenge, disc->KeyCheck);
X
X _CSSPrintDebugBytes ("Received Session Key\n", &disc->KeyCheck[0], LEN_KEY);
X
X@@ -445,6 +599,7 @@
X {
X dvd_struct dvd;
X
X+#ifndef __FreeBSD__
X dvd.copyright.type = DVD_STRUCT_COPYRIGHT;
X dvd.copyright.layer_num = 0;
X
X@@ -454,4 +609,15 @@
X }
X
X return dvd.copyright.cpst; // 0 ... not encrypted
X+#else
X+ dvd.format = DVD_STRUCT_COPYRIGHT;
X+ dvd.layer_num = 0;
X+
X+ if (ioctl( fd, DVDIOCREADSTRUCTURE, &dvd) < 0) {
X+ _CSSPrintDebug ("error using ioctl DVDIOCREADSTRUCTURE\n");
X+ return -1;
X+ }
X+
X+ return dvd.cpst; // 0 ... not encrypted
X+#endif
X }
END-of-libcss/files/patch-ac
echo x - libcss/files/patch-ad
sed 's/^X//' >libcss/files/patch-ad << 'END-of-libcss/files/patch-ad'
X--- src/css_cat.c.orig Tue Feb 13 16:59:27 2001
X+++ src/css_cat.c Wed Jun 20 16:33:24 2001
X@@ -208,7 +208,9 @@
X *
X */
X
X+#ifdef __linux__
X #include <linux/fs.h>
X+#endif
X
X int path_to_lba (char *p)
X {
X@@ -219,8 +221,13 @@
X return -1;
X }
X
X+#ifndef __FreeBSD__
X if (ioctl(fd, FIBMAP, &lba) < 0) {
X perror ("ioctl FIBMAP");
X+#else
X+ if (ioctl(fd, FIOGETLBA, &lba) < 0) {
X+ perror ("ioctl FIOGETLBA");
X+#endif
X close(fd);
X return -1;
X }
X@@ -252,6 +259,14 @@
X goto clean_up;
X }
X #endif
X+
X+#ifdef __FreeBSD__
X+ if (!strcmp( argv[argi], "-")) {
X+ argv[argi] = (char *)malloc( strlen( "/dev/stdin") + 1);
X+ strcpy( argv[argi], "/dev/stdin");
X+ }
X+#endif
X+
X if ((fd = open (argv[argi], O_RDONLY)) == -1) {
X perror ("can't open DVD");
X goto clean_up;
END-of-libcss/files/patch-ad
echo x - libcss/files/patch-ae
sed 's/^X//' >libcss/files/patch-ae << 'END-of-libcss/files/patch-ae'
X--- src/dvdinfo.c.orig Tue Feb 13 16:59:27 2001
X+++ src/dvdinfo.c Wed Jun 20 16:59:24 2001
X@@ -27,7 +27,7 @@
X #include <stdlib.h>
X #include <fcntl.h>
X #include <string.h>
X-#if defined(__NetBSD__) || defined(__OpenBSD__)
X+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X # include <sys/dvdio.h>
X #elif defined(__linux__)
X # include <linux/cdrom.h>
X@@ -39,6 +39,10 @@
X
X #include "css.h"
X
X+#ifdef __FreeBSD__
X+typedef struct dvd_struct dvd_struct;
X+#endif
X+
X #define DVD "/dev/cdrom"
X
X /**
X@@ -52,6 +56,7 @@
X int i;
X int layers = 4;
X
X+#ifndef __FreeBSD__
X d.physical.type = DVD_STRUCT_PHYSICAL;
X for (i=0; i<layers; i++) {
X d.physical.layer_num = i;
X@@ -62,12 +67,28 @@
X }
X
X layer = &d.physical.layer[i];
X+#else
X+ d.format = DVD_STRUCT_PHYSICAL;
X+ memset( d.data, 0, 2048);
X+ for (i=0; i<layers; i++) {
X+ d.layer_num = i;
X+ if (ioctl (fd, DVDIOCREADSTRUCTURE, &d)<0) {
X+ fprintf (stderr, "Could not read Physical layer %d\n", i);
X+ return 0;
X+ }
X+
X+ layer = (struct dvd_layer *)(&(d.data[i*sizeof(struct dvd_layer)]));
X+#endif
X layers = layer->nlayers + 1;
X
X printf ("Layer %d[%d]\n", i, layers);
X printf (" Book Version: %d\n", layer->book_version);
X printf (" Book Type: %d\n", layer->book_type);
X+#ifndef __FreeBSD__
X printf (" Min Rate: %d\n", layer->min_rate);
X+#else
X+ printf (" Max Rate: %d\n", layer->max_rate);
X+#endif
X printf (" Disc Size: %d\n", layer->disc_size);
X printf (" Layer Type: %d\n", layer->layer_type);
X printf (" Track Path: %d\n", layer->track_path);
X@@ -92,6 +113,7 @@
X {
X dvd_struct d;
X
X+#ifndef __FreeBSD__
X d.copyright.type = DVD_STRUCT_COPYRIGHT;
X d.copyright.layer_num = 0;
X
X@@ -101,6 +123,17 @@
X }
X
X printf ("Copyright: CPST=%d, RMI=%#02x\n", d.copyright.cpst, d.copyright.rmi);
X+#else
X+ d.format = DVD_STRUCT_COPYRIGHT;
X+ d.layer_num = 0;
X+
X+ if (ioctl(fd, DVDIOCREADSTRUCTURE, &d)<0) {
X+ fprintf (stderr, "Could not read Copyright Struct\n");
X+ return 0;
X+ }
X+
X+ printf ("Copyright: CPST=%d, RMI=%#02x\n", d.cpst, d.rmi);
X+#endif
X
X return 1;
X }
X@@ -114,6 +147,7 @@
X {
X dvd_struct dvd;
X
X+#ifndef __FreeBSD__
X dvd.copyright.type = DVD_STRUCT_COPYRIGHT;
X dvd.copyright.layer_num = 0;
X
X@@ -125,6 +159,19 @@
X printf ("Disc is %s\n", dvd.copyright.cpst ? "encrypted." : "NOT encrypted at all - no need to use CSS!!!");
X
X return dvd.copyright.cpst;
X+#else
X+ dvd.format = DVD_STRUCT_COPYRIGHT;
X+ dvd.layer_num = 0;
X+
X+ if (ioctl (fd, DVDIOCREADSTRUCTURE, &dvd) < 0) {
X+ perror ("DVDIOCREADSTRUCTURE");
X+ return -1;
X+ }
X+
X+ printf( "Disc is %s\n", dvd.cpst ? "encrypted." : "NOT encrypted at all - no need to use CSS!!!");
X+
X+ return dvd.cpst;
X+#endif
X }
X
X
END-of-libcss/files/patch-ae
echo x - libcss/files/patch-af
sed 's/^X//' >libcss/files/patch-af << 'END-of-libcss/files/patch-af'
X--- src/reset_dvd.c.orig Tue Feb 13 16:59:27 2001
X+++ src/reset_dvd.c Wed Jun 20 16:59:38 2001
X@@ -25,7 +25,7 @@
X #include <stdio.h>
X #include <string.h>
X #include <fcntl.h>
X-#if defined(__NetBSD__) || defined(__OpenBSD__)
X+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X # include <sys/dvdio.h>
X #elif defined(__linux__)
X # include <linux/cdrom.h>
X@@ -37,6 +37,10 @@
X
X static int fd;
X
X+#ifdef __FreeBSD__
X+typedef struct dvd_authinfo dvd_authinfo;
X+#endif
X+
X #define DVD "/dev/cdrom"
X
X int main (int ac, char **av)
X@@ -57,9 +61,15 @@
X
X for (i = 0; i < 4; i++) {
X memset(&ai, 0, sizeof(ai));
X+#ifndef __FreeBSD__
X ai.type = DVD_INVALIDATE_AGID;
X ai.lsa.agid = i;
X ioctl(fd, DVD_AUTH, &ai);
X+#else
X+ ai.format = DVD_INVALIDATE_AGID;
X+ ai.agid = i;
X+ ioctl(fd, DVDIOCREPORTKEY, &ai);
X+#endif
X }
X
X return 0;
END-of-libcss/files/patch-af
echo x - libcss/files/patches-ah
sed 's/^X//' >libcss/files/patches-ah << 'END-of-libcss/files/patches-ah'
X--- m4/dvd.m4.orig Thu Nov 23 17:21:22 2000
X+++ m4/dvd.m4 Wed Jun 20 16:33:24 2001
X@@ -42,7 +42,7 @@
X CFLAGS="$CFLAGS -I$KERNEL_INCLUDES"
X
X AC_TRY_COMPILE([
X- #if defined(__NetBSD__) || defined(__OpenBSD__)
X+ #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
X # include <sys/dvdio.h>
X #elif defined(__linux__)
X # include <sys/types.h>
END-of-libcss/files/patches-ah
echo x - libcss/distinfo
sed 's/^X//' >libcss/distinfo << 'END-of-libcss/distinfo'
XMD5 (libcss-0.1.0.tar.gz) = f328077f56f690d0136a106080c359df
END-of-libcss/distinfo
echo x - libcss/pkg-comment
sed 's/^X//' >libcss/pkg-comment << 'END-of-libcss/pkg-comment'
XLibrary to brute force decrypt dvd videos
END-of-libcss/pkg-comment
echo x - libcss/Makefile
sed 's/^X//' >libcss/Makefile << 'END-of-libcss/Makefile'
X# New ports collection makefile for: libcss
X# Date created: 20 June 2001
X# Whom:
X#
X# $FreeBSD$
X#
X
XPORTNAME= libcss
XPORTVERSION= 0.1.0
XCATEGORIES= graphics
XMASTER_SITES= http://www.linuxvideo.org/oms/data/
X
XMAINTAINER= James_Bond_79@yahoo.com
X
XINSTALLS_SHLIB= yes
X
XGNU_CONFIGURE= yes
XUSE_GMAKE= yes
X
XBUILD_DEPENDS= automake:${PORTSDIR}/devel/autoconf
X
Xpre-configure:
X @cd ${WRKSRC} && automake
X
X.include <bsd.port.mk>
END-of-libcss/Makefile
exit
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01062507500001.00449>
