r3204 - in branches/kernel-image-2.6.11: . debian

Jurij Smakov jurij-guest@costa.debian.org
Sat, 21 May 2005 01:32:51 +0000


Author: jurij-guest
Date: 2005-05-21 01:32:51 +0000 (Sat, 21 May 2005)
New Revision: 3204

Modified:
   branches/kernel-image-2.6.11/README
   branches/kernel-image-2.6.11/TODO
   branches/kernel-image-2.6.11/debian/rules
   branches/kernel-image-2.6.11/debian/rules.subarch
Log:
Implemented arch/subarch-specific patches and
updated README and TODO files accordingly.


Modified: branches/kernel-image-2.6.11/README
===================================================================
--- branches/kernel-image-2.6.11/README	2005-05-20 23:45:33 UTC (rev 3203)
+++ branches/kernel-image-2.6.11/README	2005-05-21 01:32:51 UTC (rev 3204)
@@ -8,6 +8,14 @@
 arch/<arch>/<subarch> 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/<arch> or arch/<arch>/<subarch>. 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 @@
   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.

Modified: branches/kernel-image-2.6.11/TODO
===================================================================
--- branches/kernel-image-2.6.11/TODO	2005-05-20 23:45:33 UTC (rev 3203)
+++ branches/kernel-image-2.6.11/TODO	2005-05-21 01:32:51 UTC (rev 3204)
@@ -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/<version>/source symlink.
-
 * Generate the control file for individual files dynamically, so that we
   do not have that ridiculous master control file.

Modified: branches/kernel-image-2.6.11/debian/rules
===================================================================
--- branches/kernel-image-2.6.11/debian/rules	2005-05-20 23:45:33 UTC (rev 3203)
+++ branches/kernel-image-2.6.11/debian/rules	2005-05-21 01:32:51 UTC (rev 3204)
@@ -21,7 +21,8 @@
 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

Modified: branches/kernel-image-2.6.11/debian/rules.subarch
===================================================================
--- branches/kernel-image-2.6.11/debian/rules.subarch	2005-05-20 23:45:33 UTC (rev 3203)
+++ branches/kernel-image-2.6.11/debian/rules.subarch	2005-05-21 01:32:51 UTC (rev 3204)
@@ -12,6 +12,8 @@
 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 @@
 	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)