* Some remarks about compat-wireless KBuild system
@ 2010-01-13 17:02 Ozan Çağlayan
2010-01-14 3:03 ` Hin-Tak Leung
0 siblings, 1 reply; 3+ messages in thread
From: Ozan Çağlayan @ 2010-01-13 17:02 UTC (permalink / raw)
To: Linux Wireless List
Hi,
Current compat-wireless build system has some inconveniences for distribution packaging:
- In Makefile, KLIB is set to /lib/modules/$(uname -r) which avoids compiling the stack
against a non-running kernel. In several other external kernel drivers this can be bypassed
by giving KERNELRELEASE=something to "make" but it's not working for compat-wireless.
- In gen_compat_autoconf.sh and config.mk there are two calls to $(MAKE) for determining KERNEL_SUBLEVEL:
(gen_compat_autoconf.sh) -> SUBLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
(config.mk) -> KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
The problem with that calls is that they're executing make in $KLIB_BUILD for version parsing which creates
temporary .tmp files in that directory causing sandboxed builds fail.
KERNELRELEASE=something should also allow bypassing those make calls with something like below:
if KERNELRELEASE is set
SUBLEVEL=$(echo "@KERNELRELEASE@" | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
- It's impossible to install the modules under a DESTDIR/BUILD_ROOT. KMODPATH_ARG in Makefile
can be used for this purpose but it's not set until the following condition is met:
ifneq ($(origin KLIB), undefined)
KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
I couldn't figure out the evaluation of the expression and simplified it in the following way in my package:
Index: compat-wireless-2010-01-06/Makefile
===================================================================
--- compat-wireless-2010-01-06.orig/Makefile
+++ compat-wireless-2010-01-06/Makefile
@@ -1,10 +1,6 @@
export KMODDIR?= updates
KMODDIR_ARG:= "INSTALL_MOD_DIR=$(KMODDIR)"
-ifneq ($(origin KLIB), undefined)
-KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
-else
-export KLIB:= /lib/modules/$(shell uname -r)
-endif
+export KLIB:= /lib/modules/$(shell uname -r)
export KLIB_BUILD ?= $(KLIB)/build
# Sometimes not available in the path
MODPROBE := /sbin/modprobe
@@ -12,6 +8,7 @@ MADWIFI=$(shell $(MODPROBE) -l ath_pci)
OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
DESTDIR?=
+KMODPATH_ARG:= "INSTALL_MOD_PATH=$(DESTDIR)"
ifneq ($(KERNELRELEASE),)
This way calling
make DESTDIR=/path/to/buildroot install
works correctly.
I may be misusing the kbuild system but just wanted to share these in case there's anything to be done
in upstream,
Thanks!
Ozan Caglayan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Some remarks about compat-wireless KBuild system
2010-01-13 17:02 Some remarks about compat-wireless KBuild system Ozan Çağlayan
@ 2010-01-14 3:03 ` Hin-Tak Leung
2010-01-14 17:04 ` Ozan Çağlayan
0 siblings, 1 reply; 3+ messages in thread
From: Hin-Tak Leung @ 2010-01-14 3:03 UTC (permalink / raw)
To: Ozan Çağlayan; +Cc: Linux Wireless List
On Wed, Jan 13, 2010 at 5:02 PM, Ozan Çağlayan <ozan@pardus.org.tr> wrote:
> Hi,
>
> Current compat-wireless build system has some inconveniences for distribution packaging:
>
>
> - In Makefile, KLIB is set to /lib/modules/$(uname -r) which avoids compiling the stack
> against a non-running kernel. In several other external kernel drivers this can be bypassed
> by giving KERNELRELEASE=something to "make" but it's not working for compat-wireless.
Did you not read README (or the instruction in the README not working
any more)?
compat-wireless can be used with a non-running kernel, and the
instruction is in the top-level README. (I contributed part of it, the
part on the non-running kernel which has just been distro-installed,
e.g. to build and install compat-wireless during a routine upgrade
which installs a new kernel but before a reboot to it).
>
> - In gen_compat_autoconf.sh and config.mk there are two calls to $(MAKE) for determining KERNEL_SUBLEVEL:
>
> (gen_compat_autoconf.sh) -> SUBLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
> (config.mk) -> KERNEL_SUBLEVEL := $(shell $(MAKE) -C $(KLIB_BUILD) kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
>
> The problem with that calls is that they're executing make in $KLIB_BUILD for version parsing which creates
> temporary .tmp files in that directory causing sandboxed builds fail.
>
> KERNELRELEASE=something should also allow bypassing those make calls with something like below:
>
> if KERNELRELEASE is set
> SUBLEVEL=$(echo "@KERNELRELEASE@" | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
>
>
> - It's impossible to install the modules under a DESTDIR/BUILD_ROOT. KMODPATH_ARG in Makefile
> can be used for this purpose but it's not set until the following condition is met:
>
> ifneq ($(origin KLIB), undefined)
> KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
>
> I couldn't figure out the evaluation of the expression and simplified it in the following way in my package:
>
> Index: compat-wireless-2010-01-06/Makefile
> ===================================================================
> --- compat-wireless-2010-01-06.orig/Makefile
> +++ compat-wireless-2010-01-06/Makefile
> @@ -1,10 +1,6 @@
> export KMODDIR?= updates
> KMODDIR_ARG:= "INSTALL_MOD_DIR=$(KMODDIR)"
> -ifneq ($(origin KLIB), undefined)
> -KMODPATH_ARG:= "INSTALL_MOD_PATH=$(KLIB)"
> -else
> -export KLIB:= /lib/modules/$(shell uname -r)
> -endif
> +export KLIB:= /lib/modules/$(shell uname -r)
> export KLIB_BUILD ?= $(KLIB)/build
> # Sometimes not available in the path
> MODPROBE := /sbin/modprobe
> @@ -12,6 +8,7 @@ MADWIFI=$(shell $(MODPROBE) -l ath_pci)
> OLD_IWL=$(shell $(MODPROBE) -l iwl4965)
>
> DESTDIR?=
> +KMODPATH_ARG:= "INSTALL_MOD_PATH=$(DESTDIR)"
>
> ifneq ($(KERNELRELEASE),)
>
>
> This way calling
>
> make DESTDIR=/path/to/buildroot install
>
> works correctly.
>
>
> I may be misusing the kbuild system but just wanted to share these in case there's anything to be done
> in upstream,
>
> Thanks!
> Ozan Caglayan
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Some remarks about compat-wireless KBuild system
2010-01-14 3:03 ` Hin-Tak Leung
@ 2010-01-14 17:04 ` Ozan Çağlayan
0 siblings, 0 replies; 3+ messages in thread
From: Ozan Çağlayan @ 2010-01-14 17:04 UTC (permalink / raw)
To: Hin-Tak Leung; +Cc: Linux Wireless List
Hin-Tak Leung wrote:
> On Wed, Jan 13, 2010 at 5:02 PM, Ozan Çağlayan <ozan@pardus.org.tr> wrote:
>> Hi,
>>
>> Current compat-wireless build system has some inconveniences for distribution packaging:
>>
>>
>> - In Makefile, KLIB is set to /lib/modules/$(uname -r) which avoids compiling the stack
>> against a non-running kernel. In several other external kernel drivers this can be bypassed
>> by giving KERNELRELEASE=something to "make" but it's not working for compat-wireless.
>
> Did you not read README (or the instruction in the README not working
> any more)?
>
> compat-wireless can be used with a non-running kernel, and the
> instruction is in the top-level README. (I contributed part of it, the
> part on the non-running kernel which has just been distro-installed,
> e.g. to build and install compat-wireless during a routine upgrade
> which installs a new kernel but before a reboot to it).
Hi,
actually yes I've read it many times to not miss anything about packaging but I didn't see that part.
The instructions are still correct and building against a non-running kernel and installing to a different
directory works without problem.
sorry for the inconvenience, thanks!
Ozan Caglayan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-14 17:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-13 17:02 Some remarks about compat-wireless KBuild system Ozan Çağlayan
2010-01-14 3:03 ` Hin-Tak Leung
2010-01-14 17:04 ` Ozan Çağlayan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).