summaryrefslogtreecommitdiff
path: root/toolchain
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2011-08-31 23:35:04 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-09-17 08:15:32 +0200
commit59a326b934737483531c49c99acda7874c72e335 (patch)
tree37535beb370ab735f84fe06ff641da3720211fce /toolchain
parent20f8a7dec6fc25f6c475163c0273147580128867 (diff)
support: move patch-kernel.sh and rename it
The name "patch-kernel.sh" is a bit stupid, since this script is used to patch everything in Buildroot, not only kernel trees. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'toolchain')
-rw-r--r--toolchain/gcc/gcc-uclibc-4.x.mk4
-rw-r--r--toolchain/gdb/gdb.mk2
-rw-r--r--toolchain/kernel-headers/kernel-headers.mk4
-rwxr-xr-xtoolchain/patch-kernel.sh66
-rw-r--r--toolchain/uClibc/uclibc.mk4
5 files changed, 7 insertions, 73 deletions
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index 94613fadd..923229099 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -207,12 +207,12 @@ gcc-patched: $(GCC_DIR)/.patched
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
ifneq ($(wildcard $(GCC_PATCH_DIR)),)
- toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch $(GCC_PATCH_EXTRA)
+ support/scripts/apply-patches.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch $(GCC_PATCH_EXTRA)
endif
ifeq ($(ARCH)-$(BR2_GCC_SHARED_LIBGCC),powerpc-y)
ifneq ($(BR2_SOFT_FLOAT),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional
+ support/scripts/apply-patches.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) powerpc-link-with-math-lib.patch.conditional
endif
endif
touch $@
diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk
index caf3e364d..db46b1286 100644
--- a/toolchain/gdb/gdb.mk
+++ b/toolchain/gdb/gdb.mk
@@ -36,7 +36,7 @@ ifeq ($(GDB_VERSION),snapshot)
ln -sf $(TOOLCHAIN_DIR)/$(shell tar jtf $(DL_DIR)/$(GDB_SOURCE) | head -1 | cut -d"/" -f1) $(GDB_DIR)
endif
ifneq ($(wildcard $(GDB_PATCH_DIR)),)
- toolchain/patch-kernel.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch $(GDB_PATCH_EXTRA)
+ support/scripts/apply-patches.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch $(GDB_PATCH_EXTRA)
endif
$(CONFIG_UPDATE) $(@D)
touch $@
diff --git a/toolchain/kernel-headers/kernel-headers.mk b/toolchain/kernel-headers/kernel-headers.mk
index ce70cab3a..044fcf947 100644
--- a/toolchain/kernel-headers/kernel-headers.mk
+++ b/toolchain/kernel-headers/kernel-headers.mk
@@ -55,10 +55,10 @@ $(LINUX_HEADERS_UNPACK_DIR)/.unpacked: $(DL_DIR)/$(LINUX_HEADERS_SOURCE)
touch $@
$(LINUX_HEADERS_UNPACK_DIR)/.patched: $(LINUX_HEADERS_UNPACK_DIR)/.unpacked $(LINUX_HEADERS_DEPENDS)
- toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) toolchain/kernel-headers \
+ support/scripts/apply-patches.sh $(LINUX_HEADERS_UNPACK_DIR) toolchain/kernel-headers \
linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
ifneq ($(KERNEL_HEADERS_PATCH_DIR),)
- toolchain/patch-kernel.sh $(LINUX_HEADERS_UNPACK_DIR) $(KERNEL_HEADERS_PATCH_DIR) \
+ support/scripts/apply-patches.sh $(LINUX_HEADERS_UNPACK_DIR) $(KERNEL_HEADERS_PATCH_DIR) \
linux-$(LINUX_HEADERS_VERSION)-\*.patch{,.gz,.bz2}
endif
touch $@
diff --git a/toolchain/patch-kernel.sh b/toolchain/patch-kernel.sh
deleted file mode 100755
index 76cb9f753..000000000
--- a/toolchain/patch-kernel.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /bin/bash
-# A little script I whipped up to make it easy to
-# patch source trees and have sane error handling
-# -Erik
-#
-# (c) 2002 Erik Andersen <andersen@codepoet.org>
-
-# Set directories from arguments, or use defaults.
-targetdir=${1-.}
-patchdir=${2-../kernel-patches}
-shift 2
-patchpattern=${@-*}
-
-if [ ! -d "${targetdir}" ] ; then
- echo "Aborting. '${targetdir}' is not a directory."
- exit 1
-fi
-if [ ! -d "${patchdir}" ] ; then
- echo "Aborting. '${patchdir}' is not a directory."
- exit 1
-fi
-
-for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
- apply="patch -p1 -E -d"
- uncomp_parm=""
- if [ -d "${patchdir}/$i" ] ; then
- type="directory overlay"
- uncomp="tar cf - --exclude=.svn --no-anchored -C"
- uncomp_parm="."
- apply="tar xvf - -C"
- else case "$i" in
- *.gz)
- type="gzip"; uncomp="gunzip -dc"; ;;
- *.bz)
- type="bzip"; uncomp="bunzip -dc"; ;;
- *.bz2)
- type="bzip2"; uncomp="bunzip2 -dc"; ;;
- *.zip)
- type="zip"; uncomp="unzip -d"; ;;
- *.Z)
- type="compress"; uncomp="uncompress -c"; ;;
- *.tgz)
- type="tar gzip"; uncomp="gunzip -dc"; apply="tar xvf - -C"; ;;
- *.tar)
- type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;;
- *)
- type="plaintext"; uncomp="cat"; ;;
- esac fi
- echo ""
- echo "Applying ${i} using ${type}: "
- echo ${i} | cat >> ${targetdir}/.applied_patches_list
- ${uncomp} ${patchdir}/${i} ${uncomp_parm} | ${apply} ${targetdir}
- if [ $? != 0 ] ; then
- echo "Patch failed! Please fix $i!"
- exit 1
- fi
-done
-
-# Check for rejects...
-if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
- echo "Aborting. Reject files found."
- exit 1
-fi
-
-# Remove backup files
-find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
index e74012f61..0fc5a817e 100644
--- a/toolchain/uClibc/uclibc.mk
+++ b/toolchain/uClibc/uclibc.mk
@@ -79,11 +79,11 @@ $(UCLIBC_DIR)/.unpacked: $(DL_DIR)/$(UCLIBC_SOURCE)
uclibc-patched: $(UCLIBC_DIR)/.patched
$(UCLIBC_DIR)/.patched: $(UCLIBC_DIR)/.unpacked
ifneq ($(BR2_UCLIBC_VERSION_SNAPSHOT),y)
- toolchain/patch-kernel.sh $(UCLIBC_DIR) $(UCLIBC_PATCH_DIR) \
+ support/scripts/apply-patches.sh $(UCLIBC_DIR) $(UCLIBC_PATCH_DIR) \
uClibc-$(UCLIBC_VERSION)-\*.patch \
uClibc-$(UCLIBC_VERSION)-\*.patch.$(ARCH)
else
- toolchain/patch-kernel.sh $(UCLIBC_DIR) $(UCLIBC_PATCH_DIR) \
+ support/scripts/apply-patches.sh $(UCLIBC_DIR) $(UCLIBC_PATCH_DIR) \
uClibc.\*.patch uClibc.\*.patch.$(ARCH)
endif
touch $@