Re: Linux Kernel bug report (includes fix)

From: Jim Gifford
Date: Tue Aug 10 2004 - 11:47:15 EST


There is a simple fix to your problem, I have sent this patch to you a few times, but never got an answer.

I bet eveyone here will agree, this is the proper way to fix the issue

diff -Naur cdrtools-2.01.orig/DEFAULTS/Defaults.gnu cdrtools-2.01/DEFAULTS/Defaults.gnu
--- cdrtools-2.01.orig/DEFAULTS/Defaults.gnu 2003-02-16 00:01:47.000000000 +0000
+++ cdrtools-2.01/DEFAULTS/Defaults.gnu 2004-05-07 00:52:58.111410726 +0000
@@ -18,7 +18,7 @@
###########################################################################
CWARNOPTS=

-DEFINCDIRS= $(SRCROOT)/include /usr/src/linux/include
+DEFINCDIRS= $(SRCROOT)/include
LDPATH= -L/opt/schily/lib
RUNPATH= -R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR)

diff -Naur cdrtools-2.01.orig/DEFAULTS/Defaults.linux cdrtools-2.01/DEFAULTS/Defaults.linux
--- cdrtools-2.01.orig/DEFAULTS/Defaults.linux 2003-02-16 00:01:48.000000000 +0000
+++ cdrtools-2.01/DEFAULTS/Defaults.linux 2004-05-07 00:53:05.850026970 +0000
@@ -18,7 +18,7 @@
###########################################################################
CWARNOPTS=

-DEFINCDIRS= $(SRCROOT)/include /usr/src/linux/include
+DEFINCDIRS= $(SRCROOT)/include
LDPATH= -L/opt/schily/lib
RUNPATH= -R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR)

diff -Naur cdrtools-2.01.orig/libscg/scsi-linux-sg.c cdrtools-2.01/libscg/scsi-linux-sg.c
--- cdrtools-2.01.orig/libscg/scsi-linux-sg.c 2004-04-18 10:26:44.000000000 +0000
+++ cdrtools-2.01/libscg/scsi-linux-sg.c 2004-05-07 00:52:47.953227014 +0000
@@ -65,6 +65,14 @@

#if LINUX_VERSION_CODE >= 0x01031a /* <linux/scsi.h> introduced in 1.3.26 */
#if LINUX_VERSION_CODE >= 0x020000 /* <scsi/scsi.h> introduced somewhere. */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+ #define __KERNEL__
+ #include <asm/types.h>
+ #include <asm/byteorder.h>
+ #undef __KERNEL__
+#endif
+
/* Need to fine tune the ifdef so we get the transition point right. */
#include <scsi/scsi.h>
#else

--
----
Jim Gifford
maillist@xxxxxxxxx

Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
Date: 2004-05-06
Initial Package Version: 2.01
Origin: Jim Gifford and http://kerneltrap.org/node/view/879
Upstream Status: Sent
Description: Fixes CDRTools Compile with the 2.6 Kernel


diff -Naur cdrtools-2.01.orig/DEFAULTS/Defaults.gnu cdrtools-2.01/DEFAULTS/Defaults.gnu
--- cdrtools-2.01.orig/DEFAULTS/Defaults.gnu 2003-02-16 00:01:47.000000000 +0000
+++ cdrtools-2.01/DEFAULTS/Defaults.gnu 2004-05-07 00:52:58.111410726 +0000
@@ -18,7 +18,7 @@
###########################################################################
CWARNOPTS=

-DEFINCDIRS= $(SRCROOT)/include /usr/src/linux/include
+DEFINCDIRS= $(SRCROOT)/include
LDPATH= -L/opt/schily/lib
RUNPATH= -R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR)

diff -Naur cdrtools-2.01.orig/DEFAULTS/Defaults.linux cdrtools-2.01/DEFAULTS/Defaults.linux
--- cdrtools-2.01.orig/DEFAULTS/Defaults.linux 2003-02-16 00:01:48.000000000 +0000
+++ cdrtools-2.01/DEFAULTS/Defaults.linux 2004-05-07 00:53:05.850026970 +0000
@@ -18,7 +18,7 @@
###########################################################################
CWARNOPTS=

-DEFINCDIRS= $(SRCROOT)/include /usr/src/linux/include
+DEFINCDIRS= $(SRCROOT)/include
LDPATH= -L/opt/schily/lib
RUNPATH= -R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR)

diff -Naur cdrtools-2.01.orig/libscg/scsi-linux-sg.c cdrtools-2.01/libscg/scsi-linux-sg.c
--- cdrtools-2.01.orig/libscg/scsi-linux-sg.c 2004-04-18 10:26:44.000000000 +0000
+++ cdrtools-2.01/libscg/scsi-linux-sg.c 2004-05-07 00:52:47.953227014 +0000
@@ -65,6 +65,14 @@

#if LINUX_VERSION_CODE >= 0x01031a /* <linux/scsi.h> introduced in 1.3.26 */
#if LINUX_VERSION_CODE >= 0x020000 /* <scsi/scsi.h> introduced somewhere. */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+ #define __KERNEL__
+ #include <asm/types.h>
+ #include <asm/byteorder.h>
+ #undef __KERNEL__
+#endif
+
/* Need to fine tune the ifdef so we get the transition point right. */
#include <scsi/scsi.h>
#else