[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: DMODVERSIONS causing a lot of problems



On Thu, 16 Nov 2000 at 13:42:52 +0100, robert_wilhelm_land wrote:
> Colin wrote:
> 
> > >make install AUCHIP=AU8820
> > >make[1]: Entering directory `/root/drivers/sound/aureal'
> >                               ^^^^^^^^^^^^^^^^^^^^^^^^^^
> > >cc -D__KERNEL__  -DMODULE -DAU8820 -mpentium  -O6 -fomit-frame-pointer
> > >-Wall -pipe -I/usr/src/linux/include   -c -o au_audio.o au_audio.c
> >                ^^^^^^^^^^^^^^^^^^^^^^
> > >In file included from au_audio.c:49:
> > >au_vortex.h:55: linux/modversions.h: No such file or directory
> > >
> > >
> > >Where does the routine look for the header,
> > 
> > Wherever the C compiler is looking for include files; specifically,
> > here, /usr/src/linux/include.
> > 
> > I've underlined two paths above which ought to be in similar places but
> > aren't. Are you doing something odd with symlinks?
> 
> Thanks for your helpful message Colin!

No problem - I hope this one solves your problem. :)

> I untarred the aureal driver package into /root/drivers/sound because
> this package has a own makefile (supposing to have a built in module
> installation routine) which would collidate with the makefile in..
> /usr/src/...<kernel>../drivers/sound/

Ah, I understand now. Sorry for the confusion.

> ... and by thinking every system adjustment should only be done by
> root. 

Well, you're mostly right. The install phase certainly does have to be
done by root, but the compilation can be done by an ordinary user (and
the general rule is that, if you can do something without extra
privileges, you should). Looking at the Makefile you attached, of
course, the compile step is just one instruction, so here you're OK just
following their instructions and doing 'make install20' as root.

> Now what you suggested below (quoted) is absolutely new for me which
> isn't that surprising because I'm really not that experienced in
> administrating linux/unix.

> This log :
> > >-Wall -pipe -I/usr/src/linux/include   -c -o au_audio.o au_audio.c
> >                ^^^^^^^^^^^^^^^^^^^^^^
> ...seems to have it's roots in the variable INCLUDEDIRS which I have
> just found in the aureal makefile (attached to this message). I guess
> I was too tired yesterday to notice it.
> 
> The kernel src is located at /usr/src/linux/xxx-2.2.17....

Oh - in that case, you'll need to change INCLUDEDIRS to
/usr/src/linux/xxx-2.2.17/include, or whatever. As a sanity check, then,
make sure that /usr/src/linux/xxx-2.2.17/include/linux/modversions.h
exists. (There should really be a comment in the Makefile saying that
you might have to change that variable depending on where your kernel
source is.)

FYI, the setup a lot of people use (and which the aureal Makefile
evidently expects) is more like /usr/src/linux being a symlink to the
"current" kernel source tree, which is in /usr/src/linux-2.2.17 (etc.).
Alternatively, many people choose to build kernels in their home
directories.

> ..and:
> > >In file included from au_audio.c:49:
> > >au_vortex.h:55: linux/modversions.h: No such file or directory
> ... I guess I have to cp modversions.h to the /usr/src/linux/ dir?
> puh... what a work!

No, you shouldn't have to do that. :) If you do, you'll probably just
find that the next thing that looks for an include file will break.
INCLUDEDIRS is the real place to fix it.

One thing that confused me for a moment was why <linux/modversions.h>
was the first thing to fail. After all, other files like
<linux/config.h> are included from au_vortex.h before that. The answer's
simple enough; gcc automatically looks in certain system directories for
header files, one of which is /usr/include - and
/usr/include/linux/config.h exists, but /usr/include/linux/modversions.h
doesn't. This is fine, because the -I option causes the C compiler to go
off and look in the kernel source tree first, as long as it's set to the
right place.

> > Also, you really shouldn't be building kernels as root if you can avoid
> > it. Only the installation step requires root access, so keeping kernels
> > in /root - and keeping them in /root itself rather than a subdirectory
> > such as /root/linux is even odder! - is usually not the thing to do.
> 
> No, no, - the kernel source is installed as mentioned above, only the
> aureal package is installed in /root  (as mentioned at the top of this
> message).

Ah, I misunderstood. Add-on kernel modules can often be a little fiddly,
due to the wide variety of places where people put their kernel source
trees.

> CONF   = $(wildcard /etc/modules.conf)
[...]
> install: compile
> 	 mv -f $(CONF) $(CONF).old
> 	 gawk -f mod_conf $(CONF).old > $(CONF)
> 	 echo "alias sound $(NAME)" >> $(CONF)
> 	 echo "alias midi $(NAME)" >> $(CONF)

Beware; this probably won't play nicely with Debian, because our
/etc/modules.conf isn't intended to be altered directly. What you
probably want to do is set the CONF line above to somewhere like
/etc/modutils/aliases, and then insert 'update-modules' after the last
line I quoted here (at the same indentation level as the other command
lines, to keep make happy). That way, your changes to your module
configuration will be preserved.

Regards,

-- 
Colin Watson                                     [cjw44@flatline.org.uk]



Reply to: