[REFERENCE] How to get an Android kernel up to date with linux-stable

Search This thread

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Introduction

Hello everyone! This will be a thread to assist people with getting their device's Android kernel up to date with the latest linux-stable tag from kernel.org. This process will henceforth be referred to as "upstreaming". This thread will assume that you understand how to compile a kernel as well as working with git if you are looking to do this. If you need assistance with that, please refer to one of the following threads (or search for others):


Information

Read through the linux-stable-notes README for all the relevant information!


Custom kernels that are upstreamed



ROMs with upstreamed kernels built in


Receiving help

I am more than happy to answer any questions regarding this process in this thread. You can use the repos I have merged linux-stable into as a reference for solving conflicts and seeing how the merge commit style looks. Additionally, if you feel any information is missing or can be improved upon, please let me know! I want this to be a collaborative effort.

Good luck!
 
Last edited:

GreekDragon

Recognized Developer
Jan 5, 2014
1,628
5,321
Volos, Greece
aicp-rom.com
giphy-downsized.gif
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Thanks for the guide, it's very helpful, also I personally use this command to merge the tags, it's just one command which is nice
git pull https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git -t (tag)

Sent from my LEX727 using XDA Labs

Yup, git pull is shorthand for git fetch && git merge, so it's fetching the tag then merging it. Definitely quicker if you are going fast.

To everyone, I have added section 5 and 6 under tips and tricks, going over how to easily get notified of upstream updates and known problem commits to help you in the journey upwards!
 

ZawZaw

Inactive Recognized Developer
Jul 10, 2016
1,827
3,047
Pyay, Myanmar.
zawzaww.github.io
Thanks Sir @The Flash for your new Guide.
I'm now learning kenel development.
Your guide is very useful.

Thank You very Much.

BTW,
I want to request to use your GitHub's GCC Prebuilt Toolchain Repo for my Nexus5X kernel building.
I want to use this ToolChain Compiler for my Kernel.

Have a permission?
OR
How to request to you?

•••

Sent from my Google Nexus 5X using XDA Labs
 
Last edited:

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Thanks Sir @The Flash for your new Guide.
I'm now learning kenel development.
Your guide is very useful.

Thank You very Much.

BTW,
I want to request to use your GitHub's GCC Prebuilt Toolchain Repo for my Nexus5X kernel building.
I want to use this ToolChain Compiler for my Kernel.

Have a permission?
OR
How to request to you?

•••

Sent from my Google Nexus 5X using XDA Labs

Go for it.
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
I am going to start announcing when new kernel versions are available so people don't need to subscribe to the mailing list if they don't want to. So with that:

Linux 3.10.107 (announcement, tree)
Linux 3.18.59 (announcement, tree)
Linux 4.4.75 (announcement, tree)

I have also included a section for publicly available upstreamed kernels so users can choose one if they would like. They'll be broken up by device. Please suggest either your kernel or one you know is up to date, I'll be adding to some I already know of later today.
 

sscsps

Senior Member
Nov 17, 2013
616
189
delhi
Hi, Thanks for this wonderful guide, but I have a question which was not quite answered anywhere.
I have a kernel 3.4.5 and i want to upstream it, I did the cherry-pick process and got it to 3.4.112(purposefully not to 113 yet).
My question is how do I use the Merge process?
I did this:
Code:
git merge v3.4.6
on my base 3.4.5 and it create a whole bunch of conflicts(over 30k)

Here is the output of:
Code:
git status > git_status.txt
(I can't upload it to any online paste service as it is 1.84MB file)

Basically, it says this for all the files(I think)
Code:
	both added:      tools/perf/util/ui/progress.h
	both added:      tools/perf/util/ui/setup.c
	both added:      tools/perf/util/ui/ui.h
	both added:      tools/perf/util/ui/util.c
	both added:      tools/perf/util/ui/util.h

Can you tell me how to proceed from here?
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Hi, Thanks for this wonderful guide, but I have a question which was not quite answered anywhere.
I have a kernel 3.4.5 and i want to upstream it, I did the cherry-pick process and got it to 3.4.112(purposefully not to 113 yet).
My question is how do I use the Merge process?
I did this:
Code:
git merge v3.4.6
on my base 3.4.5 and it create a whole bunch of conflicts(over 30k)

Here is the output of:
Code:
git status > git_status.txt
(I can't upload it to any online paste service as it is 1.84MB file)

Basically, it says this for all the files(I think)
Code:
	both added:      tools/perf/util/ui/progress.h
	both added:      tools/perf/util/ui/setup.c
	both added:      tools/perf/util/ui/ui.h
	both added:      tools/perf/util/ui/util.c
	both added:      tools/perf/util/ui/util.h

Can you tell me how to proceed from here?

I know we discussed this already but a note has been added to the OP under section 3 regarding merging vs. cherry-picking on a tarball source.
 
  • Like
Reactions: king and sscsps

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
  • Like
Reactions: rockinroyle

AhmAdDev99

Senior Member
Jun 3, 2016
57
21
Hawler
Hi
I know this is not the right place to ask but could you please answer my question.
I want to build kernel for my i9100g - Galaxy SII but i have problem with the compiling.
Tried both Omni And CM.

Every time i compile i get error with initramfs, when i remove initramfs in .config file i can compile without any problem.
I get something like this ..

CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h’ is up to date.
CALL scripts/checksyscalls.sh
CHK include/generated/compile.h
/opt/src/arm/scripts/gen_initramfs_list.sh: Cannot open ‘../initramfs/initramfs.cpio’
make[1]: *** [usr/initramfs_data.cpio.gz] Error 1
make: *** [usr] Error 2
make: *** Waiting for unfinished jobs….

So please help, it's been 2 months i try to fix this problem, But NO LUCK
 

Top Liked Posts