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

Search This thread

Joeisgood99

Senior Member
Jan 4, 2015
303
192
Melbourne
Great thread @The Flash!
With all the hobbyist/amateur kernel developers on here (my self included) this is arguably one of the most useful threads started on XDA
I'm upstreaming the Sony Z5Compact Copyleft kernel, which is currently 2 years behind the 3.10 branch at version 84. Iv got to 3.10.90 before my first fail to boot..... Now I just have to apply all 50 patches from v89 - v90, build and boot each one individually, to find out which commit causes the issue....
So far all of my cherry-pick conflicts (5 so far) are from Sony's devs fixing the same issues in a different way without pushing it up stream.
Thanks again!
 
  • Like
Reactions: tripLr and poondog

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
Great thread @The Flash!
With all the hobbyist/amateur kernel developers on here (my self included) this is arguably one of the most useful threads started on XDA
I'm upstreaming the Sony Z5Compact Copyleft kernel, which is currently 2 years behind the 3.10 branch at version 84. Iv got to 3.10.90 before my first fail to boot..... Now I just have to apply all 50 patches from v89 - v90, build and boot each one individually, to find out which commit causes the issue....

Bisecting is exactly what that is for :)

So far all of my cherry-pick conflicts (5 so far) are from Sony's devs fixing the same issues in a different way without pushing it up stream.
Thanks again!

Depending on the nature of the issue, I will sometimes revert the CAF/OEM fix in favor of upstreams. It's a judgement call.
 
  • Like
Reactions: poondog

D1stRU3T0R

Senior Member
Oct 16, 2016
3,411
1,789
24
Huawei P8lite/P8 Lite
LeEco Le Pro3
@The Flash Hi, i did everything allright, upstreamed the kernel to one point, compiled, I got my kernel image, and now im stuck at repacking. I tried with 3 different mktools, and they all give the same errors. What i should do now ?

d1stru3t0r@D1stRU3T0R:~/Desktop/mutuj$ ./mkboot boot newboot.img
mkbootimg from boot/img_info.
./mkboot: line 145: /home/d1stru3t0r/Desktop/mutuj/mkbootfs: No such file or directory
kernel : kernel
ramdisk : new_ramdisk
page size : 2048
kernel size : 19895000
ramdisk size : 20
base : 0x07478000
kernel offset : 0x00008000
ramdisk offset : 0x07b88000
tags offset : 0x02988000
cmd line : hisi_dma_print=0 vmalloc=384M maxcpus=8 coherent_pool=512K no_irq_affinity androidboot.selinux=enforcing ate_enable=true
ramdisk is gzip format.
./mkboot: line 101: /home/d1stru3t0r/Desktop/mutuj/mkbootimg: No such file or directory
Make boot.img Error! pls check img_info file.
...
d1stru3t0r@D1stRU3T0R:~/Desktop/mutuj$

Yes, both files mkbootimg and mkbootfs are in the master folders, idk why its saying that they arent, or idk what is the problem here ...
]


EDIT: i upstreamed, flashed and phone doesnt detect simcard anymore
 
Last edited:

Watanabe_You

Senior Member
Jun 6, 2017
394
245
The latest upstream made my phone unable to connect to PC as USB storage device. The culprit might be f_mass_storage.c since they were updated, and there are more commits than the one in googlesource. Is it safe to revert all of them?
 

nathanchance

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

mosimchah

Senior Member
Dec 7, 2014
4,211
9,486
LeEco Le Pro3
ASUS ROG Phone 3
Finally :)

Sent from my LEX727 using XDA Labs
 

Attachments

  • Screenshot_20170731-225928.jpg
    Screenshot_20170731-225928.jpg
    165.8 KB · Views: 382
  • Like
Reactions: nathanchance

btiu

Senior Member
Apr 9, 2013
174
40
Manila
I've been trying to find a guide to patch my adbd (im on Nougat 7.0, 3.18.35) to have it run as adb root with no luck so far. Upstreaming my kernel would make this harder so this would have to wait, right? Would upstreaming it break the insecured/patched adbd?
 

nathanchance

Senior Recognized Developer / Contributor
Jul 22, 2015
13,760
50,106
29
Mesa, AZ
nathanchance.dev
I've been trying to find a guide to patch my adbd (im on Nougat 7.0, 3.18.35) to have it run as adb root with no luck so far. Upstreaming my kernel would make this harder so this would have to wait, right? Would upstreaming it break the insecured/patched adbd?

adbd is not a part of the kernel, it is in system/core, so no, upstreaming shouldn't affect that.
 
  • Like
Reactions: btiu

Watanabe_You

Senior Member
Jun 6, 2017
394
245
I found something weird with the repo I'm using. Apparently if I look at the folders, the last commit was 2 years ago.

If I went into the history, it suddenly shows the last commit as a few months ago.

How do I fix this?
 

Watanabe_You

Senior Member
Jun 6, 2017
394
245
Getting this error when building now:
Code:
  CC      init/version.o
  LD      init/built-in.o
drivers/built-in.o: In function `mass_storage_function_cleanup':
/home/severus/Underscore/android_kernel_xiaomi_msm8953/drivers/usb/gadget/android.c:2870: undefined reference to `fsg_sysfs_update'
/home/severus/Underscore/Downloads/android_kernel_xiaomi_msm8953/drivers/usb/gadget/android.c:2870:(.text+0x363bc8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `fsg_sysfs_update'
drivers/built-in.o: In function `mass_storage_function_init':
/home/severus/Underscore/Downloads/android_kernel_xiaomi_msm8953/drivers/usb/gadget/android.c:2846: undefined reference to `fsg_sysfs_update'
/home/severus/Underscore/Downloads/android_kernel_xiaomi_msm8953/drivers/usb/gadget/android.c:2846:(.text+0x363dc8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `fsg_sysfs_update'
Makefile:955: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1

Using source from here: https://gitlab.com/Faustian_Divergence/android_kernel_xiaomi_msm8953_new
 
Last edited:

Top Liked Posts