Kernel Upgradation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Kernel Upgradation

3,537 Views
ganjiaravind
Contributor I

Hi everyone, i am using LTIB BSP for MPC8309 freescale Tower Board ,The present kernel version is 2.6.34 and i am willing to upgrade the kernel to 3.10.x version ,how i can upgrade the kernel to any interested version.

can any one help me for these work?...

0 Kudos
1 Reply

3,340 Views
ganjiaravind
Contributor I

Above question as been asked by me few months before, But today i have overview or a solution for my question, So i would like to share my experience here for thus who wanted to know how to  upgrade a linux kernel in case of LTIB(Please don't concentrate on my English much)

NXP/freescale had number of processors for various kinds of applications, But NXP/freescale will maintain only few processors upstream code(kernel.org).

As per my knowledge i had worked for MPC8321E/MPC8323E and MPC8309E processors, but currently NXP/freescale maintains there upstream code only for MPC8321E or MPC8323E, it mean if we clone any upstream code we have all the support for MPC8321E and MPC8323E.

But for those who working on MPC8309E there is no code maintenance because NXP/freescale cannot support all the chipsets in upstream and even kernel.org is not interested to do so.

Then how can we upgrade ?? OOPs we can do it still but needs a lot of efforts for those who are new to this environment

Now i will provide a view or a understanding (But its all about your work with care else you will screw-up, but not critical)

Lets Being

=======

               over a brief

               --------------------

Assume you had LTIB located in linux /root/ directory

cd /root/LTIB--->

Move to config folder which contains config files for supporting platforms named like linux-2.6.34-mpc8309twr.config or linux-2.6.33.7-mpc8309twr-INDCTRL-CAN.config or similar kind, which are nothing but the linux kernel .config files in general linux kernel compilation process

Means

linux-2.6.34-mpc8309twr.config   ==   .config


---->cd   config/platform/

This folder also contains file like .spec.in example kernel-2.6.33.7-mpc8309twr.spec.in and kernel-2.6.34-mpc8309twr.spec.in which are nothing but spec files used to apply all the patches provided by freescale or nxp.

Example:-

If we go through kernel-2.6.33.7-mpc8309twr.spec.in file we had a "source" field which indicates the tar file to pickup from /opt/freescale/pkgs location from root mount point.

            so source = linux-2.6.33.7.tar.gz (the default action)

Suppose if you want to make LTIB to pickup 5.0.0 kernel release then(please make sure you already copied linux-5.0.0.tar.gz to /opt/freescale/pkg/)

In kernel-2.6.33.7-mpc8309twr.spec.in file(no need to change file name use same for time being)

-Version         : 2.6.33.7 (minus to remove)
+Version         : 5.0.0(plus to add)

Now when LTIB points to linux kernel 5.0.0 and triggers compilation process which indeed tries to patch all patches listed in the same spec file(but for sure this will definitely fail). As freescale provided patches to linux kernel release 2.6.33.7(who is using still this kernel version today ?? typical old people)

so the real work start here nothing but porting the code from linux-2.6.33.7 to linux-5.0.0

To Apply every change provided by freescale to linux-5.0.0 the procedure to follow is

1:- please clone kernel source from kernel.org using git

   example : git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

This will clone source code from 2.6.x  to up to date in linux folder (folder automatically created)

2:- git checkout to v5.0.0(use "git tag" command to list version string name)

--> git checkout v5.0.0(the kernel code i wanted to work on)

3:- Now we are in 5.0.0 kernel release branch, So from the file kernel-2.6.33.7-mpc8309twr.spec.in

      pick up patches to apply in 5.0.0 kernel and resolve all the issues you face during patch apply as show below

cd linux/

---->applying patch "patch -p1 <kernel-2.6.33.7-MPC8309TWR-support.patch"

(This patch will be already available in /opt/freescale/pkgs/ please copy from /opt/freescale/pkgs to current location where your applying this patch)

you definitely falls into some errors while applying patch like wise function not found or missing line or any as lots of change done in between by kernel.org like new features or function removal or merging code etc...,

so now you have manually look into the errors and fix them all. Suppose if function not found error, means this function was available in linux-2.6.33.7 kernel but now it not available it means over a period this function may got removed or the function declaration changed not the definition anything can happen which needs deep investigation.

This can be cross checked by using git log command in the cloned kernel repository

==>  "git log" gives all the information from current repository till first base release what all happened to that function.

4:- once all the errors are cleared with patch command now you have a new patch ready this can be verified with "git diff"

  which provides the changes you done for making the patch working properly over a very fresh code.

   ====> git diff -p > kernel-5.0.0-MPC8309TWR-support.patch (take the diff work to a file with .patch file representation)

            

After successful porting of code we are like this

Now kernel-2.6.33.7-MPC8309TWR-support.patch == kernel-5.0.0-MPC8309TWR-support.patch

This means that kernel-2.6.33.7-MPC8309TWR-support.patch file had changes for kernel 2.6.33.7 which is equivalent to file kernel-5.0.0-MPC8309TWR-support.patch which had changes for kernel 5.0.0

Follow the same things to each patch file provided in .spec file and applied over 5.0.0 kernel and take backup with new file name

Once all the patches listed in spec.in file has been applied successfully ,Please copy all new patches to /opt/freescale/pkgs/ and update the .spec.in file with new file names as show below

-Patch1          : kernel-2.6.33.7-MPC8309TWR-support.patch

+Patch1          : kernel-5.0.0-MPC8309TWR-support.patch

for all of them listed in .spec.in file

The details explained above is an overview, but its indeed a Big work with lots of care .

I hope whoever viewing this will be considered as a path for upgrade and if anyone better solution much appreciated .

Cheers

Ganji Aravind.

0 Kudos