[Q] Flashing LK Bootloader on Nexus 5 - Android Q&A, Help & Troubleshooting

Hello,
This is my first post here. I hope this is the right forum - new users are not allowed to post everywhere so I didn't have much choice.
I have LK bootloader source code which I need to build and flash to a Nexus 5 device.
* I got the source code from the Code Aurora website
* I made a guess which branch is the stable branch I need, because I found no mention of it anywhere (I took "kk_2.7-stable", where kk means kitkat)
* On a Debian 7 stable machine, I installed a GCC cross compiler from Deb packages built using Emdebian tools
* I made a guess which target to compile, because the exact chip name didn't have its own: I use msm8960
* I created some symlinks to the cross-building tools because the makefile and the debian cross-building tool names are different
* I ran 'make msm8960' and the build was successful (I also tried earlier with NDK prebuilt GCC but it failed)
* I got a bunch of files with no idea what to do with them
* I attached the device to the computer and re-flashed the stock bootloader to make sure it works
* I checked the fastboot screen: Bootloader unlocked, secure boot is on
* I tried flashing the 'lk' binary file I got from the build process, but fastboot says:
sending 'bootloader' (1702 KB)...
OKAY [ 0.239s]
writing 'bootloader'...
FAILED (remote: invalid bootloader image
)
The size of the file is much smaller than the size of the stock bootloader, but I don't know if it matters or what exactly I need to flash. I did a lot of web search, including here on XDA, but found no evidence of anyone struggling with flashing the bootloader.
What am I missing? How do I flash the bootloader after I build it?

qwertius said:
Hello,
This is my first post here. I hope this is the right forum - new users are not allowed to post everywhere so I didn't have much choice.
I have LK bootloader source code which I need to build and flash to a Nexus 5 device.
* I got the source code from the Code Aurora website
* I made a guess which branch is the stable branch I need, because I found no mention of it anywhere (I took "kk_2.7-stable", where kk means kitkat)
* On a Debian 7 stable machine, I installed a GCC cross compiler from Deb packages built using Emdebian tools
* I made a guess which target to compile, because the exact chip name didn't have its own: I use msm8960
* I created some symlinks to the cross-building tools because the makefile and the debian cross-building tool names are different
* I ran 'make msm8960' and the build was successful (I also tried earlier with NDK prebuilt GCC but it failed)
* I got a bunch of files with no idea what to do with them
* I attached the device to the computer and re-flashed the stock bootloader to make sure it works
* I checked the fastboot screen: Bootloader unlocked, secure boot is on
* I tried flashing the 'lk' binary file I got from the build process, but fastboot says:
sending 'bootloader' (1702 KB)...
OKAY [ 0.239s]
writing 'bootloader'...
FAILED (remote: invalid bootloader image
)
The size of the file is much smaller than the size of the stock bootloader, but I don't know if it matters or what exactly I need to flash. I did a lot of web search, including here on XDA, but found no evidence of anyone struggling with flashing the bootloader.
What am I missing? How do I flash the bootloader after I build it?
Click to expand...
Click to collapse
https://www.codeaurora.org/blogs/little-kernel-based-android-bootloader
I don't see any evidence of support for the Nexus 5 here. Playing with your bootloader like that is potentially very dangerous and could easily result in bricking your device, possibly beyond normal repair. What do you hope to accomplish with this? It seems like it would only be useful for older devices. I don't believe our devices have any bootloader weaknesses that really need to be addressed.

What about flashing the well-known bootloader for hammerhead??? HHZ11k

Primokorn said:
What about flashing the well-known bootloader for hammerhead??? HHZ11k
Click to expand...
Click to collapse
Isn't that just the newest stock one?
Off-Topic: I rock the Reborn theme too often.

es0tericcha0s said:
Isn't that just the newest stock one?
Click to expand...
Click to collapse
Yes it is, so I don't understand why someone would like to flash something else.
es0tericcha0s said:
Off-Topic: I rock the Reborn theme too often.
Click to expand...
Click to collapse

LoL Thought so. Seems like he knows just enough to get himself into trouble.

es0tericcha0s said:
LoL Thought so. Seems like he knows just enough to get himself into trouble.
Click to expand...
Click to collapse
LMAO
****************
FYI here is a link to download the flashable zip of the above version: http://forum.xda-developers.com/showpost.php?p=51593422&postcount=5

I'm trying to flash a modified bootloader, so I needed something I can edit on source code level, compile and flash. But it seems people use the freedom given by the MIT license to take away other people's freedoms: The source code of the Nexus 5 bootloader (although probably LK based, judging by the output of `strings`) is not available online.
I guess I'll need an older device which does have a bootloader with source code available, which I can modify. Somehow I got the impression Nexus 5 had such a bootloader. My mistake.

qwertius said:
I'm trying to flash a modified bootloader, so I needed something I can edit on source code level, compile and flash. But it seems people use the freedom given by the MIT license to take away other people's freedoms: The source code of the Nexus 5 bootloader (although probably LK based, judging by the output of `strings`) is not available online.
I guess I'll need an older device which does have a bootloader with source code available, which I can modify. Somehow I got the impression Nexus 5 had such a bootloader. My mistake.
Click to expand...
Click to collapse
Hi qwertius,
Did you end up getting far with this? It looks like the only way to modify the LK Bootloader is to load it into IDA / a debugging and patch your way.
I have a OnePlus One that I'm trying to patch, I doubt any vendor would release their bootloader source.

Related

[Q] Looking for CWM porting help

I have been working tirelessly on getting a working CWM recovery built from source to work on this device. The device is the BLU Studio 5.5, also known as the 'd610'. I am attempting to compile from the cm-10.1 branch
My current device tree for the device can be found here.
What I have tried so far:
-modifying BoardConfig.mk and recovery.fstab to match what I am able to pull from the device and adding the init.rc and its dependencies into the recovery build (did not boot)
-building the recovery of another very similar MTK6589 device and using the kernel pulled from the d610 instead. (did not boot)
-forked the device tree of this very similar device, and made slight modifications to BoardConfig for my device, as well as swapping the kernel (again, did not boot)
I have absolutely no idea what is going wrong in my process. All of the builds of CWM compile fine, and are being flashed via mtk-tools just fine. Though something is not allowing these builds to boot into recovery. I think I may be missing some important information on the MTK6589 or Mediatek in general.
Thank you for any input you guys can offer.
Also, if I am in the wrong section, if a moderator could kindly place it in the correct section, that would be great!
From a quick glance I can tell you are missing ramdisk address offset, these are are usually hardcoded in the BL, you can check the address from boot image header
Sent from my LG-D605 using Tapatalk
Okay I will be adding that in here shortly. I haven't seen that flag used very often in BoardConfig when I look at other device trees. Is it possible that anyone could explain why some devices may need the flag while others don't?
And again thank you for your response!
EDIT: added ramdisk offset arguments, and still no luck on getting the recovery to boot.
Sent from my Nexus 5 using XDA Free mobile app
Update: I am trying to unpack my recovery.img files after compilation using these scripts, which have always worked for me in the past. Now that I am trying to unpack after these are built, I am finding that they are unable to detect the ramdisk in the recovery.img. I think this may be because the ramdisk may be in the wrong place. Though I have built the recovery with and without the offset flags, and still it cannot detect the ramdisk.
Also, I pushed more of the proper files that were pulled from the stock recovery.
I have also decided that I am willing to offer a small bounty to anyone that wants to help me find the solution along with some explanation of where it went wrong.

Venue 7840 Kernel Sources, Bootloader unlock + KK OTA zip Released

