Discussion:
[wish-info] compile X10 1.6.12 driver on Redhat Linux kernel 2.4.18-3
Hong Hsu
2003-05-06 01:17:47 UTC
Permalink
Scott,

Thanks you for your Linux X10 device driver which I am looking for long
time. There are several questions I would like to ask as I got
compilation error.

I have Redhat Linux kernel 2.4.18-3 running on Athlon XP processor. I
read wish web page carefully, then
#ln -s /usr/src/linux-2.4.18-3 /usr/src/linux
#make mrproper
it seems ok. But one question is if I intend to compile standalone
x10 drivers, do I have to remove all files under
/usr/src/linux/include/linux/modules/ ?

#make symlinks
it seems ok

#make dep
it doesn't seem done anything:
[***@puma linux-2.4.18-3]# make dep
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o scripts/mkdep
scripts/mkdep.c
make[1]: Entering directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make[1]: Nothing to be done for `dep'.
make[1]: Leaving directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make: *** No rule to make target `include/linux/autoconf.h', needed by
`include/linux/version.h'. Stop.
[***@puma linux-2.4.18-3]#

At this point, I copied original .config back to top level directory of
kernel source tree.
Am I wrong here as in configs directory there are several files, such as
kernel-2.4.18-i686.config and kernel-2.4.18-athlon.config. If I
shouldn't use original .config file, then which config file I should use?

#make
this gave me error on modversions.h and autoconf.h:
[***@puma wish-1.6.2]# make
/usr/src/linux/scripts/mkdep -- *.c > .depend
/usr/src/linux/scripts/mkdep -- *.h > .hdepend
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer
-DMODULE -DMODVERSIONS -include
/usr/src/linux/include/linux/modversions.h -nostdinc -iwithprefix
include -pipe -mpreferred-stack-boundary=2 -march=i686
-DKBUILD_BASENAME=x10_core -c -o x10_core.o x10_core.c
x10_core.c:1:24: /usr/src/linux/include/linux/modversions.h: No such
file or directory
In file included from x10_core.c:46:
/usr/src/linux/include/linux/config.h:4:28: linux/autoconf.h: No such
file or directory
In file included from /usr/src/linux/include/linux/prefetch.h:13,
from /usr/src/linux/include/linux/list.h:6,
from /usr/src/linux/include/linux/module.h:12,
from x10_core.c:53:
/usr/src/linux/include/asm/processor.h:56: `CONFIG_X86_L1_CACHE_SHIFT'
undeclared here (not in a function)
/usr/src/linux/include/asm/processor.h:56: requested alignment is not a
constant
In file included from x10_core.c:53:
/usr/src/linux/include/linux/module.h:297:27: linux/version.h: No such
file or directory
In file included from x10_core.c:53:
/usr/src/linux/include/linux/module.h:299: parse error before `UTS_RELEASE'
x10_core.c:67:27: linux/version.h: No such file or directory
make: *** [x10_core.o] Error 1
[***@puma wish-1.6.2]#

Would you give a hint where may be wrong becuase I don't know which step
I did is not right.

Last queston is how can I verify my system has DEVFS. As I saw the
CONFIG_DEVFS_FS=y does defined in .config, but I do not saw devfsd is
running.

Your response will be appreciated,
-Hong
--
<Linux kernel:>< As a computer I find your faith in technology amusing.
Scott Hiles
2003-05-06 02:56:20 UTC
Permalink
I think the step that messed things up is the "make mrproper" step. If you
have the source file from a RedHat distribution, you don't have everything
you need to let mrproper and symlinks recreate everything. If you have a
kernel source from linux.org, mrproper and symlinks will work.

To remedy this, Save your .config file and reinstall the kernel source.
Then put your config file back in place, run "make dep", and you can
continue from there.

If CONFIG_DEVFS_FS=y is defined, the kernel is capable of running DEVFS but
if devfsd is not running, then your system will behave as if DEVFS was not
defined. However, many of the drivers will expect DEVFS and may misbehave.
WiSH will definitely have problems. So, if you aren't going to use DEVFS,
turn off DEVFS in the configuration.

For your RedHat distribution, if you look in the configs directory you will
have a number of configurations that match the kernel distributions. Choose
the one that matches your processor. So, for your Athlon, you would select
kernel-2.4.18-athlon.config for the .config. That will match the kernel
that was distributed from Redhat matching your source. Now, if you are
running from a modified kernel (you compiled it and installed it) you need
the .config that matches the one that you have running.

OK...I think I answered your questions but if I missed one, let me know.

Summary:
1) reinstall the kernel source code from the .rpm
2) copy configs/kernel-2.4.18-athlon.config to .config in the top level
kernel source tree
3) run "make dep"
4) Now compile the drivers as standalone

I will modify the documentation to tell you to only use mrproper when
running with a complete source distribution.

Scott
-----Original Message-----
Sent: Monday, May 05, 2003 9:18 PM
Subject: compile X10 1.6.12 driver on Redhat Linux kernel 2.4.18-3
Scott,
Thanks you for your Linux X10 device driver which I am
looking for long
time. There are several questions I would like to ask as I got
compilation error.
I have Redhat Linux kernel 2.4.18-3 running on Athlon XP
processor. I
read wish web page carefully, then
#ln -s /usr/src/linux-2.4.18-3 /usr/src/linux
#make mrproper
it seems ok. But one question is if I intend to compile standalone
x10 drivers, do I have to remove all files under
/usr/src/linux/include/linux/modules/ ?
#make symlinks
it seems ok
#make dep
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o
scripts/mkdep
scripts/mkdep.c
make[1]: Entering directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make[1]: Nothing to be done for `dep'.
make[1]: Leaving directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make: *** No rule to make target `include/linux/autoconf.h',
needed by
`include/linux/version.h'. Stop.
At this point, I copied original .config back to top level
directory of
kernel source tree.
Am I wrong here as in configs directory there are several
files, such as
kernel-2.4.18-i686.config and kernel-2.4.18-athlon.config. If I
shouldn't use original .config file, then which config file I
should use?
#make
/usr/src/linux/scripts/mkdep -- *.c > .depend
/usr/src/linux/scripts/mkdep -- *.h > .hdepend gcc
-D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer
-DMODULE -DMODVERSIONS -include
/usr/src/linux/include/linux/modversions.h -nostdinc -iwithprefix
include -pipe -mpreferred-stack-boundary=2 -march=i686
-DKBUILD_BASENAME=x10_core -c -o x10_core.o x10_core.c
x10_core.c:1:24: /usr/src/linux/include/linux/modversions.h: No such
file or directory
/usr/src/linux/include/linux/config.h:4:28: linux/autoconf.h: No such
file or directory
In file included from /usr/src/linux/include/linux/prefetch.h:13,
from /usr/src/linux/include/linux/list.h:6,
from /usr/src/linux/include/linux/module.h:12,
`CONFIG_X86_L1_CACHE_SHIFT'
undeclared here (not in a function)
/usr/src/linux/include/asm/processor.h:56: requested
alignment is not a
constant
linux/version.h: No such
file or directory
/usr/src/linux/include/linux/module.h:299: parse error before
`UTS_RELEASE'
x10_core.c:67:27: linux/version.h: No such file or directory
make: *** [x10_core.o] Error 1
Would you give a hint where may be wrong becuase I don't know
which step
I did is not right.
Last queston is how can I verify my system has DEVFS. As I saw the
CONFIG_DEVFS_FS=y does defined in .config, but I do not saw devfsd is
running.
Your response will be appreciated,
-Hong
--
<Linux kernel:>< As a computer I find your faith in
technology amusing.
Hong Hsu
2003-05-06 15:56:48 UTC
Permalink
Scott,

