diff --git a/debian/Makefile b/debian/Makefile index 71d7aae3a..e7edb6547 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -59,10 +59,6 @@ kpkg_headers_cmd += make-kpkg --append-to-version $(append)$(debnum) kpkg_headers_cmd += --stem linux kpkg_build_cmd := make-kpkg --append-to-version $(debnum)-@flavour@ kpkg_build_cmd += --stem linux -ifdef added_patches - kpkg_headers_cmd += --added_patches $(subst @uver@,$(uver),$(added_patches)) - kpkg_build_cmd += --added_patches $(subst @uver@,$(uver),$(added_patches)) -endif ifdef build_subarch kpkg_build_cmd += --subarch $(build_subarch) endif @@ -166,6 +162,9 @@ config.%: cat $(basedir)/$@ >> $@ srcfiles := $(filter-out ../debian ../linux-source-$(version), $(shell echo ../*)) +patches := $(wildcard patches-debian/$(subarch).*) +patches += $(wildcarc patches-debian/$(karch).*) +patches := $(strip $(patches)) $(kdir): post-install-$(subarch) $(controls) mkdir -p $(tkdir) cp -al $(srcfiles) $(tkdir) @@ -180,7 +179,11 @@ $(kdir): post-install-$(subarch) $(controls) -e 's/@abiname@/$(abiname)/g' | \ sed '/^[[:space:]]*$$/d' | \ sed 's/^Package:/\n&/g' > $(tkdir)/debian/control - touch $(tkdir)/debian/official + touch $(tkdir)/debian/official + if [ -n '$(patches)' ]; then \ + cd $(tkdir); \ + cat $(addprefix ../,$(patches)) | patch -p1; \ + fi install post-install-$(subarch) $(tkdir)/debian/post-install mv $(tkdir) $@ # diff --git a/debian/README b/debian/README index 70f3c1538..a9b8cae9f 100644 --- a/debian/README +++ b/debian/README @@ -12,9 +12,12 @@ 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. +debian/patches-arch subdirectory. Patch must be named .diff or +.diff. If such patch is present, it will be automatically +applied during the unpacking of the build tree for a particular +(sub)architecture. Patches present in the debian/patches-arch will also +be included in the kernel-patch-debian package, suitable for building +kernels with make-kpkg. Config files ------------ @@ -128,19 +131,6 @@ headers_subarch headers_subarch := sparc64 -added_patches - - Setting this variable to non-empty value will cause an option - --added_patches to be added to the make-kpkg 'build' and - 'kernel-image' calls. The value of the variable will be - given as an argument for the --added-patchs option. The value - of this variable may contain a special string @uver@ which - is going to be expanded into the upstream kernel's version - with dots replaced by underscores (for example, 2_6_11 for the - kernel version 2.6.11). Typical usage: - - added_patches := debian,hppa-@uver@ - build_subarch Setting this variable to non-empty value will cause an option