diff --git a/debian/Makefile b/debian/Makefile index 078a75dcc..27472ee0c 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -197,8 +197,6 @@ $(kdir): post-install-$(subarch) $(controls) # full build in the directory $(kdir) where kernel-headers are # built. So, after build we check whether current build arch has # such a file and symlink it into the $(kdir) if necessary. -# Note that to get into the kernel-headers package the arch/subarch -# still needs variables headers_dirs and headers_extra set. # build-stamp-$(subarch)-%: build-$(subarch)-% PATH=$$PWD/bin:$$PATH; \ diff --git a/debian/arch/i386/Makefile.inc b/debian/arch/i386/Makefile.inc index 79ee706ad..10151cb33 100644 --- a/debian/arch/i386/Makefile.inc +++ b/debian/arch/i386/Makefile.inc @@ -2,5 +2,4 @@ # Variables # include_common_config := no -headers_extra := arch/i386/kernel/asm-offsets.s initrd_modules := kernel/drivers/video/vesafb.ko kernel/security/capability.ko diff --git a/debian/rules b/debian/rules index 1d0b2df21..e90181ac2 100755 --- a/debian/rules +++ b/debian/rules @@ -199,7 +199,7 @@ clean: unpatch cd debian; \ rm -f *-stamp-* *-stamp config.* *.kpatches.arch; \ rm -f header-install-* post-install-* bin/touch.orig; \ - rm -rf kernel-source-* build-* install-* + rm -rf kernel-source-* build-* install-* dh_clean binary-indep: source tree patch-debian doc diff --git a/debian/templates/post-install.in b/debian/templates/post-install.in index 8b34ce015..0c2bf4c0b 100644 --- a/debian/templates/post-install.in +++ b/debian/templates/post-install.in @@ -1,8 +1,8 @@ #!/bin/sh # # This is the hook file executed by make-kpkg in the end of creation -# of the kernel-image for a particular flavour. The major task it performs -# is the creation of the flavour-specific kernel-headers package. +# of the linux-image for a particular flavour. The major task it performs +# is the creation of the flavour-specific linux-headers package. # set -e @@ -28,37 +28,29 @@ debhelper_post() { # 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-$(subarch)-$(version)-$(abiname), -# not just kernel-headers-$(version)-$(abiname). Note +# to linux-headers-$(subarch)-$(version)-$(abiname), +# not just linux-headers-$(version)-$(abiname). Note # that the append_subarch substitution must contain a # trailing dash, if it is non-empty. # append='@append_subarch@' suffix=${version#*$debnum-} prefix=${append}${version%%-*}${debnum} -pkg=kernel-headers-$version +pkg=linux-headers-$version top=$PWD/debian/$pkg -dir=$top/usr/src/kernel-headers-$version +dir=$top/usr/src/linux-headers-$version # # Here we need to find the kernel architecture which # is appropriate for the current flavour. It is available # in kernel-package as KERNEL_ARCH. Cleanest way is to get # make-kpkg export it to this script. # -# Currently we'll have to do some fiddling here For -# example for sparc we need to map sparc32* to 'sparc' -# and sparc64* to 'sparc64'. The default for other -# arches is the name of the architecture. +# Currently we just use the fact that in the build directory +# the symlink include/asm must point to include/asm-${arch} # -case ${DEB_HOST_ARCH} in - sparc*) - KERNEL_ARCH=${suffix%-smp} - KERNEL_ARCH=${KERNEL_ARCH%32} - ;; - *) - KERNEL_ARCH=${DEB_HOST_ARCH} - ;; -esac +arch=$(readlink include/asm) +arch=$(basename "${arch}") +arch="$${arch#asm-}" debhelper_pre $pkg @@ -75,27 +67,27 @@ find . -mindepth 1 -maxdepth 1 \ ! -name debian -a ! -name Documentation -a ! -name include -a \ ! -name '.*' -a \( \ -name Makefile -o -type d \) \ - -printf "../kernel-headers-$prefix/%f\n" | + -printf "../linux-headers-$prefix/%f\n" | xargs ln -s --target-directory="$dir" cd include find . -mindepth 1 -maxdepth 1 \ ! -name config -a ! -name linux -a \( \ - ! -name 'asm-*' -o -name asm-generic -o -name asm-${KERNEL_ARCH} \) \ - -printf "../../kernel-headers-$prefix/include/%f\n" | + ! -name 'asm-*' -o -name asm-generic -o -name asm-${arch} \) \ + -printf "../../linux-headers-$prefix/include/%f\n" | xargs ln -s --target-directory=$dir/include cp -a config $dir/include -ln -sf asm-${KERNEL_ARCH} $dir/include/asm +ln -sf asm-${arch} $dir/include/asm find linux -mindepth 1 -maxdepth 1 \ ! -name autoconf.h -a ! -name compile.h -a ! -name version.h \ - -printf "../../../kernel-headers-$prefix/include/linux/%f\n" | + -printf "../../../linux-headers-$prefix/include/linux/%f\n" | xargs ln -s --target-directory=$dir/include/linux cp -a linux/autoconf.h linux/compile.h \ linux/version.h $dir/include/linux cd .. mkdir -p $top/lib/modules/$version -ln -s /usr/src/kernel-headers-$version $top/lib/modules/$version/build +ln -s /usr/src/linux-headers-$version $top/lib/modules/$version/build debhelper_post $pkg