[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Single kernel variant: Missing linux-headers-*-common package



v2:
- Set "install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR):
install-headers_$(ARCH)_$(FEATURESET)" *before* not after the
install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR) block
- Replace removes via "forced-symlinks"

- Sedat -

On Wed, Aug 11, 2010 at 2:14 AM, Sedat Dilek <sedat.dilek@googlemail.com> wrote:
> Hi,
>
> while studying the kernel-buildsystem from the Debian Kernel Team and
> their Wiki pages, I came accross of a known issue.
>
> [0] says:
> "Problem: In this case, linux-headers-2.6.24-1+foo.1-common will be
> missing. One needs to invoke the binary-arch_i386 target, which will
> yield all feature sets (Xen, VServer) and flavours to be generated,
> and obviously takes a lot longer."
>
> Unfortunately, my main faster notebook has some hardware problems,
> thus I am currently doing my daily job on an Intel Pentium-M "Banias"
> 1.7GHz with 1GByte RAM notebook.
> This is a step back for me (Core2Duo T7200 with 2GByte RAM).
>
> Personally, I am not interested in a full build of all i386
> featuresets/flavours combinations.
>
> Furthermore, the build of the docs deb-files took 1.5hrs, totally the
> build-time was approx. 3.5hrs (following the Wiki).
>
> EXAMPLE:
> $ fakeroot make -f debian/rules.gen binary-arch_i386_none_686 binary-indep \
> DEBIAN_KERNEL_JOBS=${NR_CPUS}
>
> Not using "binary-indep" supresses the build of docs and source
> deb-files, but also linux-base which is required by linux-image.
>
> Building a single kernel variant creates
> linux-{image,headers}-$(REAL_VERSION) packages.
> (See definition in debian/rules.real 'REAL_VERSION =
> $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)'.)
>
> With UPSTREAMVERSION=2.6.35, ABINAME=-trunk and LOCALVERSION=686 you will get:
> linux-image-2.6.35-trunk-686 and linux-headers-2.6.35-trunk-686
>
> But linux-headers-2.6.35-trunk-686 package requires
> linux-headers-2.6.35-trunk-common for installation.
> Invoking install-headers_$(ARCH)_$(FEATURESET) creates the missing
> binary file (see my patch).
>
> For more Details see debian/README.Debian and [1].
>
> Last step for a "complete" linux-headers installation is to apt-get
> (or even to create) a linux-kbuild-2.6 package fitting to your
> Linux-kernel version.
> [2] has a step-by-step installation description and an official
> package is being prepared.
>
> Build instructions "Single Kernel Variant":
>
> ARCH="i386"
> FEATURESET="none"
> FLAVOUR="686"
> SINGLE_KERNEL_VARIANT="${ARCH}_${FEATURESET}_${FLAVOUR}"
>
> 1. fakeroot make -f debian/rules debian/control-real
> 2. fakeroot make -f debian/rules.gen setup_${SINGLE_KERNEL_VARIANT}
> 3. fakeroot make -f debian/rules.gen binary-arch_${SINGLE_KERNEL_VARIANT}
> 4. fakeroot make -f debian/rules.real install-linux-base
> 5. fakeroot make -f debian/rules.real install-firmware
>
> install-linux-base from Step #4 is required by linux-image package.
>
> For more Details see build_linux26.sh script (it has lots of comments).
>
> I did *not* check a full i386-arch build, so my patch might cause
> "unknown side-effects" there.
>
> Kind Regards,
> - Sedat - (aka dileks/dileX on IRC)
>
> [ REFERENCES ]
> [0]  http://lists.debian.org/debian-kernel/2008/04/msg00190.html:
> "linux-headers...common in single variant build"
> [1] http://wiki.debian.org/HowToRebuildAnOfficialDebianKernelPackage
> -> "Building only a single kernel variant"
> [2] http://wiki.debian.org/HowToRebuildAnOfficialDebianKernelPackage
> -> "The story of linux-kbuild-2.6"
>
--- debian/rules.real.orig	2010-08-11 03:47:05.876923886 +0200
+++ debian/rules.real	2010-08-11 04:01:01.444923962 +0200
@@ -239,6 +239,9 @@ install-headers_$(ARCH)_$(FEATURESET): $
 
 	+$(MAKE_SELF) install-base
 
+# Single kernel variant: Create missing linux-headers-*-common package.
+install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): install-headers_$(ARCH)_$(FEATURESET)
+
 install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
 install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME = linux-headers-$(REAL_VERSION)
 install-headers_$(ARCH)_$(FEATURESET)_$(FLAVOUR): PACKAGE_NAME_COMMON = linux-headers-$(UPSTREAMVERSION)$(ABINAME)-common$(LOCALVERSION_HEADERS)
@@ -283,8 +286,9 @@ endif
 	dh_link /usr/lib/$(PACKAGE_NAME_KBUILD)/scripts $(BASE_DIR)/scripts
 
 	mkdir -p $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)
-	ln -s /usr/src/$(PACKAGE_NAME) $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/build
-	ln -s /usr/src/$(PACKAGE_NAME_COMMON) $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/source
+	# Force creation of symlinks (even if they exist).
+	ln -s -f /usr/src/$(PACKAGE_NAME) $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/build
+	ln -s -f /usr/src/$(PACKAGE_NAME_COMMON) $(PACKAGE_DIR)/lib/modules/$(REAL_VERSION)/source
 
 	install -d $(PACKAGE_DIR)/DEBIAN
 	sed -e 's/=V/$(REAL_VERSION)/g' \

Reply to: