Solution to Moto G (2013) Tearing with Lollipop Bootloader (41.19) and Android KitKat - Moto G Q&A, Help & Troubleshooting

After upgrading my bootloader to Lollipop (41.18 / 41.19), I had decided to revert back the kernel / system to Android 4.4.4, this combination introduced an horizontal line going from the top of the screen to the bottom (a.k.a. tearing).
After hours of investigation, I realized that the following Motorola patch updates the Lollipop kernel to match the changes made to the bootloader:
https://github.com/MotorolaMobilityLLC/kernel-msm/commit/0d868145ddd71389c1df8b875aea2c5cee2b1cb3
if you apply the same patch to kernel version 4.4.4, it will solve the tearing issue with the Lollipop bootloader
attached a build of the GPE-4.4.4 kernel that includes the fix (based on kernel-msm-kitkat-4.4.4-KTU84P.M003)
p.s. The only part in the kernel that is changed is the device tree.

You can build a boot.img for Retail US 4.4.4?
Thanks!

juancmb said:
You can build a boot.img for Retail US 4.4.4?
Thanks!
Click to expand...
Click to collapse
attached, based on KXB21.14-L1.61.

tal.aloni said:
attached, based on KXB21.14-L1.61.
Click to expand...
Click to collapse
Oh, thank you!

It is possible to build a boot.img with the patch for Retail US 4.4.2 KXB20.9-1.10-1.24-1.1? I've been trying to compile it myself but I have not achieved yet, I'm noob with this.
Sorry and thank you.

motogextreme said:
It is possible to build a boot.img with the patch for Retail US 4.4.2 KXB20.9-1.10-1.24-1.1? I've been trying to compile it myself but I have not achieved yet, I'm noob with this.
Sorry and thank you.
Click to expand...
Click to collapse
I was not able to find the source code for this specific version, in any case, I won't be able to provide a build for every kernel out there,
I'm using BuilduntuVM.
You'll need NDK r10d and a few additional prerequisites:
Code:
sudo apt-get install p7zip-full
7z x android-ndk-r10d-linux-x86.bin
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
sudo apt-get install lzop
Steps:
1. Apply the attached patches.
Code:
patch -p1 < ../build_fix.patch
patch -p1 < ../tearing_fix_for_lollipop_bootloader.patch
2. Build the kernel.
Code:
export CROSS_COMPILE=/home/yourusername/NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
export ARCH=arm
make clean
make mrproper
make msm8226_defconfig
make menuconfig
make -j3
3. Build the device tree using dtbTool
Code:
../dtbTool/dtbTool -p scripts/dtc/ -o arch/arm/boot/dt.img arch/arm/boot/
4. Use Android Image Kitchen to unpack boot.img and replace "boot.img-dtb" with the one you built (dt.img), and then repack boot.img, use "repackimg.bat --original" to keep the original ramdisk.
5. Flash the resulting boot.img to your Moto G.

tal.aloni said:
I was not able to find the source code for this specific version, in any case, I won't be able to provide a build for every kernel out there,
I'm using BuilduntuVM.
You'll need NDK r10d and a few additional prerequisites:
Code:
sudo apt-get install p7zip-full
7z x android-ndk-r10d-linux-x86.bin
Code:
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
sudo apt-get install lzop
Steps:
1. Apply the attached patches.
Code:
patch -p1 < ../build_fix.patch
patch -p1 < ../tearing_fix_for_lollipop_bootloader.patch
2. Build the kernel.
Code:
export CROSS_COMPILE=/home/yourusername/NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-
export ARCH=arm
make clean
make mrproper
make msm8226_defconfig
make menuconfig
make -j3
3. Build the device tree using dtbTool
Code:
../dtbTool/dtbTool -p scripts/dtc/ -o arch/arm/boot/dt.img arch/arm/boot/
4. Use Android Image Kitchen to unpack boot.img and replace "boot.img-dtb" with the one you built (dt.img), and then repack boot.img.
5. Flash the resulting boot.img to your Moto G.
Click to expand...
Click to collapse
So this will build every kitkat kernel fixed?
I'll need it for non-GPE version (KXB21.14-L1.40). If you provided a more extense tutorial, it'd be great
PS: As you can see, I'm a noob on Android Dev ?

if you need a different version, first you go to https://github.com/MotorolaMobilityLLC/kernel-msm/releases and locate the kernel source code for the version you require, then you build it per my instructions (google for more detailed instructions).
cgrs,
attached a build of the KXB21.14-L1.40 kernel including the fix.
p.s. you don't have to quote my whole post.

Is there any way to make it work for Peregrine (XT1040)?

You can see that the same patch was applied to the Peregrine tree, so the solution should be the same.

tal.aloni said:
...
cgrs,
attached a build of the KXB21.14-L1.40 kernel including the fix.
p.s. you don't have to quote my whole post.
Click to expand...
Click to collapse
Unfortunately after flashing your boot.img for 'KXB21.14-L1.40' on my stock KK Ver. 'XT1032_RETAIL-GB_4.4.4_KXB21.14-L1.40_36_cid7' I loose all cellular & wifi services on my phone.
Is there something wrong with my flashing method?
Code:
mfastboot flash boot boot.img
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1
mfastboot erase modemst2
mfastboot flash fsg fsg.mbn
After reverting back to the original kernel everything is back to normal.
I also noticed there is ~2MB file size difference between the original and your boot.img files
Original => 10MB
Patched => 8MB
Is this normal?
Would it be possible to patch my boot.img? I dumped my linux partition on my PC, setting up a build environment will cost me many hours.
Thank you very much!
# Attached : my original boot.img from XT1032_RETAIL-GB_4.4.4_KXB21.14-L1.40_36_cid7

apparently there's a bug in Android Image Kitchen v2.4, and it's enough to unpack and repack boot.img to cause the wifi issue you encountered.
I've updated the original posts with proper images.
Thanks for reporting the issue.
Edit:
The bug is in mkbootfs, the program responsible to recompress the ramdisk, that's an optional step that can be skipped with "repackimg.bat --original" (which will leave the original ramdisk as is), we don't need to modify the ramdisk anyway.

Wow! so would be possible to make a cm11 build with kernel fixed! A lot of compliment to @tal.aloni ! no more screen flickering in stock kk! I have flashed your first boot.img in stock rom, and works good!!!

tal.aloni said:
apparently there's a bug in Android Image Kitchen v2.4, and it's enough to unpack and repack boot.img to cause the wifi issue you encountered.
I've updated the original posts with proper images.
Thanks for reporting the issue.
Click to expand...
Click to collapse
No problem! No more tearing now and WiFi is working as expected.
Thanks for patching!
Cheers,
miami_

Can you please make a kernel for xt1033 Indian version.

pradeeppk said:
Can you please make a kernel for xt1033 Indian version.
Click to expand...
Click to collapse
I don't have an XT1033 to test, why don't you do it:
http://forum.xda-developers.com/showpost.php?p=67571375&postcount=6

I believe XT1032 and XT1033 (and possibly all Falcon variants) use the same Kernel.

lost101 said:
I believe XT1032 and XT1033 (and possibly all Falcon variants) use the same Kernel.
Click to expand...
Click to collapse
I installed your Android 6.0 Rom (deviant version) and started getting the scrolling line issue. How do I fix that?

Related

Kernels!

Hi all,
I so wish I knew how to develop because I hate to ask, I would much rather do and share. But man Asus has posted the Kernel for JB and I would love for a good tweaked OC'ed Kernel. Sooooo, please!
Sadly there are no kernel developers for the 300t at the moment. Asus had all the kernel sources on the Asus website and i guess nobody tried to build their own.
Sent from my ASUS Transformer Pad TF300T using xda app-developers app
ASUS has removed the proprietary code from the kernel, you can download it
but it wont build until you remove references to the missing code then some
of the tablet hardware does not work. so you are left to reverse engineer the
missing code from the chip spec's and manual probing of the hardware.
EDIT: NVM finely got it to build, time to see what's not working.
untermensch said:
ASUS has removed the proprietary code from the kernel, you can download it
but it wont build until you remove references to the missing code then some
of the tablet hardware does not work. so you are left to reverse engineer the
missing code from the chip spec's and manual probing of the hardware.
Click to expand...
Click to collapse
Really ?
As far as I can tell the V10.4.2.9 kernel source from Asus website builds just fine (with one minor correction).
But perhaps I'm missing your point, sorry in that case.
My biggest problem so far is to successfully flash a custom kernel on JB custom ROM (ASU-JellyBean-Hydro 1.4.6).
This leads me to my actual question:
Anyone managed to successfully flash seanzscreams' modded kernel (Asu-JellyBean-HYDROKernel.zip)
on his excellent ROM ASU-JellyBean-Hydro 1.4.6 ?
As far as I can tell the entire kernel flash process seems to finish successfully (using TWRP 2.2.2.0)
but when checking kernel version in Settings it seems to be the same (stock) version as previously,
3.1.10-00003-g6293ea6 [email protected] #1 SMP PREEMPT Thu Aug 9 15:59:38 CST 2012
Looking forward for any ideas/tips.
(I know question better belongs in the Dev forum, but as I just registered at XDA I'm not allowed to post there.)
I got it to build using, tegra3_android_defconfig was trying the cardhu_defconfig before.
builds but does not boot :-<
untermensch said:
I got it to build using, tegra3_android_defconfig was trying the cardhu_defconfig before.
builds but does not boot :-<
Click to expand...
Click to collapse
OK, this indicates at least you have managed to get your custom kernel to run/load, very interesting.
Do you flash an update.zip using CWM/TWRP or using fastboot method sending blob to boot partition (LNX) ?
Care to share more details how you get from resulting zImage from build to something flashable ?
Something like this...
1. cp arch/arm/boot/zImage kernel.gz
2. repack-bootimg.pl kernel.gz ramdisk boot.blob.lnx
3. blobpack boot.blob LNX boot.blob.lnx
?
I am using the same scripts that I use to build the CWM-Touch.blob, I just replace
the stock kernel with the on I have built, then use fastboot to install the new recovery
it just stalls.
untermensch said:
I am using the same scripts that I use to build the CWM-Touch.blob, I just replace
the stock kernel with the on I have built, then use fastboot to install the new recovery
it just stalls.
Click to expand...
Click to collapse
Thanks, but I'm a bit confused...
How does kernel and recovery (CWM-Touch.blob) relate ?
I was of the impression that a recovery image is to be flashed to the recovery partition (SOS), e.g.,
fastboot.exe -i 0x0B05 flash recovery <blob>
...while kernel+ramdisk to boot partition (LNX), e.g.,
fastboot.exe -i 0x0B05 flash boot <blob>
Are the build scripts you mention publicly available and directions of where to look if that's the case ?
a recovery is just a kernel and ramdisk with the recovery executable.
the stock LNX and SOS kernel have the same md5 sum so it does not matter
which partition I test the kernel on, it was just convenient for me to test it on
the SOS partition.
I got most of the tools to pack a SOS blob here
https://github.com/skirata/android-utils
I had to build a newer version of the blob tools
https://github.com/AndroidRoot/BlobTools
gaze57 said:
Thanks, but I'm a bit confused...
How does kernel and recovery (CWM-Touch.blob) relate ?
I was of the impression that a recovery image is to be flashed to the recovery partition (SOS), e.g.,
fastboot.exe -i 0x0B05 flash recovery <blob>
...while kernel+ramdisk to boot partition (LNX), e.g.,
fastboot.exe -i 0x0B05 flash boot <blob>
Are the build scripts you mention publicly available and directions of where to look if that's the case ?
Click to expand...
Click to collapse
Probably I can answer some of my questions myself...
Obviously both recovery and boot partition each contain a kernel+ramdisk of their own.
The difference is probably that,
- in the recovery partition the ramdisk actually contains the complete filesystem, including
the recovery application (e.g. TWRP) and everything is just meant to run from RAM.
while,
-in the boot partition there is only a minimal ramdisk enabling proper loading of the
system partition (called APP if not mistaken).
Perhaps my problem is just that kernel command line is not correct or simething similar.
Also I just discovered that fastboot.exe has a command called "boot" which actually might
be a much faster way to test custom kernels. Have to try it out...
I tried the fastboot boot commands wont even boot the stock kernel, it kinda seems like ASUS does not
want custom kernels to be run on the tablet.
Has ASUS ever wanted custom kernels running on there stuff? Anyway, the did give us a unlock for the boot loader, so looks to me like they are taking the, can't beat make sure they can return'em approach.
untermensch said:
I tried the fastboot boot commands wont even boot the stock kernel, it kinda seems like ASUS does not
want custom kernels to be run on the tablet.
Click to expand...
Click to collapse
gaze57 said:
Really ?
As far as I can tell the V10.4.2.9 kernel source from Asus website builds just fine (with one minor correction).
But perhaps I'm missing your point, sorry in that case.
My biggest problem so far is to successfully flash a custom kernel on JB custom ROM (ASU-JellyBean-Hydro 1.4.6).
This leads me to my actual question:
Anyone managed to successfully flash seanzscreams' modded kernel (Asu-JellyBean-HYDROKernel.zip)
on his excellent ROM ASU-JellyBean-Hydro 1.4.6 ?
As far as I can tell the entire kernel flash process seems to finish successfully (using TWRP 2.2.2.0)
but when checking kernel version in Settings it seems to be the same (stock) version as previously,
3.1.10-00003-g6293ea6 [email protected] #1 SMP PREEMPT Thu Aug 9 15:59:38 CST 2012
Looking forward for any ideas/tips.
(I know question better belongs in the Dev forum, but as I just registered at XDA I'm not allowed to post there.)
Click to expand...
Click to collapse
I unpacked the Asu-JellyBean-HYDROKernel.zip kernel looks like the stock kernel, any changes
have probably been made to the initrd so the kernel version would not change.
Code:
43538fd617c95623ce71fa39897f4a94 zImage
43538fd617c95623ce71fa39897f4a94 ../boot.blob.lnx-kernel.gz
zImage is the stock kernel I use for the touch recovery and boot.blob.lnx-kernel.gz is
the unpacked Asu-JellyBean-HYDROKernel.zip kernel the md5 sums are the same.
Just for ****s and giggles, I unpacked the stock kernel zImage found the string
Code:
[email protected]
and changed it to
Code:
[email protected]
repacked to a zImage with a md5 sum of
Code:
727525cb198a130dfd532cfbde713d29
made a recovery and flashed via fastboot, and it booted fine. This proves that
the new bootloader is not checking the signature of the kernel against a stored
value so custom kernels are possible and I'm just not smart enough to build
a working kernel form the ASUS source.
That's funny, someone out there is, Man just an OC'ed Kernel would be awesome. Since EzOverclock doesn't work with JB you I can really tell the difference in speed on JB.
untermensch said:
Just for ****s and giggles, I unpacked the stock kernel zImage found the string
Code:
[email protected]
and changed it to
Code:
[email protected]
repacked to a zImage with a md5 sum of
Code:
727525cb198a130dfd532cfbde713d29
made a recovery and flashed via fastboot, and it booted fine. This proves that
the new bootloader is not checking the signature of the kernel against a stored
value so custom kernels are possible and I'm just not smart enough to build
a working kernel form the ASUS source.
Click to expand...
Click to collapse
I pulled the config from my tf300 and and managed to build the zImage
I get warning notices about the one of the mpu sensors
if you get it to flash that might be something that may not work
as for myself, I'll be looking into some UMS features, we'll see how far I get
it appears all the needed code is already included in the kernel download from asus,
just need to configure it
Seems I finally managed to build and flash my own JB kernel for the TF300T ! :good:
This will just be a quick and dirty wrap-up of what I did as my spare time is somewhat limited.
Hope to be able to make it more structured and with proper credits in the near future.
Anyone feel free to compile a better structured how-to with correct references and credits.
Quick credits/thanks:
seanzscreams
untermensch
Stuff needed:
- Asus kernel source (10_4_2_9_kernel.zip)
- Android NDK R8B (I'm using Linux version, android-ndk-r8b-linux-x86.tar.bz2)
- Asu-JellyBean-HYDROKernel.zip (to get a proper update package structure with update binary/script and META-INF directory)
- signing-tools.zip, BlobTools and re/unpack-bootimg.pl (can't remember where I found these will have to update post later...)
Preparations:
- Unpack kernel source, e.g. to $HOME/TF300/stock_kernel
- Unpack Android NDK, e.g. to $HOME/android-ndk-r8b
- Unzip Asu-JellyBean-HYDROKernel.zip, e.g. to $HOME/my_kernel
- Setup/install BlobTools and the other scripts
Step-by-step instructions:
1. Build kernel (zImage)
a) Fix minor issue in kernel source
> cd $HOME/TF300/stock_kernel
Change line 11 in file drivers/ril/ril.c
from,
#include <../../arch/arm/mach-tegra/include/mach/board-cardhu-misc.h>
to,
#include "../../arch/arm/mach-tegra/include/mach/board-cardhu-misc.h"
b) Setup build environment for cross compilation
> export PATH=$HOME/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin:$PATH
> export ARCH=arm
> export CROSS_COMPILE=arm-linux-androideabi-
c) Fetch /proc/config.gz from your TF300 and copy/gunzip to $HOME/TF300/stock_kernel/.config
d) Build
> make
If everything went fine you should have a new kernel under,
$HOME/TF300/stock_kernel/arch/arm/boot/zImage
2. Repack kernel
> cd $HOME/my_kernel
a) Create a 28 byte file using a hex editor for the signblob header (I named the file signblob_magic)
It should have the following contents when checked with hexdump:
> hexdump -C signblob_magic
00000000 2d 53 49 47 4e 45 44 2d 42 59 2d 53 49 47 4e 42 |-SIGNED-BY-SIGNB|
00000010 4c 4f 42 2d 00 00 00 00 00 00 00 00 |LOB-........|
0000001c
b) Unpack the boot.blob from Asu-JellyBean-HYDROKernel.zip (unzipped earlier under Preparations)
This step is just to get a proper blob directory structure and the initramfs.
> blobunpack boot.blob
> unpack-bootimg.pl boot.blob.lnx
c) Pack new kernel
Might as well post the script I made to perform this task, check comments.
#!/bin/sh
SRC_HOME=$HOME/TF300/stock_kernel
KERNEL_NAME=my_kernel
# replace kernel
cp ${SRC_HOME}/arch/arm/boot/zImage boot.blob.lnx-kernel.gz
# repack
repack-bootimg.pl boot.blob.lnx-kernel.gz boot.blob.lnx-ramdisk out.blob.lnx
blobpack out.blob LNX out.blob.lnx
# add signblob header
cat signblob_magic out.blob > boot.blob
# create zip package
zip -9 -r ${KERNEL_NAME}.zip boot.blob META-INF/
# Sign zip package using SignApk
java -Xmx1024m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ${KERNEL_NAME}.zip ${KERNEL_NAME}-signed.zip
3. Flash kernel
From previous steps you should now have a signed kernel called,
my_kernel-signed.zip
Flash it using TWRP and reboot.
If flash was OK a blue status bar should appear during boot and then your TF300 will reboot again.
Confirm you have a custom kernel by checking Kernel-version under Settings once system has completed the bootup.
Confirmed! I have built a working kernel from ASUS source not sure if it was the
NDK or pulling the config from the device.
good work gaze57!
Code:
~ # uname -a
Linux localhost 3.1.10 #2 SMP PREEMPT Sat Sep 15 16:49:52 PDT 2012 armv7l GNU/Linux
link to my recovery build setup with source built kernel
http://www.mediafire.com/?hnstxi9so5970y0
EDIT:
it was the config that was causing my previous attempts to fail, I have an Android build setup
with this as the path
Code:
/home/untermensch/Android/android-4.1.1_r4/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/
then these exports
Code:
export ARCH=arm
export SUBARCH=armv7-a-neon
export CROSS_COMPILE=arm-eabi-
then pull the config from the tablet and got a working kernel.
EDIT:
I opened a source repository with the fix to ril.c and the device config saved to arch/arm/configs/tf300t_defconfig
https://github.com/untermensch/tf300t_kernel
Linux kernel
Congratulations guys!
Thanks for sharing your work.
Since you've been keeping your hands busy with the kernel for some time now, I was wondering if you have ever tried to build a Linux system (kernel + working environment) for the TF300, and whether you know it's possible or not.
I've downloaded the kernel from Asus and trying to get tegra3_defconfig to build (currently having problems with "make[1]: *** [arch/arm/mach-tegra/board-cardhu-sensors.o] Error 1". Am I using the right defconfig? Is it possible to build an Android kernel but have it boot a GNU/Linux environment.
I appreciate your help
EDIT: Regarding the error message, it was a bad reference. The file was expected to be in another folder. I fixed the reference and it went on building.
Congratulations Could you try to enable to overclock?

[Q] [GT-P3100][Kernel] Compiled kernel does not boot!

Hi,
I'm trying to boot my galaxy tab2 7 with compiled kernel.
First, I downloaded kernel source from http://opensource.samsung.com.
I download GT-P3100_JB_Opensource_Update2.zip file and extract it.
To compile, I followed ketut.kumajaya's thread (http://forum.xda-developers.com/show....php?t=2086996)
I build only kernel, not other modules. Compile was done without problem.
And I extract boot.img from Stock ROM file downloaded from samsung-updates.com (http://samsung-updates.com/device/?id=GT-P3100).
Stock ROM version is P3100XXCLJ3 (that's my device's baseband version).
I unpacked boot.img and I got boot.img-kernel.gz and boot.img-ramdisk.cpio.gz.
(To make sure unpack/repack tool is working properly, I simply unpack stock boot.img and repack it. And the new boot.img was working properly. So I assume my unpack/repack tool have no problem).
So, I replace boot.img-kernel.gz with zImage and repack it.
But this time new boot image does not working (Device stuck in boot logo)
What did I done wrong? Any body help! I've been stuck with this for a week now...
(When stock ROM is flashed, Kernel version in device info is "3.0.31-595683"
You must compile pvrsrvkm kernel module as I mentioned in http://forum.xda-developers.com/showthread.php?t=1859227 and then you can use KK-Boot 0.5.x core as your flashable zip template (have PowerVR 3D driver binary inside). If you decide to keep the stock PowerVR binary, change:
#define PVRVERSION_BUILD 2166536
Click to expand...
Click to collapse
to
#define PVRVERSION_BUILD 2120756
Click to expand...
Click to collapse
and
#define PVRVERSION_BUILD_HI 216
#define PVRVERSION_BUILD_LO 6536
Click to expand...
Click to collapse
to
#define PVRVERSION_BUILD_HI 212
#define PVRVERSION_BUILD_LO 0756
Click to expand...
Click to collapse
in pvrversion.h
Do not forget to copy pvrsrvkm_sgx540_120.ko to /system/lib/modules (backup the stock modules first!)
For trouble free development, I recommend you to use GT-P3110_JB_Opensource.zip, apply all my kernel patch and use my android_espresso_omap4430_r04_blackhawk_defconfig as your kernel config file. Good luck!
necesriverua
ketut.kumajaya said:
You must compile pvrsrvkm kernel module as I mentioned in http://forum.xda-developers.com/showthread.php?t=1859227 and then you can use KK-Boot 0.5.x core as your flashable zip template (have PowerVR 3D driver binary inside). If you decide to keep the stock PowerVR binary, change:
to
and
to
in pvrversion.h
Do not forget to copy pvrsrvkm_sgx540_120.ko to /system/lib/modules (backup the stock modules first!)
For trouble free development, I recommend you to use GT-P3110_JB_Opensource.zip, apply all my kernel patch and use my android_espresso_omap4430_r04_blackhawk_defconfig as your kernel config file. Good luck!
Click to expand...
Click to collapse
Many thanx.
I really appreiciate it.
I will try this right away.
ketut.kumajaya said:
You must compile pvrsrvkm kernel module as I mentioned in http://forum.xda-developers.com/showthread.php?t=1859227 and then you can use KK-Boot 0.5.x core as your flashable zip template (have PowerVR 3D driver binary inside). If you decide to keep the stock PowerVR binary, change:
to
and
to
in pvrversion.h
Do not forget to copy pvrsrvkm_sgx540_120.ko to /system/lib/modules (backup the stock modules first!)
For trouble free development, I recommend you to use GT-P3110_JB_Opensource.zip, apply all my kernel patch and use my android_espresso_omap4430_r04_blackhawk_defconfig as your kernel config file. Good luck!
Click to expand...
Click to collapse
Dear ketut,
Because I'm behind firewall, I cannot download pvrsrvkm kernel source.
Frankly, I have very little knowledge about android system. so I'm not sure I understand your guide correctly..
What I've done is as follows:
1. Download GT-P3110_JB_Opensource
2. Apply your patch from http://forum.xda-developers.com/showthread.php?t=1859227
3. Modify PVRVERSION_BUILD and PVRVERSION_BUILD_HI and PVRVERSION_BUILD_LOW in drivers/gpu/pvr/pvrversion.h (kernel source)
4. Apply android_espresso_omap4430_r04_blackhawk_defconfig and Build (using arm-2010q1-202..)
5. Repack zImage with ramdisk.cpio.gz (extracted from stock rom file)
6. Replace boot.img in your kkboot-0.5.2-core-p31xx.zip with repacked boot.img
7. Apply new kkboot.zip in CWM and installation failed and aborted.
Am I totally in wrong direction? What am I missing here?
I sincerely ask your help.
(I found that when build kernel after your patch, additional module files (.ko) are generated.
Should I do something with that?)
cks1119 said:
Dear ketut,
Because I'm behind firewall, I cannot download pvrsrvkm kernel source.
Frankly, I have very little knowledge about android system. so I'm not sure I understand your guide correctly..
What I've done is as follows:
1. Download GT-P3110_JB_Opensource
Click to expand...
Click to collapse
Correct.
2. Apply your patch from http://forum.xda-developers.com/showthread.php?t=1859227
Click to expand...
Click to collapse
Correct, all my patch from 01-07.
3. Modify PVRVERSION_BUILD and PVRVERSION_BUILD_HI and PVRVERSION_BUILD_LOW in drivers/gpu/pvr/pvrversion.h (kernel source)
Click to expand...
Click to collapse
Incorrect, nothing to do with pvr driver inside the kernel source, it's useless. You can download eurasia_km.tgz from http://www.mediafire.com/?m9te7t4rosp131d . Do not modify PVRVERSION if you plan to use my kkboot boot image.
4. Apply android_espresso_omap4430_r04_blackhawk_defconfig and Build (using arm-2010q1-202..)
Click to expand...
Click to collapse
Code:
export CROSS_COMPILE='/opt/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-'
export LDFLAGS=''
export CFLAGS=''
export SUBARCH=arm
export ARCH=arm
make mrproper
make android_espresso_omap4430_r04_blackhawk_defconfig
make -j4
5. Repack zImage with ramdisk.cpio.gz (extracted from stock rom file)
Click to expand...
Click to collapse
Incorrect, use kkboot ramdisk for now.
6. Replace boot.img in your kkboot-0.5.2-core-p31xx.zip with repacked boot.img
Click to expand...
Click to collapse
Correct.
7. Apply new kkboot.zip in CWM and installation failed and aborted.
Click to expand...
Click to collapse
Try to unpack and repack kkboot without modification, is it works?
Am I totally in wrong direction? What am I missing here?
I sincerely ask your help.
(I found that when build kernel after your patch, additional module files (.ko) are generated.
Should I do something with that?)
Click to expand...
Click to collapse
Unpack kkboot, you will see a lot of modules inside system/lib/modules
Try to unpack and repack kkboot without modification, is it works?
Click to expand...
Click to collapse
No, unpack tool that I have is not working.
I found the tool that you've uploaded, but the unzip password was not correct for some reason
I downloaded your tool in http://forum.xda-developers.com/showthread.php?t=1241005
But while unpacking, it says below:
Code:
BOARD_KERNEL_CMDLINE console=ttyO2,115200n8 mem=1024M androidboot.console=ttyO2 vram=20M omapfb.vram=0:16M
BOARD_KERNEL_BASE 80000000
BOARD_PAGE_SIZE 00000800
gzip: ../kkboot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Is it require special tools to unpack kkboot image?
Forgot to mention, my ramdisk packed in lzo format You need lzop application to unpack it.
ketut.kumajaya said:
Forgot to mention, my ramdisk packed in lzo format You need lzop application to unpack it.
Click to expand...
Click to collapse
You mean only ramdisk?
If so, as my understanding, unpacking boot.img in kkboot-0.5.2 and repack without any change, should be working
whether your ramdisk is packed with lzo or not.
But when I did it, I still got installation fail.
(I used the unpackbootimg in blackhawk tool from http://forum.xda-developers.com/showthread.php?t=1241005)
By the way,
I've searching about lzop compressed ramdisk and found this: https://github.com/trevd/aos-tools/blob/master/scripts/unpack-ramdisk.sh
And with this method, I could unpack ramdisk file.
Code:
cat boot.img-ramdisk.gz | lzop -d | cpio -i
But, I think this is not the point.
ketut.kumajaya said:
Forgot to mention, my ramdisk packed in lzo format You need lzop application to unpack it.
Click to expand...
Click to collapse
I simply unpack and repack boot.img from kkboot-0.5.2-core-p31xx.zip
with boot.img-tools in http://forum.xda-developers.com/showthread.php?t=1241005
Then change original boot.img with repacked one and make new zip file in external SD card.
When I go to CWM recovery and try to install new zip file, then I got following message:
Code:
-Extracting files
set_perm : some changes failed
E:Error in /external_sd/newfile.zip
(Status 7)
Installation aborted
I've been trying other tools that I could find but still does not working :crying:
ketut.kumajaya said:
Forgot to mention, my ramdisk packed in lzo format You need lzop application to unpack it.
Click to expand...
Click to collapse
Finally done it!
I've got tab 2 running my own kernel!
Again, thank you for your help and all works you've done!:good:
cks1119 said:
Finally done it!
I've got tab 2 running my own kernel!
Again, thank you for your help and all works you've done!:good:
Click to expand...
Click to collapse
Congrat :good:

Is there a Stock Kernel with Safetynet Patch?

I'm looking for a stock kernel that only patches Safetynet checking. Does this exist? If not, is it easy for me to "make it" myself?
I'm not sure if there's a prebuilt one, but building one yourself isn't too hard. The patch is at https://github.com/sultanxda/androi...bc05b16bbd33521c2fffaf491c5657a94bfcfc5.patch. You just follow the steps at http://source.android.com/source/building-kernels.html as usual with the following notes:
Use "kernel/msm" as the source location
Use "marlin_defconfig" as the build configuration
Apply the patch after running the git checkout command
Use the aarch64 prebuilts, not the arm ones
Cares said:
I'm looking for a stock kernel that only patches Safetynet checking. Does this exist? If not, is it easy for me to "make it" myself?
Click to expand...
Click to collapse
Depending on your motivation for a "stock kernel" you might try franco kernel. He doesn't seem to do anything that MIGHT introduce instability or strays very far from stock.
I can vouch for franco. He does minimal performance-only tweaks by default.
josephcsible said:
I'm not sure if there's a prebuilt one, but building one yourself isn't too hard. The patch is at https://github.com/sultanxda/androi...bc05b16bbd33521c2fffaf491c5657a94bfcfc5.patch. You just follow the steps at http://source.android.com/source/building-kernels.html as usual with the following notes:
Use "kernel/msm" as the source location
Use "marlin_defconfig" as the build configuration
Apply the patch after running the git checkout command
Use the aarch64 prebuilts, not the arm ones
Click to expand...
Click to collapse
Hey thanks for the tip. I went ahead and patched the no safetynet patch to the android-msm-marlin-3.18-nougat-mr1 kernel source and compiled it. I now have a Image.gz-dtb file which I zipped (I also just have a binary file named "Image"). What should I with those now, just flash those like I would one of the other kernels? And which file exactly? The gz file? or the just binary file named "Image"?
So essentially "fastboot flash kernel <file_name>"?
When I was compiling I got two warnings by the way:
drivers/soc/qcom/Kconfig:371:warning choice value used outside its choice group
drivers/soc/qcom/Kconfig:376:warning choice value used outside its choice group
Anything I should be concerned about? I've never done this before, but did a lot of reading before I went ahead and used to do some C coding back in the day, so it's not completely unknown to me.
Essentially, these are the steps I followed, after quickly installing Linux Mint:
Code:
Create a working directory in /home/$USER/ (I created /home/sakete/android)
Enter working directory
Download android kernal source
git clone https://android.googlesource.com/kernel/msm
Download prebuilt toolchain
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
cd aarch64-linux-android-4.9
export PATH=$(pwd)/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-android-
export ARCH=arm64
export SUBARCH=arm64
Checkout specific kernel branch for Pixel/PixelXL (be in 'msm' folder)
git checkout android-msm-marlin-3.18-nougat-mr1
Get Safetynet Patch (still be in 'msm' folder)
git fetch https://github.com/sultanxda/android_kernel_oneplus_msm8996 cm-13.0-sultan
git cherry-pick abc05b16bbd33521c2fffaf491c5657a94bfcfc5
Build kernel (still be in 'msm' folder)
make clean
make mrproper
make marlin_defconfig
make -j$(grep -c ^processor /proc/cpuinfo)
I initially got some build errors, but running this command solved it: sudo apt-get install build-essential
This is a useful link for those of you who are interested in doing this as well: http://forum.xda-developers.com/showpost.php?p=69627576&postcount=7108
Hey if you can build it and post it here, that would be awesome. This is exactly what I'm looking for.
It will let me preemptively unlock my Verizon bootloader before flashing the latest OTA, while keeping Android Pay.
Has Google already posted the source for the 7.1.1 update kernel?
The source I pulled (android-msm-marlin-3.18-nougat-mr1) should be what's in the December update. It should be 7.1.1
Sakete said:
Hey thanks for the tip. I went ahead and patched the no safetynet patch to the android-msm-marlin-3.18-nougat-mr1 kernel source and compiled it. I now have a Image.gz-dtb file which I zipped (I also just have a binary file named "Image"). What should I with those now, just flash those like I would one of the other kernels? And which file exactly? The gz file? or the just binary file named "Image"?
Click to expand...
Click to collapse
The Image.gz-dtb file is the one you want.
Sakete said:
So essentially "fastboot flash kernel <file_name>"?
Click to expand...
Click to collapse
I've never done it like that, but that's apparently how Franco's kernel installs, so it's worth a shot I guess. Another way of doing it is to unpack the stock boot image with either pbatard's unmkbootimg or osm0sis's Android Image Kitchen, replace its kernel with your Image.gz-dtb, then repack and flash the new boot.img to the boot partitions.
Sakete said:
When I was compiling I got two warnings by the way:
drivers/soc/qcom/Kconfig:371:warning choice value used outside its choice group
drivers/soc/qcom/Kconfig:376:warning choice value used outside its choice group
Anything I should be concerned about? I've never done this before, but did a lot of reading before I went ahead and used to do some C coding back in the day, so it's not completely unknown to me.
Click to expand...
Click to collapse
Nothing you need to worry about.
josephcsible said:
The Image.gz-dtb file is the one you want.
I've never done it like that, but that's apparently how Franco's kernel installs, so it's worth a shot I guess. Another way of doing it is to unpack the stock boot image with either pbatard's unmkbootimg or osm0sis's Android Image Kitchen, replace its kernel with your Image.gz-dtb, then repack and flash the new boot.img to the boot partitions.
Nothing you need to worry about.
Click to expand...
Click to collapse
Great, thanks, I'll try flashing the kernel tomorrow night and will post it if successful.
Interestingly it seems that Pixel (sailfish) and Pixel XL (marlin) use the same kernel / kernel source? There at least doesn't seem to be a sailfish specific source. Will be interesting to see how it pans out tomorrow.
Sakete said:
Interestingly it seems that Pixel (sailfish) and Pixel XL (marlin) use the same kernel / kernel source? There at least doesn't seem to be a sailfish specific source. Will be interesting to see how it pans out tomorrow.
Click to expand...
Click to collapse
Indeed. The same kernel binary can run on both devices. (The ElementalX and Franco kernels don't even have separate builds for the two.)
Would you mind posting the image you built?
iPwn_ said:
Would you mind posting the image you built?
Click to expand...
Click to collapse
I'm at work now, will post it tonight.
Sent from my Pixel using Tapatalk
Stock Kernel + SafetyNet Patch applied
Well holy crap, it actually worked! Just flashed the kernel, set up android pay no problem! And everything else works just fine too.
Attached is a zip.
Steps to install (make sure you have adb and fastboot set up):
- Download file and unzip
- Reboot into bootloader (power down, hold Power + Volume Down)
- Attach device to computer
- Enter command: fastboot flash kernel <kernel_image>
- Enter command: fastboot reboot
- Disconnect device and wait for it to finish booting. That's it!
You're my hero.
Might be a lot to ask, but it would be dope if you maintained where you update the build every month for Google's latest release.
iPwn_ said:
You're my hero.
Might be a lot to ask, but it would be dope if you maintained where you update the build every month for Google's latest release.
Click to expand...
Click to collapse
I'm creating a thread in the dev section.
Edit: thread is up.
Cares said:
I'm looking for a stock kernel that only patches Safetynet checking. Does this exist? If not, is it easy for me to "make it" myself?
Click to expand...
Click to collapse
A bit late, but just for the record, ElementalX is just like stock with added features. If you don't use those features, you are essentially using the stock kernel.
I am thinking about going this route.. but I am not sure the process to flash a custom kernel on my Pixel.. would anyone be able to walk me through it? thanks!

Issue to build a correct image for Pixel sailfish from AOSP

Dears,
I apologize if same kind of topic already exist. I searched but did not find anything.
I want to build my own image for Pixel (sailfish) from AOSP.
I built it and flashed it, but my Pixel is now blocked and reboot continuously.
I would like to know what is wrong in my procedure:
repo init https://android.googlesource.com/platform/manifest -b android-8.0.0_r30
repo sync
Extract binaries from qcom-sailfish-opr3.170623.013-e4997420.tgz and sailfish-opr3.170623.013-factory-bdc49b40.zip
source build/envsetup.sh
lunch aosp_sailfish-userdebug
make
Then to flash:
First flashed official ROM : sailfish-opr3.170623.013
then
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash system_other system_other.img
fastboot flash vendor vendor.img
fastboot flash userdata userdata.img
Did I made something wrong ?
any thanks I advance for your support
Something tells me that if it were that easy, there would be 100s of Oreo roms, not just 1.
If you have TWRP installed you can get a console-ramoops from it.
If you do I am guessing you will be running into this error:
Code:
[ 2.875998] c2 1 init: /system/bin/secilc: Failed to resolve typeattributeset statement at /system/etc/selinux/mapping/26.0.cil:561
[ 2.876026] c2 1 init: /system/bin/secilc: Failed to compile cildb: -2
[ 2.876116] c2 1 init: /system/bin/secilc exited with status 254
[ 2.876159] c2 1 init: panic: rebooting to bootloader
The commits to fix this can be found here:
https://review.carbonrom.org/#/q/topic:stock_vendor
or here:
https://gerrit.omnirom.org/#/q/topic:stock_vendor
thank you, I will try
I finally found a workaround, let me explained.
I am not satisfied, but at least it works...
I downloaded the google factory image corresponding to android-8.0.0_r30 from
https://developers.google.com/android/images
OPR3.170623.013, Nov 2017
Inside there is a zip with .img files
I replaced those files with mine, and used flash-all
Now it works...
the problem is that there are many files, an dI am able to generate/update only few of them...
aboot.img -> ??
android-info.txt -> ok
apdp.img -> ??
boot.img -> ok
bootlocker.img -> ??
cmnlib32.img -> ??
cmnlib64.img -> ??
devcfg.img -> ??
hosd.img -> ??
hyp.img -> ??
keymaster.img -> ??
list.txt -> ??
modem.img -> ??
pmic.img -> ??
ramdisk-recovery.img -> ok
ramdisk.img -> ok
rpm.img -> ??
system.img -> ok
system_other.img -> ok
tz.img -> ??
userdata.img -> ok
vendor.img -> ok
xbl.img -> ??
So, what does your new rom have over the factory versions? 8.1 just dropped a few hrs ago.
I think his mission is learning. Not supplying you with an l33t firmware.
Sent from my Pixel using Tapatalk
maulich said:
I think his mission is learning. Not supplying you with an l33t firmware.
Click to expand...
Click to collapse
Didn't want one. I was genuinely wondering what his customizations were, Stock 8.x on the Pixel, is quite close to AOSP, and now that 8.1 is out with all the bug fixes that 8.0 needed...
I was able to build 8.0.0 for Pixel without issues. Make sure to disable the jack server when building, otherwise you'll likely have errors:
Code:
make ANDROID_COMPILE_WITH_JACK:=false
edit: for 8.1.0 you need to do
Code:
export ANDROID_COMPILE_WITH_JACK=false
before compiling for the option to have an effect
edit: also you should flash the images with fastboot flashall -w
8.1.0 Sources are also available now at android-8.1.0_r1, I'm currently downloading them.
However even with a successful build, there are minor issues I had, see here:
https://forum.xda-developers.com/android/help/compiled-aosp-8-0-0-source-pixel-dialer-t3714890
Hello,
I just realized that when I build the aosp for sailfish, the vendor.img partition is not built.
it uses a prebuilt image, located in
/vendor/google_devices/sailfish/proprietary/vendor.img
Does anybody knows how to generate our own vendor.img file ?
thanks in advance
maulich said:
I think his mission is learning. Not supplying you with an l33t firmware.
Sent from my Pixel using Tapatalk
Click to expand...
Click to collapse
Yes right, mission is learning.
zongojim said:
Hello,
I just realized that when I build the aosp for sailfish, the vendor.img partition is not built.
it uses a prebuilt image, located in
/vendor/google_devices/sailfish/proprietary/vendor.img
Does anybody knows how to generate our own vendor.img file ?
thanks in advance
Click to expand...
Click to collapse
The vendor partition contains proprietary things from the hardware manufacturers, things like device drivers and photo processing for example. Since the source code for those isn't freely available, you cannot build the image yourself.
HeavyHDx said:
The vendor partition contains proprietary things from the hardware manufacturers, things like device drivers and photo processing for example. Since the source code for those isn't freely available, you cannot build the image yourself.
Click to expand...
Click to collapse
yes I know this. But in previous Nexus images, we can use the binaries delivered by Google from:
https://www.google.com/url?sa=t&rct...roid/drivers&usg=AOvVaw314pNmO5TDKaw5H1b3pyYS
Then we could build vendor.img partition including these binaries.
For Pixel, I also retrieved the binaries, and now would like to build the new vendor.img partition.
vendor.img contains other information than only binaries, that I am interested to change (for instance sepolicy files, or init rc files)
Alright, 8.1.0 seems to work perfectly without any crashes this time. I'll sign it real quick and do a bit of testing and then I'll make a thread and upload the ROM.
HeavyHDx said:
Alright, 8.1.0 seems to work perfectly without any crashes this time. I'll sign it real quick and do a bit of testing and then I'll make a thread and upload the ROM.
Click to expand...
Click to collapse
I'm also trying to build AOSP for 8.1.0. However, my ultimate goal would be building it with the new Android GO configuration, any ideas how to approach this?
ka-la said:
I'm also trying to build AOSP for 8.1.0. However, my ultimate goal would be building it with the new Android GO configuration, any ideas how to approach this?
Click to expand...
Click to collapse
No idea, I'm also new to to this all. I discovered that the dialer does crash when making or receiving phone calls, however. I'm currently making my post.
HeavyHDx said:
No idea, I'm also new to to this all. I discovered that the dialer does crash when making or receiving phone calls, however. I'm currently making my post.
Click to expand...
Click to collapse
Did you make... the Dialer app your default Phone app under Settings -> Apps -> Advanced -> Default Apps -> Phone app?
ka-la said:
Did you make... the Dialer app your default Phone app under Settings -> Apps -> Advanced -> Default Apps -> Phone app?
Click to expand...
Click to collapse
Yup.
Thread is up now:
https://forum.xda-developers.com/pixel/development/rom-aosp-8-1-0-sailfish-t3715557
ka-la said:
I'm also trying to build AOSP for 8.1.0. However, my ultimate goal would be building it with the new Android GO configuration, any ideas how to approach this?
Click to expand...
Click to collapse
Man, I'd love to see that. I asked the Nova guys last night if they could enhance their Google Assistant tool to let you pick what app, so I could have it open Google Go (search lite) and I sideloaded YoutubeGo and it works good.
Hi, ran my 8.0.0 AOSP build without issues on the dialer. Have a look at the AOSP fixes which I collected from developers.
https://github.com/GeyerA/device_google_marlin/commit/dd78aff040dccef47ba0a77a84f1bc2b2373c468
Here also the content of aosp_fixes.mk which I kept in the vendor_tree (credit to PureNexusProject).
Code:
# Copyright (C) 2017 The Pure Nexus Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Google property overides
ifeq ($(filter marlin sailfish,$(TARGET_PRODUCT)),)
PRODUCT_PROPERTY_OVERRIDES += \
keyguard.no_require_sim=true \
ro.control_privapp_permissions=enforce \
ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html \
ro.url.legal.android_privacy=http://www.google.com/intl/%s/mobile/android/basic/privacy.html \
ro.com.google.clientidbase=android-google \
ro.error.receiver.system.apps=com.google.android.gms \
ro.setupwizard.enterprise_mode=1 \
ro.com.android.dataroaming=false \
ro.atrace.core.services=com.google.android.gms,com.google.android.gms.ui,com.google.android.gms.persistent \
ro.setupwizard.rotation_locked=true \
ro.config.notification_sound=Chime.ogg \
ro.config.alarm_alert=Flow.ogg \
ro.config.ringtone=Zen.ogg
ro.carrier=unknown
endif
I also built the gapps directly with the ROM which might make a difference. Maybe this is of help.... Also, what does logcat say?

Development boot.img for SM-A127F and SM-A125F with the touch and MTP fixed

Here is a few boot.img files (tarred for Odin and zipped) intended to be used together with GSI systems (e.g. LineageOS) which suffer from the non-functional touchscreen after the wake-up and the non-functional MTP (USB file transfer). The boot.img files contain the recompiled stock kernel taken from Samsung Open Source with only a couple of the most necessary fixes. 99.9% unaltered, 100% open-source
All credits for the touchscreen fix go to manteiga25, he's done an amazing job on figuring this all out, still from his solution which includes additional performance tweaks I've taken the absolute bare minimum so that the problem is no longer present. Also huge thanks to Osvaldo Costa for the wonderful bootimgtool.
NOTE: If you did not yet flash any non-stock boot.img or recovery.img you may get the bootloop after flashing of any of these files (except for the orig's). That bootloop is caused by bootloader refusing to boot the VB-unsigned kernel together with the rest of the VB-signed components. The only solution (unfortunately) is the full factory reset, so you'll have to lose your user data; everything else, including the GSI will remain intact, but you'll have to set it up from scratch.
UPDATE 01/09/23: added the version based on A127FXXU7CVL2 (Android 13) version of the kernel.
UPDATE 01/11/23: added the fixed kernels for SM-A125F.
UPDATE 03/16/23: added the version based on A127FXXU5BVF3 (Android 12) version of the kernel.
Files for SM-A127F:
boot_sm-a127f-u4_fixed.zip: A127FXXU4AUK1-based kernel, Ilitek ili9881x fix, MTP fix
boot_sm-a127f-u5_fixed.zip: A127FXXU5BVF3-based (Android 12) kernel, Ilitek ili9881x fix, MTP fix
boot_sm-a127f-u7_fixed.zip: A127FXXU7CVL2-based (Android 13) kernel, Ilitek ili9881x fix, MTP fix
orig_boot_sm-a127-u4.zip: the original unaltered A127FXXU4AUK1 boot.img for undo
orig_boot_sm-a127-u5.zip: the original unaltered A127FXXU5BVF3 boot.img for undo
orig_boot_sm-a127-u7.zip: the original unaltered A127FXXU7CVL2 boot.img for undo
src_sm-a127f_fix.zip: all the altered source files
Files for SM-A125F:
boot_sm-a125f-u2_fixed_v1.zip: A125FXXU2BVB4-based kernel, Ilitek ili9881x fix, MTP fix
boot_sm-a125f-u2_fixed_v2.zip: A125FXXU2BVB4-based kernel, Ilitek ili9881x fix, Novatek nt36525 fix, MTP fix
orig_boot_sm-a125-u2.zip: the original unaltered A125FXXU2BVB3 boot.img for undo
src_sm-a127f-fix_v2.zip: all the altered source files
v1 should be easy on battery, but v2 will probably eat more because it basically disables the power saving features of the touchscreen chip (unfortunately that's the only solution at the kernel side).
If you don't trust me or if you're in desperate need of a more recent kernel, here are the steps how to rebuild it all yourself (for SM-A127F on Debian 11):
Download the kernel source from Samsung Open Source (A127FXXU3AUJ5)
Unpack SM-A127F_RR_Opensource.zip and Kernel.tar.gz inside
Unpack SM-A127F_RR_Opensource_A127FXXU4AUK1.zip into the same dir (overwriting the files)
Unpack the attached source.tar.gz, it contains only the changed files and build.sh facilitating compilation
From root: apt install clang-9 gcc-9-aarch64-linux-gnu
Remove any other versions of clang. Then cd /usr/bin; ln -s clang clang-9; ln -s clang++ clang++-9; ln -s clang-cpp clang-cpp-9
Back in the Kernel dir, run build.sh and wait for the kernel to compile
Download bootimgtool and compile it (just "make")
Download the stock firmware
Extract boot.img from AP_A127FXX[...].tar.md5 (unpack using tar, ignore the .md5) to the root dir of your Kernel
bootimgtool disassemble boot.img
cp Kernel/arch/arm64/boot/Image kernel
bootimgtool create -o boot.img
Flash boot.img as is using Heimdall or pack into .tar and flash using Odin
For SM-A125F you'll need to use the Google's patched Clang and GCC instead, and there is no way around that except for lots and lots of additional include paths for the Mediatek drivers (and even that does not guarentee that it will be compiled successfully).
uluruman said:
Here is the boot.img (tarred for Odin) intended to be used together with GSI systems (e.g. LineageOS). It contains the recompiled stock U4 kernel taken from Samsung Open Source with only a couple of the most necessary fixes, namely the freezing touchscreen and the non-functional MTP. 99.9% unaltered, 100% open-source.
All credits for the touchscreen fix go to manteiga25, he's done an amazing job on figuring this all out, still from his solution which includes additional performance tweaks I've taken the absolute bare minimum so that the problem is no longer present. Also huge thanks to Osvaldo Costa for the wonderful bootimgtool.
If you don't trust me here are the steps how to rebuild it all yourself (on Debian 11):
Download the kernel source from Samsung Open Source (A127FXXU3AUJ5)
Unpack SM-A127F_RR_Opensource.zip and Kernel.tar.gz inside
Unpack SM-A127F_RR_Opensource_A127FXXU4AUK1.zip into the same dir (overwriting the files)
Unpack the attached source.tar.gz, it contains only the changed files and build.sh facilitating compilation
From root: apt install clang-9 gcc-9-aarch64-linux-gnu
Remove any other versions of clang. Then cd /usr/bin; ln -s clang clang-9; ln -s clang++ clang++-9; ln -s clang-cpp clang-cpp-9
Back in the Kernel dir, run build.sh and wait for the kernel to compile
Download bootimgtool and compile it (just "make")
Download the stock firmware
Extract boot.img from AP_A127FXX[...].tar.md5 (unpack using tar, ignore the .md5) to the root dir of your Kernel
bootimgtool disassemble boot.img
cp Kernel/arch/arm64/boot/Image kernel
bootimgtool create -o boot.img
Flash boot.img as is using Heimdall or pack into .tar and flash using Odin
Click to expand...
Click to collapse
Amazing work. Love to see developers still working on this device. Does it work with SM-A125F?
Allehandro said:
Amazing work. Love to see developers still working on this device. Does it work with SM-A125F?
Click to expand...
Click to collapse
You can try, it may work, but most likely will bootloop. SM-A125F is based on a Mediatek SoC, SM-A127F is based on Exynos, which has a different kernel config.
uluruman said:
You can try, it may work, but most likely will bootloop. SM-A125F is based on a Mediatek SoC, SM-A127F is based on Exynos, which has a different kernel config.
Click to expand...
Click to collapse
I don't want to risk it as it is my main device and don't want to have to restore the device later on. Thanks though.
I've finally managed to compile the SM-A125F kernel (A125FXXU2BVB4 - SM-A125F_EUR_RR): somehow it turned out to be MUCH harder than that for SM-A127F, as nearly everything there is designed for only one specific toolchain, plus the non-Samsung s_mtp driver did not compile, so I had to take it from A127F's source. Anyway, I've ported the same fixes and here is the experimental boot.img. As I don't have SM-A125F I cannot test it, so I need someone to test it. Also attached is the original U2 boot.img: in case it does not work you just flash the original.
Amazing bro! Mad respect!!!!
I will soon put this baby to the test and see what's made of!!!
I can flash this using ODIN (PDA) directly over the current LOS GSI right?
Also, do you plan to include this kernel in your gsi building script so that the boot img of the gsi will be this one?
One other issue that I seemed to also have in my phone was the proximity sensor was not working e.g. when I was in call the screen would remain on....
axy_david said:
Amazing bro! Mad respect!!!!
I will soon put this baby to the test and see what's made of!!!
I can flash this using ODIN (PDA) directly over the current LOS GSI right?
Also, do you plan to include this kernel in your gsi building script so that the boot img of the gsi will be this one?
One other issue that I seemed to also have in my phone was the proximity sensor was not working e.g. when I was in call the screen would remain on....
Click to expand...
Click to collapse
Yes, flash using Odin. GSI should not be affected in any way. If anything does wrong I've also attached the original A127FXXU4AUK1 boot.img, so that you could revert the changes.
Currently I'm struggling to make the same fixed boot.img for my second phone, which is SM-A325F, and I cannot: even if I just unpack and repack back the same boot.img using any tool, including the Google's official mkbootimg, it causes the bootloop. So all of this is currently experimental.
uluruman said:
Currently I'm struggling to make the same fixed boot.img for my second phone, which is SM-A325F, and I cannot: even if I just unpack and repack back the same boot.img using any tool, including the Google's official mkbootimg, it causes the bootloop. So all of this is currently experimental.
Click to expand...
Click to collapse
This issue is sorted out: one cannot flash a custom boot.img over the signed stock one and don't do the full factory reset afterwards. Only after the factory reset the system boots with the unsigned boot partition. Interestingly enough, Download allows flashing such an image without any warnings (in contrast to flashing up_param.bin) but the system just refuses to boot.
uluruman said:
This issue is sorted out: one cannot flash a custom boot.img over the signed stock one and don't do the full factory reset afterwards. Only after the factory reset the system boots with the unsigned boot partition. Interestingly enough, Download allows flashing such an image without any warnings (in contrast to flashing up_param.bin) but the system just refuses to boot.
Click to expand...
Click to collapse
is it possible to fix the proximity sensor?
axy_david said:
is it possible to fix the proximity sensor?
Click to expand...
Click to collapse
There is no physical proximity sensor in this phone, but with the latest firmware you can normally use the Phone app. Now it normally reacts on touching the top part of the screen with your ear and blanks the screen. The screen does not blank on approaching the screen but only on touching it.
uluruman said:
Here is the boot.img (tarred for Odin) intended to be used together with GSI systems (e.g. LineageOS). It contains the recompiled stock U4 kernel taken from Samsung Open Source with only a couple of the most necessary fixes, namely the freezing touchscreen and the non-functional MTP. 99.9% unaltered, 100% open-source.
If the fixed boot.img does not work for you for some reason, I've also attached the original U4 boot (taken from the SM-A127F_NPB_A127FXXU4AUK1 firmware) so you could revert the changes.
All credits for the touchscreen fix go to manteiga25, he's done an amazing job on figuring this all out, still from his solution which includes additional performance tweaks I've taken the absolute bare minimum so that the problem is no longer present. Also huge thanks to Osvaldo Costa for the wonderful bootimgtool.
If you don't trust me or if you're in desperate need of a more recent kernel, here are the steps how to rebuild it all yourself (on Debian 11):
Download the kernel source from Samsung Open Source (A127FXXU3AUJ5)
Unpack SM-A127F_RR_Opensource.zip and Kernel.tar.gz inside
Unpack SM-A127F_RR_Opensource_A127FXXU4AUK1.zip into the same dir (overwriting the files)
Unpack the attached source.tar.gz, it contains only the changed files and build.sh facilitating compilation
From root: apt install clang-9 gcc-9-aarch64-linux-gnu
Remove any other versions of clang. Then cd /usr/bin; ln -s clang clang-9; ln -s clang++ clang++-9; ln -s clang-cpp clang-cpp-9
Back in the Kernel dir, run build.sh and wait for the kernel to compile
Download bootimgtool and compile it (just "make")
Download the stock firmware
Extract boot.img from AP_A127FXX[...].tar.md5 (unpack using tar, ignore the .md5) to the root dir of your Kernel
bootimgtool disassemble boot.img
cp Kernel/arch/arm64/boot/Image kernel
bootimgtool create -o boot.img
Flash boot.img as is using Heimdall or pack into .tar and flash using Odin
P.S.: the U5 kernel sources are suspicously segregated between RR (rest of the world), EUR, CIS and CIS-SER (Russia). It's quite interesting what are the differences?
Click to expand...
Click to collapse
Can you make one for A127F/DSN U7? (I don't have linux)
just tested on my phone latest U7 or s7???? nevertheless it bootloops
axy_david said:
just tested on my phone latest U7 or s7???? nevertheless it bootloops
Click to expand...
Click to collapse
it only works for u4 currently.
TheWorldYT said:
Can you make one for A127F/DSN U7? (I don't have linux)
Click to expand...
Click to collapse
I will, hold on.
just tested on my phone latest U7 or s7???? nevertheless it bootloops
TheWorldYT said:
it only works for u4 currently.
Click to expand...
Click to collapse
damn, and I can't downgrade, im using A127FXXS7BVK1 the latest update for europe really
axy_david said:
just tested on my phone latest U7 or s7???? nevertheless it bootloops
damn, and I can't downgrade, im using A127FXXS7BVK1
Click to expand...
Click to collapse
same thing.
also:
uluruman said:
I will, hold on.
Click to expand...
Click to collapse
axy_david said:
just tested on my phone latest U7 or s7???? nevertheless it bootloops
damn, and I can't downgrade, im using A127FXXS7BVK1 the latest update for europe really
Click to expand...
Click to collapse
uluruman said he will create one.
axy_david said:
just tested on my phone latest U7 or s7???? nevertheless it bootloops
damn, and I can't downgrade, im using A127FXXS7BVK1 the latest update for europe really
Click to expand...
Click to collapse
Done! ) See the update in the first post.
I've used the A127FXXU7CVL2 version source but it should work anyway because it's also U7-based (anyway there is no alternative - Samsung provides only that U7-based kernel). The only thing that theoretically can be needed is the factory reset: at least with my SM-A325F that was the case of the weird boot loop - the Verified Boot protection being voided (the warranty void bit being set) caused the bootloader to refuse loading the kernel.
uluruman said:
Done! ) See the update in the first post.
I've used the A127FXXU7CVL2 version source but it should work anyway because it's also U7-based (anyway there is no alternative - Samsung provides only that U7-based kernel). The only thing that theoretically can be needed is the factory reset: at least with my SM-A325F that was the case of the weird boot loop - the Verified Boot protection being voided (the warranty void bit being set) caused the bootloader to refuse loading the kernel.
Click to expand...
Click to collapse
Thank you!
uluruman said:
I've finally managed to compile the SM-A125F kernel (A125FXXU2BVB4 - SM-A125F_EUR_RR): somehow it turned out to be MUCH harder than that for SM-A127F, as nearly everything there is designed for only one specific toolchain, plus the non-Samsung s_mtp driver did not compile, so I had to take it from A127F's source. Anyway, I've ported the same fixes and here is the experimental boot.img. As I don't have SM-A125F I cannot test it, so I need someone to test it. Also attached is the original U2 boot.img: in case it does not work you just flash the original.
Click to expand...
Click to collapse
Can u make flashable zip for fix touch and mtp for a125f cause i think it dndt work after flashing only boot.img in twrp,still i found out that the baseband version is still bv5 instead of bv4 i hope you fix that bro because i want to install gsi
uluruman said:
Here is the boot.img (tarred for Odin) intended to be used together with GSI systems (e.g. LineageOS). It contains the recompiled stock U4 kernel taken from Samsung Open Source with only a couple of the most necessary fixes, namely the freezing touchscreen and the non-functional MTP. 99.9% unaltered, 100% open-source.
If the fixed boot.img does not work for you for some reason, I've also attached the original U4 boot (taken from the SM-A127F_NPB_A127FXXU4AUK1 firmware) so you could revert the changes.
All credits for the touchscreen fix go to manteiga25, he's done an amazing job on figuring this all out, still from his solution which includes additional performance tweaks I've taken the absolute bare minimum so that the problem is no longer present. Also huge thanks to Osvaldo Costa for the wonderful bootimgtool.
UPDATE 01/09/23: added the version based on A127FXXU7CVL2 (Android 13) version of the kernel.
If you don't trust me or if you're in desperate need of a more recent kernel, here are the steps how to rebuild it all yourself (on Debian 11):
Download the kernel source from Samsung Open Source (A127FXXU3AUJ5)
Unpack SM-A127F_RR_Opensource.zip and Kernel.tar.gz inside
Unpack SM-A127F_RR_Opensource_A127FXXU4AUK1.zip into the same dir (overwriting the files)
Unpack the attached source.tar.gz, it contains only the changed files and build.sh facilitating compilation
From root: apt install clang-9 gcc-9-aarch64-linux-gnu
Remove any other versions of clang. Then cd /usr/bin; ln -s clang clang-9; ln -s clang++ clang++-9; ln -s clang-cpp clang-cpp-9
Back in the Kernel dir, run build.sh and wait for the kernel to compile
Download bootimgtool and compile it (just "make")
Download the stock firmware
Extract boot.img from AP_A127FXX[...].tar.md5 (unpack using tar, ignore the .md5) to the root dir of your Kernel
bootimgtool disassemble boot.img
cp Kernel/arch/arm64/boot/Image kernel
bootimgtool create -o boot.img
Flash boot.img as is using Heimdall or pack into .tar and flash using Odin
P.S.: the U5 kernel sources are suspicously segregated between RR (rest of the world), EUR, CIS and CIS-SER (Russia). It's quite interesting what are the differences?
Click to expand...
Click to collapse
Please create working flashable zip file for twrp for a125f cause i dont have pc i cant use odin,thank you

Categories

Resources