Appreciate your quick response. You commented I do not have
everything and advise me to reinstall the kernel source code. Since
there are two kernel rpm files:
kernel-source-2.4.18-3.i386.rpm which has all .c files and
kernel-2.4.18-3.src.rpm which contains config and patch files. I am not
sure wihch one should be reinstalled. Here is what I did:
#rpm -ivh kernel-source-2.4.18-3.rpm
it reports kernel-source already installed.

#cp kernel-2.4.18-3-athlon.config ../.config
#make dep
Got same message as previous. The execution 'make dep' still doesn't do
any thing at this point

[wish-1.6.2]#make
I got same error as previous of no finding modversions.h and autoconf.h

What could cause not find these header files, the .config or WiSH's
Makefile? How could I fix it?

Thank you again,
-Hong
Post by Scott Hiles
I think the step that messed things up is the "make mrproper" step. If you
have the source file from a RedHat distribution, you don't have everything
you need to let mrproper and symlinks recreate everything. If you have a
kernel source from linux.org, mrproper and symlinks will work.
To remedy this, Save your .config file and reinstall the kernel source.
Then put your config file back in place, run "make dep", and you can
continue from there.
If CONFIG_DEVFS_FS=y is defined, the kernel is capable of running DEVFS but
if devfsd is not running, then your system will behave as if DEVFS was not
defined. However, many of the drivers will expect DEVFS and may misbehave.
WiSH will definitely have problems. So, if you aren't going to use DEVFS,
turn off DEVFS in the configuration.
For your RedHat distribution, if you look in the configs directory you will
have a number of configurations that match the kernel distributions. Choose
the one that matches your processor. So, for your Athlon, you would select
kernel-2.4.18-athlon.config for the .config. That will match the kernel
that was distributed from Redhat matching your source. Now, if you are
running from a modified kernel (you compiled it and installed it) you need
the .config that matches the one that you have running.
OK...I think I answered your questions but if I missed one, let me know.
1) reinstall the kernel source code from the .rpm
2) copy configs/kernel-2.4.18-athlon.config to .config in the top level
kernel source tree
3) run "make dep"
4) Now compile the drivers as standalone
I will modify the documentation to tell you to only use mrproper when
running with a complete source distribution.
Scott
-----Original Message-----
Sent: Monday, May 05, 2003 9:18 PM
Subject: compile X10 1.6.12 driver on Redhat Linux kernel 2.4.18-3
Scott,
Thanks you for your Linux X10 device driver which I am
looking for long
time. There are several questions I would like to ask as I got
compilation error.
I have Redhat Linux kernel 2.4.18-3 running on Athlon XP
processor. I
read wish web page carefully, then
#ln -s /usr/src/linux-2.4.18-3 /usr/src/linux
#make mrproper
it seems ok. But one question is if I intend to compile standalone
x10 drivers, do I have to remove all files under
/usr/src/linux/include/linux/modules/ ?
#make symlinks
it seems ok
#make dep
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o
scripts/mkdep
scripts/mkdep.c
make[1]: Entering directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make[1]: Nothing to be done for `dep'.
make[1]: Leaving directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make: *** No rule to make target `include/linux/autoconf.h',
needed by
`include/linux/version.h'. Stop.
At this point, I copied original .config back to top level
directory of
kernel source tree.
Am I wrong here as in configs directory there are several
files, such as
kernel-2.4.18-i686.config and kernel-2.4.18-athlon.config. If I
shouldn't use original .config file, then which config file I
should use?
#make
/usr/src/linux/scripts/mkdep -- *.c > .depend
/usr/src/linux/scripts/mkdep -- *.h > .hdepend gcc
-D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer
-DMODULE -DMODVERSIONS -include
/usr/src/linux/include/linux/modversions.h -nostdinc -iwithprefix
include -pipe -mpreferred-stack-boundary=2 -march=i686
-DKBUILD_BASENAME=x10_core -c -o x10_core.o x10_core.c
x10_core.c:1:24: /usr/src/linux/include/linux/modversions.h: No such
file or directory
/usr/src/linux/include/linux/config.h:4:28: linux/autoconf.h: No such
file or directory
In file included from /usr/src/linux/include/linux/prefetch.h:13,
from /usr/src/linux/include/linux/list.h:6,
from /usr/src/linux/include/linux/module.h:12,
`CONFIG_X86_L1_CACHE_SHIFT'
undeclared here (not in a function)
/usr/src/linux/include/asm/processor.h:56: requested
alignment is not a
constant
linux/version.h: No such
file or directory
/usr/src/linux/include/linux/module.h:299: parse error before
`UTS_RELEASE'
x10_core.c:67:27: linux/version.h: No such file or directory
make: *** [x10_core.o] Error 1
Would you give a hint where may be wrong becuase I don't know
which step
I did is not right.
Last queston is how can I verify my system has DEVFS. As I saw the
CONFIG_DEVFS_FS=y does defined in .config, but I do not saw devfsd is
running.
Your response will be appreciated,
-Hong
Scott Hiles
2003-05-06 17:04:36 UTC
Permalink
Kernel-source-2.4.18-3.i386.rpm is the installable working kernel...and not
the one you need. Kernel-2.4.18-3.src.rpm is the source tree that you need
to install. To install it use the --force option. Another option is for
you to remove the source with "rpm -e kernel-2.4.18-3" and then install
again with "rpm -I kernel-2.4.18-3.src.rpm". I think those options are
correct. Read the rpm man page to make sure that I got those right from
memory.

You have to successfully get the kernel source installed before you can
proceed. Getting the message "kernel-source already installed" indicates
that it did not reinstall the source tree.

Scott
-----Original Message-----
Sent: Tuesday, May 06, 2003 11:57 AM
To: Scott Hiles
Subject: Re: compile X10 1.6.12 driver on Redhat Linux kernel 2.4.18-3
Scott,
Appreciate your quick response. You commented I do not have
everything and advise me to reinstall the kernel source code. Since
kernel-source-2.4.18-3.i386.rpm which has all .c files and
kernel-2.4.18-3.src.rpm which contains config and patch
files. I am not
#rpm -ivh kernel-source-2.4.18-3.rpm
it reports kernel-source already installed.
#cp kernel-2.4.18-3-athlon.config ../.config
#make dep
Got same message as previous. The execution 'make dep' still
doesn't do
any thing at this point
[wish-1.6.2]#make
I got same error as previous of no finding modversions.h and
autoconf.h
What could cause not find these header files, the .config or WiSH's
Makefile? How could I fix it?
Thank you again,
-Hong
Post by Scott Hiles
I think the step that messed things up is the "make
mrproper" step. If
Post by Scott Hiles
you have the source file from a RedHat distribution, you don't have
everything you need to let mrproper and symlinks recreate
everything.
Post by Scott Hiles
If you have a kernel source from linux.org, mrproper and
symlinks will
Post by Scott Hiles
work.
To remedy this, Save your .config file and reinstall the
kernel source.
Post by Scott Hiles
Then put your config file back in place, run "make dep", and you can
continue from there.
If CONFIG_DEVFS_FS=y is defined, the kernel is capable of
running DEVFS
Post by Scott Hiles
but if devfsd is not running, then your system will behave
as if DEVFS
Post by Scott Hiles
was not defined. However, many of the drivers will expect DEVFS and
may misbehave. WiSH will definitely have problems. So, if
you aren't
Post by Scott Hiles
going to use DEVFS, turn off DEVFS in the configuration.
For your RedHat distribution, if you look in the configs
directory you
Post by Scott Hiles
will have a number of configurations that match the kernel
distributions. Choose the one that matches your processor. So, for
your Athlon, you would select kernel-2.4.18-athlon.config for the
.config. That will match the kernel that was distributed
from Redhat
Post by Scott Hiles
matching your source. Now, if you are running from a
modified kernel
Post by Scott Hiles
(you compiled it and installed it) you need the .config that
matches the one that you have running.
Post by Scott Hiles
OK...I think I answered your questions but if I missed one, let me
know.
1) reinstall the kernel source code from the .rpm
2) copy configs/kernel-2.4.18-athlon.config to .config in the top
level kernel source tree
3) run "make dep"
4) Now compile the drivers as standalone
I will modify the documentation to tell you to only use
mrproper when
Post by Scott Hiles
running with a complete source distribution.
Scott
-----Original Message-----
Sent: Monday, May 05, 2003 9:18 PM
Subject: compile X10 1.6.12 driver on Redhat Linux kernel 2.4.18-3
Scott,
Thanks you for your Linux X10 device driver which I am
looking for long
time. There are several questions I would like to ask as I got
compilation error.
I have Redhat Linux kernel 2.4.18-3 running on Athlon XP
processor. I
read wish web page carefully, then
#ln -s /usr/src/linux-2.4.18-3 /usr/src/linux
#make mrproper
it seems ok. But one question is if I intend to compile
standalone
Post by Scott Hiles
x10 drivers, do I have to remove all files under
/usr/src/linux/include/linux/modules/ ?
#make symlinks
it seems ok
#make dep
gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -o
scripts/mkdep
scripts/mkdep.c
make[1]: Entering directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make[1]: Nothing to be done for `dep'.
make[1]: Leaving directory `/usr/src/linux-2.4.18-3/arch/i386/boot'
make: *** No rule to make target `include/linux/autoconf.h',
needed by
`include/linux/version.h'. Stop.
At this point, I copied original .config back to top level
directory of
kernel source tree.
Am I wrong here as in configs directory there are several
files, such as
kernel-2.4.18-i686.config and kernel-2.4.18-athlon.config. If I
shouldn't use original .config file, then which config file I
should use?
#make
wish-1.6.2]# make /usr/src/linux/scripts/mkdep -- *.c > .depend
/usr/src/linux/scripts/mkdep -- *.h > .hdepend gcc
-D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes
-Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer
-DMODULE -DMODVERSIONS -include
/usr/src/linux/include/linux/modversions.h -nostdinc -iwithprefix
include -pipe -mpreferred-stack-boundary=2 -march=i686
-DKBUILD_BASENAME=x10_core -c -o x10_core.o x10_core.c
/usr/src/linux/include/linux/modversions.h: No such
Post by Scott Hiles
file or directory
linux/autoconf.h: No such
Post by Scott Hiles
file or directory
In file included from /usr/src/linux/include/linux/prefetch.h:13,
from /usr/src/linux/include/linux/list.h:6,
from /usr/src/linux/include/linux/module.h:12,
`CONFIG_X86_L1_CACHE_SHIFT'
undeclared here (not in a function)
/usr/src/linux/include/asm/processor.h:56: requested
alignment is not a
constant
linux/version.h: No such
file or directory
/usr/src/linux/include/linux/module.h:299: parse error before
`UTS_RELEASE'
x10_core.c:67:27: linux/version.h: No such file or directory
make: *** [x10_core.o] Error 1
Would you give a hint where may be wrong becuase I don't know
which step
I did is not right.
Last queston is how can I verify my system has DEVFS. As I saw the
CONFIG_DEVFS_FS=y does defined in .config, but I do not saw
devfsd is
Post by Scott Hiles
running.
Your response will be appreciated,
-Hong
Hong Hsu
2003-05-09 19:03:25 UTC
Permalink
Scott,

This is update on progress of compiling x10 device driver.

I tried a couple of ways
1. using rpmed kernel-2.4.18-3.src.rpm. it didn't work out with same
error.
2. I also tried
#make clean
#make mrproper
#make dep

that didn't work out.

I noticed that there is flag -DMODVERSIONS -include
/usr/src/linux/include/linux/modversions.h when compile the driver

So I tried:
#make oldconfig
#make dep
[wish]#make

That works! I wish I know why.

However, I got error when install the driver:
[***@puma wish-1.6.2]# make install
make: *** No rule to make target `arch/i386/vmlinux.lds', needed by
`vmlinux'. Stop.

Any advise for that issue? Thanks a lot,
-Hong
Post by Scott Hiles
Kernel-source-2.4.18-3.i386.rpm is the installable working kernel...and not
the one you need. Kernel-2.4.18-3.src.rpm is the source tree that you need
to install. To install it use the --force option. Another option is for
you to remove the source with "rpm -e kernel-2.4.18-3" and then install
again with "rpm -I kernel-2.4.18-3.src.rpm". I think those options are
correct. Read the rpm man page to make sure that I got those right from
memory.
You have to successfully get the kernel source installed before you can
proceed. Getting the message "kernel-source already installed" indicates
that it did not reinstall the source tree.
Scott
Loading...