Joerg Schilling wrote:
From: Meino Christian Cramer <Meino.Cramer@gmx.de>
The problem is, that the compilation process done by the makefile
system of cdrecord does not break hard on compilation errors.
The compilation error was in line 69 of ./libscg/scsi-linux-sg.c.
It does a #include <scsi/scsi.h>, which let the source include
/usr/src/linux/include/scsi/scsi.h.
If line 69 of the offending code will be changed to
#include "/usr/include/scsi/scsi.h" the non-kernel header file
will be included and everything works well.
Note that libscg needs to include recent kernel include files
in order to be able to support recent kernel SCSI transport
interfaces.
The problem you observe is caused by broken Linux kernel include files.
Send a bug report to the Linux Kernel folks.
Unfortumately, the Linux kernel people don't understand this and
refuse to fix the inconsistensistencies in their code.
Wrong. You do not understand the documentation which says not to
include kernel files. There is no magic which makes /usr/src/linux
point to source for the running kernel, or in fact any kernel
source. You have made unwarranted assumptions about what will be found
at that point, based on how you have your own system configured, no
doubt.
I understand that you might want to have some 2.6 header information,
but the only safe way to do this is to include the few you need
in your own source, making the installation of current kernel source a
requirement to run the make is not the best solution.
This one is not a Linux problem, it's a problem that Linux does work
the way you wish it would, your system is not the standard to which all
others are configured, and you made incorrect assumptions. Given a
choice of having a half-GB of source I don't want in a place I don't
want it, or doing without -scanbus, I'll live without it.
Oh, and did I see a mention of /dev/hd/* somewhere in your previous
posting? I sure hope you aren't assuming that the devfs will be in
use, given that it's both optional and depreciated (marked as OBSOLETE).
Let me explain it to you. There are three types of interfaces, you can see in
libc and /usr/include/*:
1) Interfaces that are fully created by libc, such as strcpy()
2) Interfaces that are defined by the kernel but propagated by libc.
Interfaces of this type are things similar to open()/read()/write(),..
3) Interfaces that libc is not even aware of (like ioctl() functions).
If major()/minor()/makedev() are CPP macros and not functions in libc,
then they are part of this group of interfaces.
Interfaces of type 1) are independent from the kernel and for this reason,
the statements from Linus on how (from his belief) include files should be
treatened apply _only_ to these interfaces.
To allow an application to match the interface, you need an include file that
is published by the same instance or person who does work on libc.
Interfaces of type 2) require that libc and the kernel version match. This
means, that you need to recompile and in some cases even to modify the libc
sources in order to get a working complete system every time the kernel
interface (used by libc) changes. This is needed to keep the upper level
interface from libc stable.
Interfaces of type 3) are independent of libc!
Any application that likes to use them, _needs_ to use the include files from
the kernel they are going to be run on. This is the only way, to make sure
that the user level application uses an interface that matches the adjacent
interface from the kernel. If you use different include files, you are unable
to even test the kernel interface. For this reason, it is important that all
include files from the kernel (that define interfaces that are visible from
user land) are written in a way that allows a consistent usage from a user
land application (which does never #define __KERNEL or similar).
Cdrecord is definitely a user land application that needs to be compiled with
the include files from the current kernel - otherwise it could not e.g. use
new features from SCSI drivers inside the kernel.
Star with respect to device major/minor handling is another one.
--
E. Robert Bogusta
It seemed like a good idea at the time
|