Help building Lineageos kernel from source - Xiaomi Mi 5s Questions & Answers

I'm no expert and just wanted to try and build Mi5s lineageos kernel with just a few minor changes, not the whole rom, but after flashing it doesn't boot.
This is more or less what I've done:
Downloaded lineageos Mi5s source:
https://github.com/LineageOS/android_kernel_xiaomi_msm8996
Downloaded Gooogle's prebuilt toolchain:
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/
Setup a build system following guides/tutorials from here and there.
Got it to successfully build after a few fixes to source but it doesn't pass the Mi logo.
The 3 images in the output folder are, Image, Image.gz and Image.gz-dtb, from what I've read in various tutorials was to use the Image.gz-dtb image.
So initially I unpacked stock lineageos boot.img and repacked it with my compiled Image.gz-dtb, also I've tried Anykernel2, but it just results in a non booting kernel.
I'm not sure what I'm missing and any help is really appreciated.

Related

Source for sbin/init

Hi,
I've followed various posts on here and have managed to compile and install my own kernel build. I am using the leshak initramfs and would like to be able to modify the init executable that lives in the sbin folder.
I've had a search around and can't work out if there is any source code available to build this or if it just pulled directly from the device. Can anyone confirm if and how it is possible to build this executable?
Thanks in advance,
Jamie
Theres no source from Samsung available.
You can try official android sources:
http://android.git.kernel.org/?p=pl...dc717ed167482c09f342730f1c1f64b90d19c;hb=HEAD

Build Issues with aosp source

So I have been trying to get a functional build of this devices kernel for a while now and I have to say it sucks.
My first problem was finding the actual kernel source which isn't on the aosp site but rather in the chromium source. When I finally found the kernel source for it, I was greeted with an absurd amount of branches. I mean aosp has like 6 branches for a device after 4 or so years and this device has countless branches referencing its multitude of names (pixel c, ryu, smaug, and dragon). Anyways I decided to pick the chromeos-3.18 branch (https://chromium.googlesource.com/chromiumos/third_party/kernel/+/chromeos-3.18) not sure if this is right. Then I spent forever looking for a fitting defconfig which there was none, only to find you have to run a script with the right flavor and device to create the defconfig. I finally got that done and got a dragon_defconfig that let me build a kernel binary.
Here is where I am stuck. So before I went to substitute this binary in the boot image I just wanted to try making a boot image with the stock provided kernel.
I was able to build using "make bootimage" and got a boot image that sent me into a bootloop. And this is with the 6.0.1r16 branch with no modifications. I looked into the dragon-kernel and noticed the provided kernel file is a file called Image.fit which is the first time seeing such a file format. The kernel binary I created was just an "Image" and a compressed version "Image.gz" but neither is anything like the Image.fit file that is provided.
Either way I am really stuck and the lack of documentation pertaining to the pixel kernel source is frustrating. Can anyone help me out?

[Kernel][7.1.1] SunKernel Pedigree Z5 for LineageOS [sumire]

