From c0665811a38b9afd882982f2659ab565db2639b0 Mon Sep 17 00:00:00 2001 From: Jurij Smakov Date: Sat, 21 May 2005 01:32:51 +0000 Subject: [PATCH] Implemented arch/subarch-specific patches and updated README and TODO files accordingly. svn path=/branches/kernel-image-2.6.11/; revision=3204 --- README | 33 +++++++++++++++++++++++++++++++++ TODO | 8 -------- debian/rules | 3 ++- debian/rules.subarch | 11 ++++++++++- 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/README b/README index 6c126fc0f..00253759c 100644 --- a/README +++ b/README @@ -8,6 +8,14 @@ configuration files. For arches with subarches the subdirectory arch// with the same file structure must be created for each subarch. +Support for arch/subarch-specific patches +----------------------------------------- +Patches specific to a particular architecture or subarchitecture and +not included into the debian patch set should be placed in the +'patches' subdirectory of arch/ or arch//. This +directory is expected to contain the patch files and a file 'list' +with list of patches to apply. + Config files ------------ Configuration files are constructed dynamically by concatenating a number @@ -167,3 +175,28 @@ initrd_modules be give, no quoting is necessary. Typical usage: initrd_modules := kernel/drivers/video/vesafb.ko kernel/security/capability.ko + +image_postproc [NOT IMPLEMENTED YET] + + A command to be run on the kernel image after it's built. Location of + the image will be appended to this command as the last argument. One + usage is stripping the image on sparc, otherwise it is too big to be + booted: + + image_postproc := strip -R .comment -R .note -K sun4u_init -K _end -K _start + + Note that for cross-compiling a proper strip command should be used + (such as sparc-linux-strip, or something like this). + +image_prefix [NOT IMPLEMENTED YET] + + This variable may contain an expression, which will be used as a wrapper + for the make-kpkg when its target is kernel_image. This option is a kludge, + needed for sparc, which has to prepend this call with either 'sparc32' or + 'sparc64', depending on the flavour being built (otherwise depmod breaks + when building sparc32 kernels on sparc64). For this obscure case it may + be used like that (very evil): + + image_prefix := $${i%-smp} + + The shell variable ${i} will contain the current flavour in the rules file. diff --git a/TODO b/TODO index c325667e3..e52add13d 100644 --- a/TODO +++ b/TODO @@ -1,18 +1,10 @@ Major TODO items remaining: -* Patching mechanism: where are the debian and subarch-specific patches - going to be available and how they are going to be applied. - -* Naming of the subarch-specific header packages. For that some magic - should be done in post-install. - * Looks like it would be optimal to have a common kernel-headers package which would contain common headers for all arches without unmerged patches. * Various remaining kludges (stripping and sparc32/sparc64 stuff on sparc, 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/debian/rules b/debian/rules index 9e93664f3..55dc0c454 100755 --- a/debian/rules +++ b/debian/rules @@ -21,7 +21,8 @@ karch := $(shell dpkg-architecture -qDEB_HOST_ARCH) ifndef subarchs subarchs := $(shell find arch/$(karch) \ -type d -mindepth 1 -maxdepth 1 \ - ! -name '.svn' -printf '%f\n') + ! -name '.svn' ! -name 'patches' \ + -printf '%f\n') endif ifeq (,$(subarchs)) subarchs := none diff --git a/debian/rules.subarch b/debian/rules.subarch index 70c048a8a..d5966c322 100755 --- a/debian/rules.subarch +++ b/debian/rules.subarch @@ -12,6 +12,8 @@ debver := $(version)-$(abiname) uver := $(subst .,_,$(version)) debnum := -$(abiname) kbpkg := kernel-kbuild-$(version)-$(abiname) +# This will eventually have to be changed to a command, applying +# the debian's patches from the local tree (arch/patches?) kpatch := /usr/src/kernel-patches/all/$(version)/apply/debian $(version)-$(ktver) DEBIAN_UPSTREAM_VERSION := $(version) ifeq (,$(DEB_HOST_ARCH)) @@ -182,7 +184,14 @@ $(kdir): post-install-$(subarch) touch $(tkdir)/debian/official install post-install-$(subarch) $(tkdir)/debian/post-install cd $(tkdir) && $(kpatch) -# Here we need to do the subarch-specific patching +# Arch/subarch-specific patches + if [ -d $(basedir)/patches ] && \ + [ -s $(basedir)/patches/list ]; then \ + cd $(tkdir); \ + for i in $$(cat ../$(basedir)/patches/list); do \ + patch -p1 < ../$(basedir)/patches/$${i}; \ + done; \ + fi mv $(tkdir) $@ build-%: $(kdir)