Kernel Patching Series

1. Scenario 1:
Base Kernel Source : 2.6.22 linux kernel source (www.kernel.org)

1. download the kernel source (http://www.kernel.org/pub/linux/kernel/v2.6/)
2. extract the Freescale 2.6.22 patches and apply it to the source.
run the patch-kernel.sh, then patches will be applied as well.

HOWTO :
$ ls <kernel-patches dir>
$ vim linux-2.6.22-mx-Add-generic-clksource-and-clkevent-support.patch
3. take a look into these lines :
——————————————————————
……..
diff –git a/arch/arm/mach-mx27/time.c b/arch/arm/mach-mx27/time.c
index d374c1e..a8af7cc 100644
— a/arch/arm/mach-mx27/time.c
+++ b/arch/arm/mach-mx27/time.c
@@ -17,78 +17,106 @@
………

this patch applied to arch/arm/mach-mx27/time.c file, to meet freescale CPU specs.
there is no need to edit patches in this time. just apply it.

3. extract the BSP from Phytec, look into patches directory
the patches are provided for 2.6.19.2 version.
apply each file to the specified file.
HOWTO :
$ tar xjvf BSP-Phytec-phyCORE-i.MX31-1.tar.gz
$ cd BSP-Phytec-phyCORE-i.MX31-1
$ ls
$ cd kernel-patches-target
$ ls
$ vim intel_cfi_version_1.5.patch

-> take a look to these lines :

Index: linux-2.6.19.2/drivers/mtd/chips/cfi_cmdset_0001.c
======================================

— linux-2.6.19.2.orig/drivers/mtd/chips/cfi_cmdset_0001.c
+++ linux-2.6.19.2/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -263,7 +263,7 @@ read_pri_intelext(struct map_info *map,

* this patch is subjected to drivers/mtd/chips/cfi_cmdset_0001.c
then, check it’s content :

if (extp->MajorVersion != ‘1’ ||
– (extp->MinorVersion < ‘0’ || extp->MinorVersion > ‘4’)) {
+ (extp->MinorVersion < ‘0’ || extp->MinorVersion > ‘5’)) {
printk(KERN_ERR ” Unknown Intel/Sharp Extended Query ”
“version %c.%c.\n”, extp->MajorVersion,
extp->MinorVersion);

WARNING:
make sure this patch is already applied in phytec kernel (2.6.19), to check it;

$ diff -Nru linux-2.6.19.2/drivers/mtd/chips/cfi_cmdset_0001.c linux-2.6.22/drivers/mtd/chips/cfi_cmdset_0001.c

if the patch is applied to 2.6.19.2, it means it has to be applied to 2.6.22
we need code review here !!! whether it works / not. The same procedures has to be done to every single
target file in the patch.

-> see:
$ man diff

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s