A custom Kernel for LineageOS 7.1.1 based on the ideas and experiences of SunKernel corona (StockKernel) for Xperia Z5 series
XDA:DevDB Information
SunKernel Pedigree Z5 for LineageOS, Kernel for the Sony Xperia Z5
Contributors
zacharias.maladroit
Kernel Special Features: FauxSound, KCAL, reworked thermal engine, fast camera, etc.
Version Information
Status: Beta
Current Beta Version: 1.3
Beta Release Date: 2017-03-14
Created 2017-03-14
Last Updated 2017-08-30
Reserved
Changelogs:
14.1_I
initial release - Features:
Click to expand...
Click to collapse
14.1_I.2
changes ...
Click to expand...
Click to collapse
14.1_I.3
add throttling for orientation sensor input events (most likely NOT needed) to cut idle cpu high load of 15-20%
Click to expand...
Click to collapse
14.1_I.4
removed lots of sources for log-spam (dmesg/kernel-log)
BCL<-->KTM interface for BCL (battery_current_limit) driver is now used, faster, more reliable (less overlapping) and better hotplug during thermal events, etc.
more reliable bcl mitigation due to fresh SoC value, allowing frequency-based mitigation even with BCL set to off
MUCH improved sound output
more reliable sound playback
Click to expand...
Click to collapse
Reserved
Kernel Releases (Betas for now):
Link to custom LineageOS 14.1 build (patchlevel March 5th 2017)
not sure what differs between this and the other builds:
https://drive.google.com/open?id=0BykGGWB96CBQR1VIb3QtdGpsTmM
I initiated the fetch of the repo files via
lunch lineage_sumire-userdebug
and added the blobs repo,
then restarted the build ...
From now on
both LineageOS and Resurrection Remix are unified builds that work on Single SIM and Dual SIM devices - no separate kernel or ROM needed !
Resurrection Remix: already IS the unified build (thread is currently parked at the General Subforum: Resurrection Remix 5.8.2 for Xperia Z5 (unified build) )
LineageOS: please download the unified LineageOS builds from olivier: lineageOS ROM (as mentioned at: LineageOS thread )
those are NOT boot-tested but should work (need testing + feedback)
Reserved (3)
Notes:
The preamp of FauxSound or the actual sound/soc driver state seems to be a bit "mushy",
thus the white noise (swoosh-ing, hiss-ing) is a bit high - reduce headphone amp by 10 or 15 (-10 or -15) so that you get a clear and well-defined output,
it really depends on your headphones - with in-ear it is most likely more noticable.
This was with unmodified "stock"/"upstream" lineageOS kernel source and with a bit patched up - so nothing I can and will change
Kernel source:
https://github.com/zachariasmaladro...kami_r2/commits/Sun-Kernel_Pedigree_cm-14.1_I
Thanks, I hope you don't forget dsds variant.
It is a pleasure to have SunKernel in LineageOS.
Thanks @zacharias.maladroit
I will try after released stable LineageOS for dsds and SunKernel.
Flashing lineage and kernel, looking forward to try it
Thanks for upload
s.hossein said:
Thanks, I hope you don't forget dsds variant.
Click to expand...
Click to collapse
you have an up-to-date boot.img for dsds device ?
if yes, please upload
Thx! But After flashing this Kernel i couldnt Boot up. Stuck ar Boot Animation. But the Animation did not stopped.
Same here, bootloop, can u look up to this?
We are so glad you put efforts in custom kernel for lineage, looking forward for an update
zacharias.maladroit said:
you have an up-to-date boot.img for dsds device ?
if yes, please upload
Click to expand...
Click to collapse
I think the tree sources are unified so is there a need for special kernel for dsds? I'll try this one on my E6683.
stipi69 said:
Same here, bootloop, can u look up to this?
We are so glad you put efforts in custom kernel for lineage, looking forward for an update
Click to expand...
Click to collapse
please update to the lineageOS builds from Olivier,
unless he has uncommitted changes locally in his repos - there are no changes,
my lineageOS build is at patchlevel March 5th 2017,
so with recent changes the kernel (more precisely the ramdisk) might be incompatible with the old builds from @Myself5
balrajs99 said:
I think the tree sources are unified so is there a need for special kernel for dsds? I'll try this one on my E6683.
Click to expand...
Click to collapse
it might work, but you most likely run into a bootloop, too, if you're not using latest lineageOS builds (those from Olivier)
In this minute i downloaded fresh update, flashed in this order:
1. lineage-14.1-20170316-UNOFFICIAL-sumire
2. open_gapps-arm64-7.1-nano-20161104
3. UPDATE-SuperSU-v2.78-20160905010000
4. Z5_SK_Enf_v14.1_I.3_sum
lineage from olivier from below link:
https://dl.olivierk.at/sumire/lineage-14.1/
lineage-14.1-20170316-UNOFFICIAL-sumire
i still get bootloop, scren is dimed, lineage animation keeps going for couple of secs, screen goes bright and bootloop from there on, waiting 10+ minutes now... maybe old superuser zipfile for this task? dont know realy, will make clean install
zacharias.maladroit said:
it might work, but you most likely run into a bootloop, too, if you're not using latest lineageOS builds (those from Olivier)
Click to expand...
Click to collapse
Yes, on latest build by oliver it ran into bootloop.
actually this goes into bootloop, flashed latest olivier's lineageos.
edit : is there any proper order of flashing ? and can you share lineageos build that you are on ?
@zacharias.maladroit: Thank you a lot for your work. We should be very thankful to every developer on the Z5!
Just gave your Kernel a try on latest olivier's lineageos (0316). Got a bootloop. After 20 minutes, I did a power reset and dirty reflashed latest olivier's lineageos (0316) via TWRP. Telephone was functional again.
L33Tgod said:
actually this goes into bootloop, flashed latest olivier's lineageos.
edit : is there any proper order of flashing ? and can you share lineageos build that you are on ?
Click to expand...
Click to collapse
yes, currently uploading
I'd install LineageOS + gapps (opengapps),
go through all steps,
then go into TWRP, make a backup and attempt to flash the kernel.
I haven't flashed the ROM via zip,
I flashed it via the .img files and fastboot since the updater-script seemed to cause trouble ...
Link to custom LineageOS 14.1 build (patchlevel March 5th 2017)
not sure what differs between this and the other builds:
https://drive.google.com/open?id=0BykGGWB96CBQR1VIb3QtdGpsTmM
I initiated the fetch of the repo files via
lunch lineage_sumire-userdebug
and added the blobs repo,
then restarted the build ...
Click to expand...
Click to collapse
Can you guys post the content of the updater-script (in
Code:
tags), that works for you ?
I removed the assert line but it still didn't work for me,
also booting the stock ROM kernel via fastboot doesn't seem enough anymore,
it has to be flashed, then the VOL DOWN button pressed to reach TWRP on the recovery partition.
If you reach TWRP via a different method please let me know :)
Thanks
zacharias.maladroit said:
yes, currently uploading
I'd install LineageOS + gapps (opengapps),
go through all steps,
then go into TWRP, make a backup and attempt to flash the kernel.
I haven't flashed the ROM via zip,
I flashed it via the .img files and fastboot since the updater-script seemed to cause trouble ...
Can you guys post the content of the updater-script (in
Code:
tags), that works for you ?
I removed the assert line but it still didn't work for me,
also booting the stock ROM kernel via fastboot doesn't seem enough anymore,
it has to be flashed, then the VOL DOWN button pressed to reach TWRP on the recovery partition.
If you reach TWRP via a different method please let me know :)
Thanks[/QUOTE]
I flashed the rom by flashing pixn kernel then booting into twrp when purple led comes on and it flashes rom normaly and to access twrp later i have to use your stock kernel and type fastboot boot boot.img and it can go into recovery, but can't flash lineageos because of that error 7.
Click to expand...
Click to collapse
L33Tgod said:
I flashed the rom by flashing pixn kernel then booting into twrp when purple led comes on and it flashes rom normaly and to access twrp later i have to use your stock kernel and type fastboot boot boot.img and it can go into recovery, but can't flash lineageos because of that error 7.
Click to expand...
Click to collapse
yeah, that's why I wrote:
Can you guys post the content of the updater-script (in
Code:
tags), that works for you ?
I removed the assert line but it still didn't work for me,
also booting the stock ROM kernel via fastboot doesn't seem enough anymore,
it has to be flashed, then the VOL DOWN button pressed to reach TWRP on the recovery partition.
If you reach TWRP via a different method please let me know :)[/QUOTE]
might be that upstream changed the content of updater-script,
that's why I ask for a working variant ;)
Click to expand...
Click to collapse

