From: Burkhard K. <bu...@bu...> - 2001-06-26 23:48:22
|
Charlie Reinl > Hallo, > > I changed to a 7.2 SuSE, new System and got ... see 'make.log' > not knowing what's happend and not understanding the message > I made hpjo-4 to hpjo-7 on kernel 2.2.7 to 2.2.16 and it worked (not > too much problems). > But what is 'uname -r' or better, what is it on a SuSE 7.2 ? Well, just type $ uname -r to find out - it is the command line to request the version number of the kernel you are running on your box. > Where i find the makefile(s) > what is the name of the symbolic link to change to /lib/modules/ 'uname > -r'/build . > > Found a 'vmlinuz.version.h' in my /boot > > thanks Charlie I haven't seen SuSE 7.2 yet, but what the fuzz is about, if you include header files from /usr/include{linux,asm}, then you are including them from the kernel source tree to which symlink /usr/src/linux points to. This is fine as long as you just keep one set of kernel sources. A developer will run into {confusion,trouble} if she keeps different versions of kernel trees (like 2.2.19 and 2.4.5) at the same time on the same box. /usr/src/linux usually is a link that points to a particular version (let's say /usr/src/linux-2.2.19). If you try to build against the other kernel version tree you first have to break the link and then set it to e.g. /usr/src/linux-2.4.5. > bash-2.05# make > ptal > make[1]: Entering directory `/opt/hpoj-0.7/ptal' > make[1]: Nothing to be done for `release'. > make[1]: Leaving directory `/opt/hpoj-0.7/ptal' > ieee12844 > make[1]: Entering directory `/opt/hpoj-0.7/ieee12844' > gcc -O -I/opt/hpoj-0.7/include -I/opt/hpoj-0.7/ptal -I/usr/src/linux/include -I/usr/include/ucd-snmp -I/usr/lib/qt-2.3.0/include -Wall -Wstrict-prototypes -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -c ieee12844pp.c > In file included from ieee12844pp.c:44: > /usr/src/linux/include/linux/module.h:21: linux/modversions.h: Datei oder Verzeichnis nicht gefunden > In file included from /usr/src/linux/include/linux/module.h:261, > from ieee12844pp.c:44: > /usr/include/linux/version.h:2: #error "=======================================================" > /usr/include/linux/version.h:3: #error "You should not include /usr/include/{linux,asm}/ header" > /usr/include/linux/version.h:4: #error "files directly for the compilation of kernel modules." > /usr/include/linux/version.h:5: #error "" > /usr/include/linux/version.h:6: #error "glibc now uses kernel header files from a well-defined" > /usr/include/linux/version.h:7: #error "working kernel version (as recommended by Linus Torvalds)" > /usr/include/linux/version.h:8: #error "These files are glibc internal and may not match the" > /usr/include/linux/version.h:9: #error "currently running kernel. They should only be" > /usr/include/linux/version.h:10: #error "included via other system header files - user space" > /usr/include/linux/version.h:11: #error "programs should not directly include <linux/*.h> or" > /usr/include/linux/version.h:12: #error "<asm/*.h> as well." > /usr/include/linux/version.h:13: #error "" > /usr/include/linux/version.h:14: #error "To build kernel modules please do the following:" > /usr/include/linux/version.h:15: #error "" > /usr/include/linux/version.h:16: #error " o Have the kernel sources installed" > /usr/include/linux/version.h:17: #error "" > /usr/include/linux/version.h:18: #error " o Make sure that the symbolic link" > /usr/include/linux/version.h:19: #error " /lib/modules/`uname -r`/build exists and points to" > /usr/include/linux/version.h:20: #error " the matching kernel source directory" > /usr/include/linux/version.h:21: #error "" > /usr/include/linux/version.h:22: #error " o Now copy /boot/vmlinuz.version.h to" > /usr/include/linux/version.h:23: #error " /lib/modules/`uname -r`/build/include/linux/version.h" > /usr/include/linux/version.h:24: #error "" > /usr/include/linux/version.h:25: #error " o When compiling, make sure to use the following" > /usr/include/linux/version.h:26: #error " compiler option to use the correct include files:" > /usr/include/linux/version.h:27: #error "" > /usr/include/linux/version.h:28: #error " -I/lib/modules/`uname -r`/build/include" > /usr/include/linux/version.h:29: #error "" > /usr/include/linux/version.h:30: #error " instead of" > /usr/include/linux/version.h:31: #error "" > /usr/include/linux/version.h:32: #error " -I/usr/include/linux" > /usr/include/linux/version.h:33: #error "" > /usr/include/linux/version.h:34: #error " Please adjust the Makefile accordingly." > /usr/include/linux/version.h:35: #error "=======================================================" Pretty much repetition, including a single log for one source file would have sufficed. I would suggest that you run $ uname -r and create a symlink accordingly. E.g. in case you are running 2.2.19 you will find a directory /lib/modules/2.2.19. Below that directory create a symlink "build" with the command line $ ln -s /usr/src/linux-2.2.19 /lib/modules/2.2.19/build and then copy /boot/vmlinuz.version.h to /lib/modules/2.2.19/build/include/linux/version.h following the directions above and change the Makefile accordingly (-I/lib/modules/`uname -r`/build/include). Note that changing the Makefile is just a quick hack, when you run ./configure again in hopj-0.7 you will loose your changes, so be sure to edit Makefile.in as well. Note too that you don't want to hardcode the kernel version into your Makefile, that's why `uname -r` is used - it is a shell command that substitutes this construct with the result of the uname command. That way you will be using the right header files automatically whatever kernel version you are building against. I am sure, David will take care of this issue within the next release :-) BTW: In my humble opinion this fuzz is not really a great idea - it might help developers a bit, but doesn't the majority of users just run/keep one kernel on their boxes? Indirection is a great tool, but human brains tend to miss the thread when facing too much of it. BTW2: If SuSE decides to use a binutils version that requires the /lib/modules/`uname -r`/build symlink, why don't they just set it up properly? I suggest to open a call, so SuSE's software engineers learn about this particular problem. Burkhard -- Burkhard Kohl bu...@bu... |