From: Sonic Zhang <sonic.adi@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/5] Linux: Unpatch customer kernel source tree before make clean.
Date: Tue, 7 Aug 2012 17:09:36 +0800 [thread overview]
Message-ID: <1344330577-25159-4-git-send-email-sonic.adi@gmail.com> (raw)
In-Reply-To: <1344330577-25159-1-git-send-email-sonic.adi@gmail.com>
From: Sonic Zhang <sonic.zhang@analog.com>
Unpatch only patches which match current kernel version.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
Makefile | 2 +-
linux/linux.mk | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index ce81045..e7da18e 100644
--- a/Makefile
+++ b/Makefile
@@ -663,7 +663,7 @@ ifeq ($(NEED_WRAPPER),y)
$(Q)$(TOPDIR)/support/scripts/mkmakefile $(TOPDIR) $(O)
endif
-clean:
+clean: linux-unpatch
rm -rf $(STAGING_DIR) $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \
$(STAMP_DIR) $(BUILD_DIR) $(TOOLCHAIN_DIR) $(BASE_DIR)/staging \
$(LEGAL_INFO_DIR)
diff --git a/linux/linux.mk b/linux/linux.mk
index 48021a1..4ad8b49 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -309,6 +309,19 @@ $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed $(LI
# after it generated the initramfs list of files.
linux-rebuild-with-initramfs linux26-rebuild-with-initramfs: $(LINUX_DIR)/.stamp_initramfs_rebuilt
+LINUX_PATCH_LIST=$(wildcard $(LINUX_PATCHES)/linux-$(KERNELVERSION)-*.patch)
+linux-unpatch:
+ifeq ($(BR2_LINUX_KERNEL_CUSTOM_TREE),y)
+ifneq ($(wildcard $(BUILD_DIR)/linux-$(LINUX_VERSION)/.stamp_patched),)
+ @echo "unpatch linux kernel...."
+ for p in $(LINUX_PATCH_LIST) ; do \
+ patch -RE -p1 -d $(LINUX_SOURCE_DIR) < $$p; \
+ done
+else
+ @echo "linux kernel didn't patched, skip unpatch...."
+endif
+endif
+
# Checks to give errors that the user can understand
ifeq ($(filter source,$(MAKECMDGOALS)),)
ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
--
1.7.0.4
next prev parent reply other threads:[~2012-08-07 9:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-07 9:09 [Buildroot] [PATCH 1/5] buildroot:linux: Rename blackfin kernel Image file from vmImage back to uImage Sonic Zhang
2012-08-07 9:09 ` [Buildroot] [PATCH 2/5] linux: support unpacked kernel source tree Sonic Zhang
2012-08-11 18:06 ` Thomas Petazzoni
2012-08-13 10:12 ` Sonic Zhang
2012-08-13 17:27 ` Thomas Petazzoni
2012-08-14 8:44 ` Sonic Zhang
2012-08-07 9:09 ` [Buildroot] [PATCH 3/5] buildroot: patch kernel by kernel version Sonic Zhang
2012-08-11 18:08 ` Thomas Petazzoni
2012-08-13 10:13 ` Sonic Zhang
2012-08-07 9:09 ` Sonic Zhang [this message]
2012-08-11 18:11 ` [Buildroot] [PATCH 4/5] Linux: Unpatch customer kernel source tree before make clean Thomas Petazzoni
2012-08-13 10:21 ` Sonic Zhang
2012-08-07 9:09 ` [Buildroot] [PATCH 5/5] buildroot: initramfs: Generate vmImage without builtin initramfs rootfs Sonic Zhang
2012-08-11 18:13 ` Thomas Petazzoni
2012-08-13 10:32 ` Sonic Zhang
2012-08-21 22:49 ` Arnout Vandecappelle
2012-08-11 18:04 ` [Buildroot] [PATCH 1/5] buildroot:linux: Rename blackfin kernel Image file from vmImage back to uImage Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344330577-25159-4-git-send-email-sonic.adi@gmail.com \
--to=sonic.adi@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox