RFC: Macro for building modules

Elan Ruusamäe glen at delfi.ee
Tue Nov 7 19:40:12 CET 2006


On Tuesday 07 November 2006 19:22, sparky at pld-linux.org wrote:
> Right now we are copying code for building kernel 2.6 modules to each
> spec which provides them. It is a little hard to maintain and to add
> some functionality. I have created macro for building modules based on
> that code, a little expanded (with cross-compilation support). Now in
> spec file thete will only have to be some thing like:
>
> %if %{with kernel}
> cd module/place
> %build_kernel_modules module_name1 module_name2
> cd ../..
> %endif
could you post the sample specfile and initial macros?

> If some additional options for make modules are required they may be
> passed like: -1 option1 -2 option2 -3 option3; up to 9 options are
> supported.
i belive this "limitation" can be avoided by using %* macro for parameters and 
say -m modulename1,modulename2 for passing module name(s)


> Exemple when some additional option in make modules is required:
>
> %build_kernel_modules -1 T=$TMPDIR mol
>
>
> There may be 2 options passed to make prepare scripts: -p o1 -P o2.
> Module patching is supported via shell script called pld-module.patch.
>
> Exemple with additional patching:
>
> %if %{with kernel}
> cp -f pwc-if.c pwc-if.c.orig
>
> cat > pld-module.patch <<'EOF'
perhaps name it with .sh extension?


-- 
glen


More information about the pld-devel-en mailing list