Venue 7840 Kernel Sources, Bootload unlock + KK OTA zip Released
Dell has posted the kernel sources in their open-source section: http://opensource.dell.com/releases/Venue_8_7840_Merrifield/
Not too much use since we still have no tools to unlock the bootloader and no OTA zips but I assume those are to come.
EDIT:
Dell alerted me that they've pushed the bootloader unlock tools, OTA, an updated kernel package and an instructional PDF to their opensource page.
http://opensource.dell.com/releases/Venue_8_7840_Merrifield/developer-edition/
What interest me is the fact they included a test key for signing the boot.img this device has never been confirmed locked but up till now their hasn't even been a tool for generating a compatible image playing tonight might go buy one in the morning.
social-design-concepts said:
What interest me is the fact they included a test key for signing the boot.img this device has never been confirmed locked but up till now their hasn't even been a tool for generating a compatible image playing tonight might go buy one in the morning.
Click to expand...
Click to collapse
I did notice this. I remember when the tablet was originally showcased a couple of sites wrote that it was going to be shipped with an unlocked bootloader - maybe that's the case. Like you say, I don't think anyone's confirmed it either way yet.
I think you just confirmed it's locked, else you wouldn't need to sign anything.
vampirefo said:
I think you just confirmed it's locked, else you wouldn't need to sign anything.
Click to expand...
Click to collapse
Personally I wouldn't mind a device that was locked as long as the manufacturer allowed for the end user to inject its own trusted keys as needed.
social-design-concepts said:
Personally I wouldn't mind a device that was locked as long as the manufacturer allowed for the end user to inject its own trusted keys as needed.
Click to expand...
Click to collapse
If that was the case, why bother locking them in first place. I doubt the key included is going to help.
Anyway good luck.
sent from my kingSing T1 via taptalk
I've just made a lowest-effort attempt at building, by running the included kernel_build.sh and the whole thing fails miserably, because the build script tries to source build/envsetup.sh which it turns out, does not exist.
EDIT: I'm dumb please don't laugh.
xBIGREDDx said:
I've just made a lowest-effort attempt at building, by running the included kernel_build.sh and the whole thing fails miserably, because the build script tries to source build/envsetup.sh which it turns out, does not exist.
Click to expand...
Click to collapse
There is a lot more to building this kernel than simply clicking the kernel_build.sh, you would need to setup a build environment.
I don't have this tablet, so not really interested in building kernel, I wanted to see test.pem, I did look at kernel_build.sh and it tells me exactly what it's going to do, and that I need to setup a aosp build environment, 7th line down (lunch aosp_x86-eng).
Anyway I don't think there is anything here for me, eg nothing I can use, will test key later just to see.
Ah, I haven't built a kernel in ages. And I think my last one was part of CM. Do I drop this on top of AOSP source?
Well, I was bored so I built the kernel, just to see what would happen, kernel builds exactly as it should. The interesting stuff it builds is.
extra_certificates
signing_key.priv
signing_key.x509
x509.genkey
.config
Makefile
Code:
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/vmlinux.bin
HOSTCC arch/x86/boot/tools/build
BUILD arch/x86/boot/bzImage
Setup is 15504 bytes (padded to 15872 bytes).
System is 6474 kB
CRC 3de305f4
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
Looks like a few modules don't build.
Code:
INSTALL sound/soc/intel/board/snd-merr-dpcm-wm8958.ko
INSTALL sound/soc/intel/board/snd-merr-saltbay-wm8958.ko
INSTALL sound/soc/intel/snd-soc-sst-platform.ko
INSTALL sound/soc/intel/sst/snd-intel-sst.ko
DEPMOD 3.10.20
make[1]: Leaving directory `/home/vampirefo/intel/linux/kernel'
DEPMOD 3.10.20
depmod: WARNING: could not open /home/vampirefo/intel/out/target/product/iconic/linux/kernel/fakedepmod/lib/modules/3.10.20/modules.order: No such file or directory
depmod: WARNING: could not open /home/vampirefo/intel/out/target/product/iconic/linux/kernel/fakedepmod/lib/modules/3.10.20/modules.builtin: No such file or directory
kernel build done
./xfstk-stitcher: error while loading shared libraries: libMerrifieldSigning.so.1: cannot open shared object file: No such file or directory
build finished.
Aye, I got to the same point earlier today. The script runs fine, the kernel builds apart from the few modules and it then fails on the boot.img stitcher.
anggusss said:
Aye, I got to the same point earlier today. The script runs fine, the kernel builds apart from the few modules and it then fails on the boot.img stitcher.
Click to expand...
Click to collapse
stitcher is corrupt, Dell put out a bad file, to keep people from signing the boot.img, You may be able to flash unsigned boot.img if your bootloader is unlocked, if bootloader is locked your tablet wont boot.
stitcher is corrupt, Dell put out a bad file, to keep people from signing the boot.img
Click to expand...
Click to collapse
I wouldn't call it corrupt, they just haven't provided some of the libraries it depends on (albeit, some are related to signing). The executable is still valid, it's just useless.
Code:
libMerrifieldSigning
libhsmlib2-1004-32
libTMT_API
Are the dependencies missing. It also depends on libxfstk-dldr-api but that's available from http://sourceforge.net/p/xfstk/
You may be able to flash unsigned boot.img if your bootloader is unlocked, if bootloader is locked your tablet wont boot.
Click to expand...
Click to collapse
Aye, I'm aware - I'm waiting on Dell to get back to me regarding unlocking of the bootloader.
anggusss said:
Aye, I'm aware - I'm waiting on Dell to get back to me regarding unlocking of the bootloader.
Click to expand...
Click to collapse
I've been waiting on Dell to get back to me on that and well anything else for 13 months now.
You could probably use the xfstk-stitcher from the 3x40 series to generate an unsigned boot.img
social-design-concepts said:
I've been waiting on Dell to get back to me on that and well anything else for 13 months now.
You could probably use the xfstk-stitcher from the 3x40 series to generate an unsigned boot.img
Click to expand...
Click to collapse
unsigned boot.img is already created, trying to sign the unsigned boot.img is the problem.
vampirefo said:
unsigned boot.img is already created, trying to sign the unsigned boot.img is the problem.
Click to expand...
Click to collapse
It's not bootable or flashable with out stitching it with the xfstk-stitcher
I've been waiting on Dell to get back to me on that and well anything else for 13 months now.
Click to expand...
Click to collapse
They just got back to me - I've updated the main post. They've posted bootloader unlock tools, updated kernel package, OTA zip and an instructional PDF to the opensource page.
The updated kernel package removes xfstk-stitcher and the keys that were in the last archive, haven't diff'd anything else yet.
anggusss said:
They just got back to me - I've updated the main post. They've posted bootloader unlock tools, updated kernel package, OTA zip and an instructional PDF to the opensource page.
The updated kernel package removes xfstk-stitcher and the keys that were in the last archive, haven't diff'd anything else yet.
Click to expand...
Click to collapse
I see this tool is for Linux, nice on that part, also the bootloader comes locked, that is 100% confirmed now.
---------- Post added at 11:42 AM ---------- Previous post was at 11:16 AM ----------
Dell hooked you guys up, They include a unpacking and repacking boot.img script, So you all can unpack and repack boot.img, hopefully works on recovery.img as well, if it does, you guys can flash permanent recovery.
Dell has given this open source more than any other tablet.
compiling kernel now.
Kernel compile works now as it should, end up with boot.img now.
kernel build done
Unpacking boot-intel-unsigned.img into tmp_boot_unpack
kernel size 6463488
ramdisk size 3227648
Write tmp_boot_unpack/sig
Write tmp_boot_unpack/cmdline.txt
Write tmp_boot_unpack/parameter
Write tmp_boot_unpack/bootstub
Write tmp_boot_unpack/kernel
Write tmp_boot_unpack/ramdisk.cpio.gz
Unpacking ramdisk to tmp_boot_unpack/extracted_ramdisk
Packing directory [ tmp_boot_unpack/extracted_ramdisk ] => ramdisk.cpio.gz
Read tmp_boot_unpack/kernel
Read tmp_boot_unpack/ramdisk.cpio.gz
Read tmp_boot_unpack/cmdline.txt
Read tmp_boot_unpack/parameter
Read tmp_boot_unpack/sig
Read tmp_boot_unpack/bootstub
Write boot.img
build finished.
vampirefo said:
I see this tool is for Linux, nice on that part, also the bootloader comes locked, that is 100% confirmed now.
---------- Post added at 11:42 AM ---------- Previous post was at 11:16 AM ----------
Dell hooked you guys up, They include a unpacking and repacking boot.img script, So you all can unpack and repack boot.img, hopefully works on recovery.img as well, if it does, you guys can flash permanent recovery.
Dell has given this open source more than any other tablet.
Click to expand...
Click to collapse
did you ever figure out if that test key was standard aosp or an intel / dell test key i'm still interested in it since they went back to an unsigned image format.
the one image i made signing with it doesn't boot but also doesn't error immediately after rebooting from flash the way images with an incorrect signature / unsigned image does so i'm curious if maybe my platform.xml file is configured wrong.
but at least i can buy one of these tablets now that its unlocked
---------- Post added at 01:06 PM ---------- Previous post was at 12:55 PM ----------
anggusss said:
They just got back to me - I've updated the main post. They've posted bootloader unlock tools, updated kernel package, OTA zip and an instructional PDF to the opensource page.
The updated kernel package removes xfstk-stitcher and the keys that were in the last archive, haven't diff'd anything else yet.
Click to expand...
Click to collapse
What address are you email them @
At this point i really don't care if Dell unlocks the DV7 3730 bootloader or not i just want a logical explanation of why they they did it for all the other Dell Intel Android Tablets 3830 , 3740 , 3840 , and 7840 but haven't for the 3730
social-design-concepts said:
did you ever figure out if that test key was standard aosp or an intel / dell test key i'm still interested in it since they went back to an unsigned image format.
the one image i made signing with it doesn't boot but also doesn't error immediately after rebooting from flash the way images with an incorrect signature / unsigned image does so i'm curious if maybe my platform.xml file is configured wrong.
but at least i can buy one of these tablets now that its unlocked
---------- Post added at 01:06 PM ---------- Previous post was at 12:55 PM ----------
What address are you email them @
At this point i really don't care if Dell unlocks the DV7 3730 bootloader or not i just want a logical explanation of why they they did it for all the other Dell Intel Android Tablets 3830 , 3740 , 3840 , and 7840 but haven't for the 3730
Click to expand...
Click to collapse
I believe the key is Dell"s they made a mistake by releasing it, not able to do much with key yet, still trying to see proper way to use.
However the unpack/repack boot.script in this release seems to work on all Dell venues, or at least the ones I tried including recovery.img.

[GUIDE]Change your OEM splash screen

Hello there,
as you may know you can change the oem splash screen on the OnePlus 3, as provided in this thread by @makers_mark here.
That program only needs minor fixes to work with OnePlus 3T splash partitions, and I have attached the source code and a windows binary below.
To use it, extract the "OnePlus3TInjector.zip" and run the commands in the command prompt in the folder you extracted the zipfile into.
To decode use:
Code:
OP3TInject -i LOGO.bin -D
After having changed the image files, use
Code:
OP3TInject -j fhd -i LOGO.bin
I have tested this and it works on my phone, but you still have to USE THIS ON YOUR OWN RISK.
If you want to see how this looks, take a look at this video here: https://www.youtube.com/watch?v=DWj2WRpcoqI
If you want a custom bootlogo but can't use the tool you can pm me an image file or post one here down below. I will send you a zip file that you can flash in recovery.
To use this, get the "Stock" zip from below, and replace the modified.logo.bin in it with the one produced by the injector, then flash in your recovery.
If you do not want to use your recovery use a terminal emulator on your phone and run the command as root:
Code:
dd if=/sdcard/Downloads/modified.logo.bin of=/dev/block/platform/soc/624000.ufshc/by-name/LOGO"
To go back to stock logo.bin, flash the zip file attached below.
Please note that this does not remove the warning that your phone is unlocked.
Finally a big shoutout to @prmcmanus who tested this for me. Leave him a like!
I also thank @makers_mark for all the work he has done on the OnePlus 3 and the original OP3Injector.
Jo_Jo_2000 said:
Hello there,
as you may know you can change the oem splash screen on the oneplus 3, as provided in this thread here:
That program only needs minor fixes to work with OnePlus 3T splash partitions.
Unfortunately I cannot provide a compiled program here because the original program was not published under a proper license, but I can tell you that you just need to change line 35 of the file "src/LogoInjector.v1.4.c" from the zip archive linked in the thread below to be "#define MAXOFFSETS 32" instead of "#define MAXOFFSETS 28" and recompile the program.
I have not yet tested it, so I do not know whether this works or just bricks your phone, so USE THIS ON YOUR OWN RISK.
If you want to test this for me, but do not want to compile the program yourself, you can flash my "beta-test" version linked below. Follow the instructions from the original thread above. Remember to backup your current LOGO partition.
Note to moderators:
I know that this should rather belong into the development section, but I do not yet have enough posts to post there, so I put it in here. Sorry about that but I do not want to randomly spam other threads to get the 10 responses needed.
Click to expand...
Click to collapse
Thanks. I put in a bit of time trying to figure this out with a 3t and git code. First: I wasn't interested in the "logo" partition exactly, but more about that "unlocked bootloader" and it's associated tag warning and timeout that comes up each boot after unlocking bootloader. I found the timeout and the text that goes on the screen here in the code (the bootable bootloader code) : ~/sandbox/oneplus3t/bootable/bootloader/lk/app/aboot/aboot.c : I even tested changing that, but there was no easy way to to "give it out" aside from as part of a custom ROM done from source.
Are we talking about the same thing? Or : are you talking about just replacing one logo partition content with another and it has nothing to do with the unlocked tag warning & timeout (5 sec.)?
Thanks.
---------- Post added at 05:06 AM ---------- Previous post was at 04:48 AM ----------
OK: I checked it out and it has nothing to do with the unlocked bootloader warning, which I'm working on as said above and have gotten rid of on my own phone (which I no longer have..). That's completely about the file I mentioned above "aboot.c" in bootable/bootloader/... tree.
But nice going anyway, -- thanks.
Nope, these are different things. I'm refering to the logo partition which stores images while the warning message is hardcoded into the bootloader which you probably cant change because it's signed by OnePlus.
Also OnePlus hasn't released their bootloader sources (I think) and the bootloader in the source tree is just the generic base for all quallcomm bootloaders (aka Little Kernel).
So sorry to disappoint you but you won't be able to remove that warning with LOGO editing.
Jo_Jo_2000 said:
Nope, these are different things. I'm refering to the logo partition which stores images while the warning message is hardcoded into the bootloader which you probably cant change because it's signed by OnePlus.
Also OnePlus hasn't released their bootloader sources (I think) and the bootloader in the source tree is just the generic base for all quallcomm bootloaders (aka Little Kernel).
So sorry to disappoint you but you won't be able to remove that warning with LOGO editing.
Click to expand...
Click to collapse
So the rom I built from their 3t sources must have used boot.img as a "prebuilt"? Does that sound right? I guess I could unpack boot.img and figure out how to get rid of the delay with a binary overwrite. (I wouldn't look forward to testing that ;
It's in the bootLOADER which is not a prebuilt nor a thing you build yourself when you build a custom rom. Its build, maintained and signed by OnePlus so they and only they can alter the bootloader (I think so, maybe "flashing unlock_critical" does the trick here, but dont try it or you will irreversibly hard brick your phone).
Also good luck with a binary overwrite, I hope you know ARM assembly.
To get that clear, the warning message has got _nothing_ to do with boot.img, they are two completely different things and no matter what you do with a boot.img, you won't get rid of that warning!
I know there's a flashable .bin that gets rid of that exact same unlocked bootloader msg and delay on the moto x pure 2015 (XT1575). Maybe it's similar. I've attached the file.
I doubt that this will work... the original logo.bin is about 16mb and even if I just repack it with the original images it's only about 700kb
noahvt said:
I doubt that this will work... the original logo.bin is about 16mb and even if I just repack it with the original images it's only about 700kb
Click to expand...
Click to collapse
Good that you are concerned and looking for errors I might have made!
However I am very certain that the file indeed is only .7 MB large because:
1. That program (without mods) works on the oneplus 3, whose file is also only about that large
2. The first 786432 bytes (the size of the recoded file) of the original LOGO.bin dump are identical
3. the remaining 16 mb are zeroed out and contain no data
4. the program produces correct images
I would be happy to try it out, because I do not have access to a PC where I can run the MSM Downloader in case I brick things!
Greetings.
g96818 said:
I know there's a flashable .bin that gets rid of that exact same unlocked bootloader msg and delay on the moto x pure 2015 (XT1575). Maybe it's similar. I've attached the file.
Click to expand...
Click to collapse
The OnePlus 3t's warning is hardcoded into the bootloader, so unless you find a bug in sbl1 or break rsa you won't get around that.
I compiled this and got it working, but can't share for the same reasons as OP.
If anyone wants a custom logo, PM me the picture and I'll make an image file for you
prmcmanus said:
I compiled this and got it working, but can't share for the same reasons as OP.
If anyone wants a custom logo, PM me the picture and I'll make an image file for you
Click to expand...
Click to collapse
So you can use this without bricking your phone?
Jo_Jo_2000 said:
So you can use this without bricking your phone?
Click to expand...
Click to collapse
Yep, working on mine
Hey, @prmcmanus... PM'ed you!
@Ker~Man did you get my reply? It doesn't look like Quick Reply works :-S
prmcmanus said:
@Ker~Man did you get my reply? It doesn't look like Quick Reply works :-S
Click to expand...
Click to collapse
I sure did, and thank you! How do I install these, though? Flash in TWRP? I'm not too keep with .bin files. Thanks again!
Ker~Man said:
I sure did, and thank you! How do I install these, though? Flash in TWRP? I'm not too keep with .bin files. Thanks again!
Click to expand...
Click to collapse
look in my opening post, I've written two methods there.
Ker~Man said:
I sure did, and thank you! How do I install these, though? Flash in TWRP? I'm not too keep with .bin files. Thanks again!
Click to expand...
Click to collapse
Put the phone in fastboot mode and flash:
Code:
fastboot flash LOGO filename.bin
Jo_Jo_2000 said:
look in my opening post, I've written two methods there.
Click to expand...
Click to collapse
That 2nd method, I didn't know you could do that in the terminal! Nice
Jo_Jo_2000 said:
Hello there,
as you may know you can change the oem splash screen on the OnePlus 3, as provided in this thread here:
That program only needs minor fixes to work with OnePlus 3T splash partitions.
Unfortunately I cannot provide a compiled program here because the original program was not published under a proper license, but I can tell you that you just need to change line 35 of the file "src/LogoInjector.v1.4.c" from the zip archive linked in the thread below to be "#define MAXOFFSETS 32" instead of "#define MAXOFFSETS 28" and recompile the program.
Click to expand...
Click to collapse
I apologize for not responding to you soon enough. When I figure out an encoding, I release the source code for the encoder and decoder that I build for a couple of reasons. And one of those reasons is so you can do like you did! And you did it right! Thanks for asking and giving a link which in my book is good enough for proper credit. Feel free to share the binary with whoever:good:
I replaced the logo injector .zip file because it created an error when executed by some people.
You can use it now.
Jo_Jo_2000 said:
I replaced the logo injector .zip file because it created an error when executed by some people.
You can use it now.
Click to expand...
Click to collapse
Does my device have to be "Critical Unlocked"? I have an unlocked bootloader but when I try "fastboot flash LOGO" I get "FAILED (remote: Partition flashing is not allowed)"
EDIT: flashing it with dd works though

[DEV] Compiled Stock Kernel + Sources

Compiled Stock Kernel + Sources
*insert usual disclaimer here*
I AM NOT RESPONSIBLE FOR ANY DAMAGE TO YOUR DEVICE. USE AT YOUR OWN RISK. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Testing? What will work?
Bugs:
- You tell me
INSTRUCTIONS
0. MAKE BACKUP
1. Download zip file
2. Download Magisk
3. Download Magisk fix
4. Flash Magisk
5. Flash Magisk fix
6. Flash Kernel zip
Resources:
SOURCE CODE
DOWNLOAD {Mod edit}
Credits:
karthick111
@datty
Hi mKenfenheuer, thanks for the credit.
I'm at the same point, I can get the kernel to build but no boot. I get dropped back to fastboot immediately after trying to boot.
I've tried flashing a blank vbmeta, but it didn't seem to help. I'm not sure if it is the AVB2.0 blocking the boot or something else.
I've noticed you've changed OPPO_TARGET_DEVICE to MSM_19061. How did you decide on that value? I've since been using MSM_19781 as that is the value of getprop ro.product.prjversion from my device (Malaysian version)
datty said:
Hi mKenfenheuer, thanks for the credit.
I'm at the same point, I can get the kernel to build but no boot. I get dropped back to fastboot immediately after trying to boot.
I've tried flashing a blank vbmeta, but it didn't seem to help. I'm not sure if it is the AVB2.0 blocking the boot or something else.
I've noticed you've changed OPPO_TARGET_DEVICE to MSM_19061. How did you decide on that value? I've since been using MSM_19781 as that is the value of getprop ro.product.prjversion from my device (Malaysian version)
Click to expand...
Click to collapse
Same behaviour for me. I've started with the target device mentioned in your repo, then changed to 19781, afterwards i've been trying out the ones from drivers/input/oppo_fp_driver/Makefile. I've just been stuck at 19061 since it was the last one i've tried, there is no specific reason for that.
I've not been working with devices with AVB 2.0 - i can see that my device is displaying "Secureboot enabled" in fastboot. As far as i can say this would be a pretty good reason for the device to refuse booting the new kernel as our kernel is probably not signed.
I'll look into signing the kernel with the dev key in the repo root. Maybe this helps. If not we would problaby need another solution to get around the secure boot.
I've made some progress, I can get the kernel to try to boot but I'm stuck at the realme logo without adb to debug what is wrong.
If you're using the kernel config extracted from the device, add the following config option.
CONFIG_BUILD_ARM64_DT_OVERLAY=y
I'm not sure if this is also necessary but I generated a new dtbo.img to flash from the compiled kernel.
You'll need mkdtboimg.py and you can run the following from the out/arch/arm64/boot directory after compilation.
python mkdtboimg.py create dtbo.img dts/*/*.dtbo
You can try to compare arter97 realme X kernel to raw source if it's any helpful.
datty said:
I've made some progress, I can get the kernel to try to boot but I'm stuck at the realme logo without adb to debug what is wrong.
If you're using the kernel config extracted from the device, add the following config option.
CONFIG_BUILD_ARM64_DT_OVERLAY=y
I'm not sure if this is also necessary but I generated a new dtbo.img to flash from the compiled kernel.
You'll need mkdtboimg.py and you can run the following from the out/arch/arm64/boot directory after compilation.
python mkdtboimg.py create dtbo.img dts/*/*.dtbo
Click to expand...
Click to collapse
Unfortunately i cannot. even with the config option i am still not able to get it booting.
I have created a repo to reflect how i am building the kernel and making the boot img + dtbo img.
https://github.com/mKenfenheuer/realme-X2Pro-kernel-build
Am i missing something? Also i assume that my generated dtbo.img is bad, as soon as i flash it, i cannot even boot to recovery.
This is a long shot but as @SHiFT! pointed out, maybe comparing the source of @arter97 can help us getthing this mess to boot.
mKenfenheuer said:
Unfortunately i cannot. even with the config option i am still not able to get it booting.
I have created a repo to reflect how i am building the kernel and making the boot img + dtbo img.
https://github.com/mKenfenheuer/realme-X2Pro-kernel-build
Am i missing something? Also i assume that my generated dtbo.img is bad, as soon as i flash it, i cannot even boot to recovery.
Click to expand...
Click to collapse
Try using the Image-dtb file rather than the plain Image to add to boot.img. You might need to change your make line to the following to get it to generate:
make -j$(nproc --all) O=out CC=clang CLANG_TRIPLE=aarch64-linux-gnu- Image-dtb dtbs
For the dtbo.img, it looks like you're adding *.dtb rather than *.dtbo.
I'll try and upload my build scripts later tonight, I'm at work at the minute and can't get to them.
I've made a little more progress, I've managed to get adb to come up at early boot so I can get a logcat and shell. The kernel looks to be failing on the audio and wireless at the minute from what I can see.
Thanks for the pointer to arter97's kernel. I can see where I've missed adding the external wifi module in, I'll give that a go and hopefully it gets a little further.
datty said:
Try using the Image-dtb file rather than the plain Image to add to boot.img. You might need to change your make line to the following to get it to generate:
make -j$(nproc --all) O=out CC=clang CLANG_TRIPLE=aarch64-linux-gnu- Image-dtb dtbs
For the dtbo.img, it looks like you're adding *.dtb rather than *.dtbo.
I'll try and upload my build scripts later tonight, I'm at work at the minute and can't get to them.
I've made a little more progress, I've managed to get adb to come up at early boot so I can get a logcat and shell. The kernel looks to be failing on the audio and wireless at the minute from what I can see.
Thanks for the pointer to arter97's kernel. I can see where I've missed adding the external wifi module in, I'll give that a go and hopefully it gets a little further.
Click to expand...
Click to collapse
My kernel is booting now, but wifi and aod are causing issues.
As for now, the zip requires magisk to be flashed first.
I've had some chat with other devs working on our devices kernel in the official telegram group, they're in touch with realme, realme will release their wifi driver from qualcomm soon on their github.
Credits for getting me up to here go to karthick111 from the telegram group.
Realme kernel source code got updated. Any great news?
BlazeMaster64 said:
Realme kernel source code got updated. Any great news?
Click to expand...
Click to collapse
No. I've imported the changes by realme, things got worse. Now the kernel is not booting anymore.
I'll look into this once i've got more time
mKenfenheuer said:
No. I've imported the changes by realme, things got worse. Now the kernel is not booting anymore.
I'll look into this once i've got more time
Click to expand...
Click to collapse
Do you think this phone is worth buying over xiaomi redmi k20 pro?
BlazeMaster64 said:
Do you think this phone is worth buying over xiaomi redmi k20 pro?
Click to expand...
Click to collapse
Of course it's a better phone in almost all terms
Great news! Turns out that the changes by realme actually fix the AoD and the reason why the kernel was not booting was my fault, i still had unfinished changes regarding SafetyNet which got compiled and caused the kernel to panic (i'd do that too if i were him).
So the current status is that now all main functionalities work as i was able to fix wifi too (with a little help of arter97).
All changes can be found in my github repo so feel free to fork!
mKenfenheuer said:
Great news! Turns out that the changes by realme actually fix the AoD and the reason why the kernel was not booting was my fault, i still had unfinished changes regarding SafetyNet which got compiled and caused the kernel to panic (i'd do that too if i were him).
So the current status is that now all main functionalities work as i was able to fix wifi too (with a little help of arter97).
All changes can be found in my github repo so feel free to fork!
Click to expand...
Click to collapse
Good job ,that's a good news Go on
If I may ask after you finish working in the kernel would it be easy to build custom roms with the help of your kernel ,Thanks to you
Hi. Thank you for your kernel. I'm a bit noob about kernel, so it's difficult to me understand kernel's features. What's this kernel different then the stock one?
asusgarb said:
Hi. Thank you for your kernel. I'm a bit noob about kernel, so it's difficult to me understand kernel's features. What's this kernel different then the stock one?
Click to expand...
Click to collapse
It's a work in progress to have a working kernel base for our phone which will then be useful for other people to build their own customized kernel with it.
Is the FP issue an kernel related issue? Or overlay?
natedogg20050 said:
Is the FP issue an kernel related issue? Or overlay?
Click to expand...
Click to collapse
What do you mean by FP issue? In case you are refering to the issues with GSI's, check out the issues on phhussons github:
https://github.com/phhusson/treble_experimentations/issues/1103
The cause of this is Realme/Oppo not sticking to standards and of course the fact that the in display fp reader is quite new and does not have any generic stock implementation yet.
So TL;DR its not a kernel issue. Phhusson is working on this with Google.
realme x2pro cm rom
---------- Post added at 12:22 PM ---------- Previous post was at 12:17 PM ----------
John Amin said:
Good job ,that's a good news Go on
If I may ask after you finish working in the kernel would it be easy to build custom roms with the help of your kernel ,Thanks to you
Click to expand...
Click to collapse
sir videos

Compiled xioami vayu official kernel source, finished with Image-dtb produced but lots of warnings generated

any1 could enlighten me what's going wrong? or just leave it?
Kernel log
If that is all you got of warnings you don't need to worry.
Those are all dtb warnings. It means that the dtsi-files are not quite following the format rules, but it's always been like that for qcom dtsi's.
askermk2000 said:
If that is all you got of warnings you don't need to worry.
Those are all dtb warnings. It means that the dtsi-files are not quite following the format rules, but it's always been like that for qcom dtsi's.
Click to expand...
Click to collapse
Thx for clarification
So my compiled kernel should be no problem to flash to my device then?
My phone still yet to unlock the bootloader, so need to confirm b4 proceed with it or else everthing have to be set back but kernel nothing changing...
After you unlock bootloader, it should be fine, judging from a compilation perspective. Sometimes the official source lacks things, which could make the kernel either not work, or only partially work.
askermk2000 said:
After you unlock bootloader, it should be fine, judging from a compilation perspective. Sometimes the official source lacks things, which could make the kernel either not work, or only partially work.
Click to expand...
Click to collapse
Yes, i awared of this too, i have some experience in this part on my old device, and in fact i found a comprehensive guide to compile the kernel of my current device, so should be no problem i guess, thx

Categories

Resources