On Sun, 2011-09-11 at 16:28 +0400, Vladimir Budnev wrote:
> Hello everyone.
> 
> 
> After update fased some problem with self-made modules:) Can't get the
> trick with linux-headers-3.0.0-1-686-pae package.
> 
> apt-cache show linux-headers-3.0.0-1-686-pae 
> Gives:
> <...>
> Provides: linux-headers
> Depends: linux-headers-3.0.0-1-common (= 3.0.0-3), linux-kbuild-3.0.0,
> gcc-4.5
> <...>
> 
> Why such strange implementation, i dont understand this even reading
> apt-cache show for both packages:(

Most header files are the same for every flavour; those go in the common
header package.  Generated header files and symbol version information
go in the per-flavour header packages, as does the top-level Makefile.

The build system (Kbuild) is yet another package; this helps to support
cross-building.

> And even more why *.h files are empty at 686 dir?:
> 
> root@dbc:/usr/src# ls
> -l ./linux-headers-3.0.0-1-686-pae/include/config/*.h|head -5
> -rw-r--r-- 1 root root 0 Aug 27
> 19:24 ./linux-headers-3.0.0-1-686-pae/include/config/3c359.h
> -rw-r--r-- 1 root root 0 Aug 27
> 19:24 ./linux-headers-3.0.0-1-686-pae/include/config/3c515.h
> -rw-r--r-- 1 root root 0 Aug 27
> 19:24 ./linux-headers-3.0.0-1-686-pae/include/config/6pack.h
> -rw-r--r-- 1 root root 0 Aug 27
> 19:24 ./linux-headers-3.0.0-1-686-pae/include/config/8139cp.h
> -rw-r--r-- 1 root root 0 Aug 27
> 19:24 ./linux-headers-3.0.0-1-686-pae/include/config/8139too.h

Those are generated by Kbuild; you'll find them in any kernel build
tree.

> How to use older Makefiles with strings like:
> <...>
> KDIR := /lib/modules/$(shell uname -r)/build
> <...>
> default:
>     $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

That command is still correct.

> For example with very simple test self-made:) module I get:
> 
> make -C /lib/modules/3.0.0-1-686-pae/build
> SUBDIRS=/home/cc/code/c/module modules
> make[1]: Entering directory `/usr/src/linux-headers-3.0.0-1-686-pae'
>   CC [M]  /home/cc/code/c/module/tm.o
> /home/cc/code/c/module/tm.c: In function 'init_module':
> /home/cc/code/c/module/tm.c:21:12: warning: assignment from
> incompatible pointer type
> /home/cc/code/c/module/tm.c:22:17: error: 'NF_IP_PRE_ROUTING'
> undeclared (first use in this function)
[...]

This has nothing to do with the separation between packages.

Ben.

-- 
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to