A300FU Lineage 16.0 Selfbuild Bootproblem [SOLVED]

hi all
my story:
i got my hands on a samsung galaxy a300fu (aka. a3ulte) 2015 and successfully installed twrp3.2.3 and a custom lineage build version 14.1. my goal however is to build, install and boot lineage 15.1 or lineage 16.0. the building is not the problem! i can build both versions (with help of the lineage wiki and the local manifest from the github user "Galaxy-MSM8916"). i can also install them however i'm unable to boot them.
what i tried so far:
- the mentioned github user offers multiple lineage 15.1 downloads for the device but none of them seem to boot (it crushed my PIT or something i needed to reflash the recovery image)
- since android 8.0 the debug mode is off so i needed to build an engineering version (another 4h) to get some kernel messages but i'm kind of overwhelmed with 11000 lines of debug (not counting the loops)
- on androidfilehost there is a lineage 16 build from the user vlw (also present here on xda) which strangely seems to be working! after checking its system properties file however it seems this build is kind of a hybrid (part a3lte, part a3ulte). also i'm unable to contact him that's why i'm writing here.
i'm pretty much out of ideas and would like to know if any of you has an idea how to proceed.
regards
edit:
related to github.com/Galaxy-MSM8916/android_device_samsung_gprimeltezt/issues/1
able to boot after renaming hardware/qcom/keymaster/Androir.mk to hardware/qcom/keymaster/Android.mk.nobuild

Question Customize the lineage os 20 linux kernel

Things are working well, I can build the lineageos image and flash it to my phone. I need to change the Linux kernel (I know this could really mess things up). I was hoping there is some instructions on how to change the linux configuration, build the kernel, then build a new lineage image that includes the modified kernel.
Thanks in advance.
Y-

Categories

Resources