Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
On Sunday 09 December 2007 00:44:59 Ivan Shmakov wrote: > > Tino Keitel writes: > > > > Package: kernel-package > > Version: 11.001 > > Severity: wishlist > > > > Hi, > > > > it will be nice if KBUILD_OUTPUT is supported. That way, one > > source tree can be used to build kernels for differend computers > > with different machines without a clean and messing around with > > config files. > > Well, I probably may say that I've some ``initial success'' with > building in a separate directory. I'd like to mention a couple > of issues that I've stumbled upon: > > * it seems to me that implementing the support for an > autoconf-like style of passing the source and build > directories location, e. g.: > > $ make-kpkg --kernel-source=/where/is/the/source > > would require less time than a kbuild-like one > (assuming using the existing code base, of course); > certainly, one'd need to prefix a number of filenames with > `$(srctree)/', but it would be even worse to prefix almost > everything with `$(KBUILD_OUTPUT)/'; > > * including build-toplevel Makefile has a little sense, since it > contains (almost) no variables, nor `include's (in the > separate build directory case); moreover, it defines a rule > which may interfere with `debian/rules'. > > [...] Hi, Ivan, Manoj, anyone! The development time does not matter here, because building the package from the working directory of kernel build tree is inappropriate to the concept of kernel building. make-kpkg must be involved from kernel source tree as it were always before. Though there is no problem with prefixing $(KBUILD_OUTPUT)/ as Ivan mentioned. kernel-package should get everything from kernel source directory and then perform switching to a build directory. It should create this directory if it not exists. The actual build invocation should be done back from source tree. Any checks in kernel source should not taint the source tree as it occurs now with kernel_version.mk. The right method of including kernel Makefile is by setting KBUILD_SRC to avoid spawning fork and override rule warning and overriding dot-config to 0. This will give you VERSION, PATCHLEVEL, SUBLEVEL and EXTRAVERSION. KERNELRELEASE and LOCALVERSION should be acquired after oldconfig was invoked. KERNELRELEASE by the same method as original Makefile does, LOCALVERSION by including .config. Performance question: kernel-package should do as less forks as possible. Current implementation includes original Makefile 6(!) times. There is no need to be afraid of names conflict. Though it is possible to do 1 fork and get all 6 variables by using $(eval). .config may always be included without a fork because it has names prefix. The feature of building in a separate tree is really a treasure. I currently did some symbiotic makefile that builds a package from already built tree (without any changes in kernel-package itself). kernel-package is a great at its flexibility of installation but is clumsy on the building side. I suppose, that it may (and should) be separated from the building process at all. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
Hi, the generated Makefile changed in 2.6.25-rc1. It doesn't contain KERNELSRC and KERNELOUTPUT variables anymore. The attached patch works with 2.6.25-rc1. I just used the "pwd" output for kernel_output. Regards, Tino --- /usr/share/kernel-package/ruleset/kernel_version.mk.orig 2007-05-05 07:48:30.0 +0200 +++ /usr/share/kernel-package/ruleset/kernel_version.mk 2008-02-12 13:39:16.337585785 +0100 @@ -39,7 +39,20 @@ # Include the kernel makefile override dot-config := 1 -include Makefile +kernel_source \ += $(shell sed -e '/^MAKEARGS[[:blank:]]*:\?=[[:blank:]]*-C[[:blank:]]*/!d; s///' \ +Makefile) +ifneq ($(kernel_source),) +kernel_output \ += $(shell pwd) +kernel_source_makefile = $(kernel_source)/Makefile +else +kernel_output = +kernel_source_makefile = Makefile +endif +KBUILD_SRC = $(kernel_source) +# KBUILD_OUTPUT = $(kernel_output) +include $(kernel_source_makefile) dot-config := 1 .PHONY: debian_VERSION debian_PATCHLEVEL debian_SUBLEVEL
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
On Wed, Jan 30, 2008 at 01:10:09 +0100, Tino Keitel wrote: > Hi, > > the above patch doesn't work anymore with 2.6.24. No modules are > contained in the kernel .deb, only a large file names vmlinuz.o Hi, please scratch the above. It still works with the 2.6.24 kernel. However, kernel-package 11.001-0.1 doesn't work anymore with the patch. I downgraded to 11.001, patched /usr/share/kernel-package/kernel_version.mk and was able to build a kernel .deb out-of-tree again. Regards, Tino -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
Hi, the above patch doesn't work anymore with 2.6.24. No modules are contained in the kernel .deb, only a large file names vmlinuz.o Regards, Tino -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
Hi, to make make-kpkg linux-headers work, these files need to be copied into the build dir: CREDITS MAINTAINERS REPORTING-BUGS README Regards, Tino -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
On Thu, Jan 10, 2008 at 07:30:32 +0600, Ivan Shmakov wrote: > > Tino Keitel <[EMAIL PROTECTED]> writes: > > >> I'm currently testing the following hack: It requires one to use > >> kbuild first, e. g.: > > >> $ cd /usr/src/linux-2.6.X.Y > >> $ make O=/where/is/linux-2.6.X.Y-build menuconfig ... > >> $ > > >> Then, make-kpkg(1) could be used: > > >> $ cd /where/is/linux-2.6.X.Y-build $ make-kpkg ... ... > > > Hi, > > > thanks a lot. The patch works in general, but I had to do the > > following to get it working: > > Thanks for the feedback! I hope to return to improving this > change shortly. > > > - cd /usr/src/linux-2.6.X.Y > > - mkdir /where/is/linux-2.6.X.Y-build > > - make O=/where/is/linux-2.6.X.Y-build menuconfig > > Yes, these steps are as intended. > > > - make prepare > > - backup from scripts/kconfig: > > - zconf.hash.c > > - zconf.tab.c > > - lex.zconf.c > > - make mrproper > > - restore the above files in scripts/kconfig > > Could you investigate why the above is necessary? Because I didn't start with a clean source tree. When I started make-kpkg, it complained that the source directory is not clean and that I should use make mrproper. That mrproper removed the above .c files and then the compilation failed. So when I start with a clean source tree, do the make O=... then I can build the kernel without messing around with these .c files. Sorry for the confusion. So the only things that are left are the creation of the required directories in the build dir and the copy of "Documentation". Now that out-of-tree builds are working, I feel the desire of a per directory kernel-pkg.conf (maybe something like .kernel-pkg.conf). This way, the user can save the settings like revision and initrd in the build directory, so that just a make-kpkg linux-image is sufficient. Regards, Tino -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
> Tino Keitel <[EMAIL PROTECTED]> writes: >> I'm currently testing the following hack: It requires one to use >> kbuild first, e. g.: >> $ cd /usr/src/linux-2.6.X.Y >> $ make O=/where/is/linux-2.6.X.Y-build menuconfig ... >> $ >> Then, make-kpkg(1) could be used: >> $ cd /where/is/linux-2.6.X.Y-build $ make-kpkg ... ... > Hi, > thanks a lot. The patch works in general, but I had to do the > following to get it working: Thanks for the feedback! I hope to return to improving this change shortly. > - cd /usr/src/linux-2.6.X.Y > - mkdir /where/is/linux-2.6.X.Y-build > - make O=/where/is/linux-2.6.X.Y-build menuconfig Yes, these steps are as intended. > - make prepare > - backup from scripts/kconfig: > - zconf.hash.c > - zconf.tab.c > - lex.zconf.c > - make mrproper > - restore the above files in scripts/kconfig Could you investigate why the above is necessary? > - go to /where/is/linux-2.6.X.Y-build > - copy to build from the source tree: > - Documentation Yes, my patch doesn't handle this just now. It seems that `doc.mk' and `headers.mk' are to be changed, like: - -tar cf - Documentation | (cd $(DOCDIR); umask 000; tar xsf -) + -tar -C $(kernel_source) cf - Documentation \ + | (cd $(DOCDIR); umask 000; tar xsf -) While `kernel_source' (as computed by `kernel_version.mk') should be preserved (within `.mak'?) > - create in build dir (otherwise make-kpkg complains that this is not a > kernel source directory): > - drivers kernel fs include/linux dev kern fs i386/include Indeed. These are to be checked relative to `kernel_source' as well. > - make-kpkg linux-image -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
On Tue, Jan 08, 2008 at 21:22:09 +0600, Ivan Shmakov wrote: > > Ivan Shmakov <[EMAIL PROTECTED]> writes: > > Tino Keitel <[EMAIL PROTECTED]> writes: > > >> it will be nice if KBUILD_OUTPUT is supported. That way, one source > >> tree can be used to build kernels for differend computers with > >> different machines without a clean and messing around with config > >> files. > > > Well, I probably may say that I've some ``initial success'' with > > building in a separate directory. I'd like to mention a couple of > > issues that I've stumbled upon: > > I'm currently testing the following hack: > It requires one to use kbuild first, e. g.: > > $ cd /usr/src/linux-2.6.X.Y > $ make O=/where/is/linux-2.6.X.Y-build menuconfig > ... > $ > > Then, make-kpkg(1) could be used: > > $ cd /where/is/linux-2.6.X.Y-build > $ make-kpkg ... > ... Hi, thanks a lot. The patch works in general, but I had to do the following to get it working: - cd /usr/src/linux-2.6.X.Y - mkdir /where/is/linux-2.6.X.Y-build - make O=/where/is/linux-2.6.X.Y-build menuconfig - make prepare - backup from scripts/kconfig: - zconf.hash.c - zconf.tab.c - lex.zconf.c - make mrproper - restore the above files in scripts/kconfig - go to /where/is/linux-2.6.X.Y-build - copy to build from the source tree: - Documentation - create in build dir (otherwise make-kpkg complains that this is not a kernel source directory): - drivers kernel fs include/linux dev kern fs i386/include - make-kpkg linux-image Regards, Tino -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
> Ivan Shmakov <[EMAIL PROTECTED]> writes: > Tino Keitel <[EMAIL PROTECTED]> writes: >> it will be nice if KBUILD_OUTPUT is supported. That way, one source >> tree can be used to build kernels for differend computers with >> different machines without a clean and messing around with config >> files. > Well, I probably may say that I've some ``initial success'' with > building in a separate directory. I'd like to mention a couple of > issues that I've stumbled upon: I'm currently testing the following hack: --- /usr/share/kernel-package/kernel_version.mk.~1~ 2007-05-05 12:48:30.0 +0700 +++ /usr/share/kernel-package/kernel_version.mk 2008-01-08 21:04:00.0 +0600 @@ -39,7 +39,21 @@ # Include the kernel makefile override dot-config := 1 -include Makefile +kernel_source \ += $(shell sed -e '/^KERNELSRC[[:blank:]]*:\?=[[:blank:]]*/!d; s///' \ +Makefile) +ifneq ($(kernel_source),) +kernel_output \ += $(shell sed -e '/^KERNELOUTPUT[[:blank:]]*:\?=[[:blank:]]*/!d; s///' \ +Makefile) +kernel_source_makefile = $(kernel_source)/Makefile +else +kernel_output = +kernel_source_makefile = Makefile +endif +KBUILD_SRC = $(kernel_source) +# KBUILD_OUTPUT = $(kernel_output) +include $(kernel_source_makefile) dot-config := 1 .PHONY: debian_VERSION debian_PATCHLEVEL debian_SUBLEVEL It requires one to use kbuild first, e. g.: $ cd /usr/src/linux-2.6.X.Y $ make O=/where/is/linux-2.6.X.Y-build menuconfig ... $ Then, make-kpkg(1) could be used: $ cd /where/is/linux-2.6.X.Y-build $ make-kpkg ... ... $ > * it seems to me that implementing the support for an autoconf-like > style of passing the source and build directories location, e. g.: > $ make-kpkg --kernel-source=/where/is/the/source > would require less time than a kbuild-like one (assuming using the > existing code base, of course); certainly, one'd need to prefix a > number of filenames with `$(srctree)/', but it would be even worse to > prefix almost everything with `$(KBUILD_OUTPUT)/'; No such option is implemented by the patch above. > * including build-toplevel Makefile has a little sense, since it > contains (almost) no variables, nor `include's (in the separate build > directory case); moreover, it defines a rule which may interfere with > `debian/rules'. BTW, `Makefile' at top of the Linux 2.6 source tree interferes with `kernel_version.mk' as well iff the `KBUILD_OUTPUT' Make variable is defined. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
> Tino Keitel <[EMAIL PROTECTED]> writes: > Package: kernel-package > Version: 11.001 > Severity: wishlist > Hi, > it will be nice if KBUILD_OUTPUT is supported. That way, one source > tree can be used to build kernels for differend computers with > different machines without a clean and messing around with config > files. Well, I probably may say that I've some ``initial success'' with building in a separate directory. I'd like to mention a couple of issues that I've stumbled upon: * it seems to me that implementing the support for an autoconf-like style of passing the source and build directories location, e. g.: $ make-kpkg --kernel-source=/where/is/the/source would require less time than a kbuild-like one (assuming using the existing code base, of course); certainly, one'd need to prefix a number of filenames with `$(srctree)/', but it would be even worse to prefix almost everything with `$(KBUILD_OUTPUT)/'; * including build-toplevel Makefile has a little sense, since it contains (almost) no variables, nor `include's (in the separate build directory case); moreover, it defines a rule which may interfere with `debian/rules'. [...] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Bug#454350: kernel-package: please add support for KBUILD_OUTPUT
Package: kernel-package Version: 11.001 Severity: wishlist Hi, it will be nice if KBUILD_OUTPUT is supported. That way, one source tree can be used to build kernels for differend computers with different machines without a clean and messing around with config files. Regards, Tino -- System Information: Debian Release: lenny/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.23.8 (SMP w/2 CPU cores) Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages kernel-package depends on: ii dpkg 1.14.12package maintenance system for Deb ii dpkg-dev 1.14.12package building tools for Debian ii file 4.21-3 Determines file type using "magic" ii gcc [c-compiler] 4:4.2.1-6 The GNU C compiler ii gcc-3.4 [c-compiler] 3.4.6-6The GNU C compiler ii gcc-4.1 [c-compiler] 4.1.2-17 The GNU C compiler ii gcc-4.2 [c-compiler] 4.2.2-4The GNU C compiler ii gettext 0.16.1-2 GNU Internationalization utilities ii make 3.81-3 The GNU version of the "make" util ii perl 5.8.8-12 Larry Wall's Practical Extraction ii po-debconf1.0.10 manage translated Debconf template Versions of packages kernel-package recommends: ii bzip2 1.0.3-7high-quality block-sorting file co ii libc6-dev [libc-dev] 2.7-3 GNU C Library: Development Librari -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]