From e11de50bef12ab323f709f95363bcd4e1229c8b6 Mon Sep 17 00:00:00 2001 From: Jurij Smakov Date: Fri, 20 May 2005 23:45:33 +0000 Subject: [PATCH] Corrected the naming, which is RFC-compliant now. Tested subarch and no-subarch builds on i386. svn path=/branches/kernel-image-2.6.11/; revision=3203 --- TODO | 3 +++ arch/i386/control.in | 17 +++++++++++++++++ debian/rules | 2 +- debian/rules.subarch | 16 ++++++++++------ post-install.in | 24 ++++++++++++++---------- 5 files changed, 45 insertions(+), 17 deletions(-) diff --git a/TODO b/TODO index e7d92edcd..c325667e3 100644 --- a/TODO +++ b/TODO @@ -13,3 +13,6 @@ Major TODO items remaining: for example). * Get rid of the /lib/modules//source symlink. + +* Generate the control file for individual files dynamically, so that we + do not have that ridiculous master control file. diff --git a/arch/i386/control.in b/arch/i386/control.in index 5c4c11085..d0057b63c 100644 --- a/arch/i386/control.in +++ b/arch/i386/control.in @@ -1,3 +1,20 @@ +Package: kernel-headers-@version@-@abiname@-foo +Architecture: any +Section: devel +Priority: optional +Depends: coreutils | fileutils (>= 4.0) +Provides: kernel-headers, kernel-headers-2.6 +Description: Header files related to Linux kernel version @version@ + This package provides kernel header files for version @version@, generally + used for building out-of-tree kernel modules. See the 'module-assistant' + package for more information. + . + This package consists mostly of the common files between the subarchitecture + specific header packages, which should be used for building modules. + . + For more information you can also read: + /usr/share/doc/kernel-headers-@version@-@abiname@/debian.README.gz. + Package: kernel-headers-2.6.11-1-686 Architecture: i386 Section: devel diff --git a/debian/rules b/debian/rules index bbb247025..9e93664f3 100755 --- a/debian/rules +++ b/debian/rules @@ -49,7 +49,7 @@ build-stamp: unpack-stamp clean: dh_testdir rm -f *-stamp-* *-stamp config.* - rm -f header-install-* post-install bin/touch.orig + rm -f header-install-* post-install-* bin/touch.orig rm -rf kernel-source-* build-* install-* dh_clean diff --git a/debian/rules.subarch b/debian/rules.subarch index 048b3ab6d..70c048a8a 100755 --- a/debian/rules.subarch +++ b/debian/rules.subarch @@ -26,8 +26,10 @@ karch := $(DEB_HOST_ARCH) # ifeq ($(subarch),none) basedir := arch/$(karch) + append := else basedir := arch/$(karch)/$(subarch) + append := -$(subarch) endif default := $(basedir)/config.default configs := $(notdir $(wildcard $(basedir)/config.*)) @@ -38,8 +40,9 @@ ifndef flavours flavours := $(patsubst config.%,%,$(configs)) endif build_prefix := build-$(subarch)- - + -include $(basedir)/Makefile.inc + # # Here we construct the command lines for different make-kpkg # calls (build, kernel-image, kernel-headers) based on the values @@ -50,7 +53,7 @@ build_prefix := build-$(subarch)- # a lot of grief. # kpkg_headers_cmd := HEADER_CLEAN_HOOK='$(CURDIR)/header-install-$(subarch)' -kpkg_headers_cmd += make-kpkg --append-to-version $(debnum) +kpkg_headers_cmd += make-kpkg --append-to-version $(debnum)$(append) kpkg_build_cmd := make-kpkg --append-to-version $(debnum)-$$i ifdef added_patches kpkg_headers_cmd += --added_patches $(subst @uver@,$(uver),$(added_patches)) @@ -142,9 +145,10 @@ header-install-$(subarch): header-install.in # The way to make the correct package names is to make a # subarch-specific post-install script... # -post-install: post-install.in +post-install-$(subarch): post-install.in sed -e 's,@initrd_modules@,$(initrd_modules),' \ - post-install.in > post-install + -e 's,@append_subarch@,$(append),' \ + post-install.in > post-install-$(subarch) # # Generates the kernel config file for a subarch by merging # the arch-independent config file (arch/config.common), @@ -167,7 +171,7 @@ config.%: # # TODO: subarch specific patches # -$(kdir): post-install +$(kdir): post-install-$(subarch) dh_testdir tar jxf /usr/src/$(tkdir).tar.bz2 mkdir -p $(tkdir)/debian @@ -176,7 +180,7 @@ $(kdir): post-install cp debian/copyright $(tkdir)/debian cp $(default) $(tkdir)/.config touch $(tkdir)/debian/official - install post-install $(tkdir)/debian + install post-install-$(subarch) $(tkdir)/debian/post-install cd $(tkdir) && $(kpatch) # Here we need to do the subarch-specific patching mv $(tkdir) $@ diff --git a/post-install.in b/post-install.in index 974388ca8..aa9f80322 100644 --- a/post-install.in +++ b/post-install.in @@ -21,8 +21,21 @@ debhelper_post() { dh_md5sums --package="$1" dh_builddeb --package="$1" } +# The version which ends up here is something like +# $(version)-$(abiname)-$(flavour) and debnum is just +# -$(abiname), so that the variables get the values: +# suffix=$(flavour) +# prefix=$(version)-$(abiname) +# prefix is then used to form a destination directory +# to link to. For cases with subarch we need to link +# to kernel-headers-$(version)-$(abiname)-$(subarch), +# not just kernel-headers-$(version)-$(abiname). Note +# that the append_subarch substitution must contain a +# dash, if it is non-empty. +# +append='@append_subarch@' suffix=${version#*$debnum-} -prefix=${version%%-*}$debnum +prefix=${version%%-*}${debnum}${append} pkg=kernel-headers-$version top=$PWD/debian/$pkg dir=$top/usr/src/kernel-headers-$version @@ -86,15 +99,6 @@ ln -s /usr/src/kernel-headers-$version $top/lib/modules/$version/build debhelper_post $pkg -# -# This is kernel-build cruft which we will probably phase out -# -# bpkg=kernel-build-$prefix -# top=$PWD/../debian/$bpkg -# -# [ -d $top/usr/src/$bpkg ] || mkdir -p $top/usr/src/$bpkg -# ln -s ../kernel-headers-$version $top/usr/src/$bpkg/$suffix - # # Check whether we should force any modules to be available # on the initrd.