FORUMS
Remove All Ads from XDA

[ROM][COMPILING][HELP]LMX210ULMA K8+ custom rom and kernel Q&A

75 posts
Thanks Meter: 6
 
By Duhjoker, Member on 10th December 2019, 08:50 PM
Post Reply Email Thread
I am in no way resposible for any negative effects to your device by trying any of this for yourself. Including bricking your device, divorce, nuclear meltdown, zombie apocalypse or any other malfeasance. Try at your own risk.


Hi guys

Im still a jr member here and learning but ive rooted a few phones and ported a twrp and now I want to build a custom kernel and ROM for my new phone the K8+ 2018 LMX210ULMA. I plan to do this all from the phone im building the ROM for using termux and Anlinux to install Ubuntu and all the proper build essentials. So lets get started!!!

First i have some questions and then ill note where i am in my project. Ive actually been working on this for a while using this and that thread but i have some questions i have never been able to find answers to. Like.......

1. Does the kernel source code need to be unpacked in the same folder as the device source code?

2. How can i build seperate modules like bootloader or recovery or anything else.

3. Is there a way for some one who has a locked network carrier device to build a kernel that is unlocked.

4. How do you find device, vendor and kernel trees for a device that hasnt been publicly built yet?

5. When installing dependency libraries to ubuntu what do i do when Ubuntu is unable to locate a package. For examle: lib32ncurses5-dev lib32z-dev and lib32esd1.0-dev

Ok now lets get to setting up the envrinonment or at least what i have so far.

A rooted phone is needed to get the job done as far as far as i know so you might want to work on that first. My particular phone variant doesnt seem to have a recovery option just yet due to some bit of hiding of hiding the fastboot mode but im hoping by compiling a custom ROM and Kernel i can alleviate that and help myself and all the other good folks that want to fully root thier phone and also learn to make thier own custom ROM.

So far im rooted using a temp root that utilizes an exploit called mtk-su. It gives basic root privilages and allowed me to make a couple changes to my build prop like adoptable storage and allow some changes here and there with out upsetting the system partition to much.

You will need adoptable storage storage for this to work as repo will need to unload ton of source code to your device so 32+ gigs of internal storage will be needed.

Im not going to go into the specifics of the two forementiined needs but a quick search should point you in the right direction and get you going.

1. Install termux and installed the basic packages in the welcome plus:

Code:
 pkg install libandroid-support libandroid-support-static libandroid-shmem libandroid-shmem-static libusb libusb-static libccid
2. Install Anlinux and follow the instructions to build Ubuntu within the termux environment. Make sure to do it as root which is essential for this to work correctly.

3. Install a vnc viewer. I dont really use it. It would be nice to have a way to use a web browser with in it but so far no go.

4. Once you have Ubuntu built and started its time to install more dependecies. Yay!

Code:
 apt-get install sudo
Code:
 sudo apt-get install software-properties-common
Code:
 sudo apt-get install bison build-essential curl ccache flex libncurses5-dev libsdl1.2-dev libxml2 libxml2-utils lzop pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev git-core make android-sdk gperf openjdk-8-jdk -y
So far i have been able to install all but 3 of the dependecies needed. Lib32ncurses5-dev lib32z1-dev and lib32esd0-dev any one knowing a work around or way to locate and install them please for the love of android speak up.

5. Now lets do some more setting up the build environment with repo. I have tp say repo is a pretty cool tool here but it has its problems. First the repo init command is sketchy and doesnt always work. I had a hard time with it at first. Second even though you tell it which manifest exactly you want to download it will download others as well and draw source code from every other build. This is a problem as it downloads every pre-built toolchain in the repisitory and almost every android repository in existance. They talk about the source code from repo taking up so much space well that is exactly why. Ive been compiling in C++ for years and i have never seen such a mess. But so be it. Maybe the android gods will straighten it out someday and make it easier and consume less space by only downloading the appropriate source code needed by your specific build.

This is the end of this post so i have to finish up on the next BRB
The Following User Says Thank You to Duhjoker For This Useful Post: [ View ] Gift Duhjoker Ad-Free
10th December 2019, 10:31 PM |#2  
OP Member
Thanks Meter: 6
 
More
Ok im back. Hows going androids? I am not a robot! But a few of my friends might disagree with statement.

I left off and we were about to finish up the build environment and get repo started so lets do that and i will tell you about the first big snag in the project next to not being able to find those three dependency libraries stated above.

Here we go first we create a new bin folder just for compiling android in the HOME folder of your ubuntu operating system then we set its path, download the repo launcher and set up our scripts.

By the way i probably should have mentioned this earlier but i assume every body at this point has some command line experience and should know that you copy these comnands and paste them one at a time. Please do not copy a whole code block at one time and paste it to your terminal or your gonna have a bad time like when you pizza when you are supposed to french fry.
10th December 2019, 10:38 PM |#3  
OP Member
Thanks Meter: 6
 
More
[code]

mkdir ~/bin

PATH=~/bin:$PATH

cd ~/bin

curl
12th December 2019, 11:17 AM |#4  
Senior Member
Thanks Meter: 151
 
More
i can't help you much but i hope you won't brick your device. it would be easier for Mediatek there you can always restore from SP Flash Tool. for Qualcomm your only chance is to put it into EDL mode/ Qualcomm HS-USB QDLoader 9008 Driver with test point and flash with QPST/ LGUP. I recommend to figure out how to unbrick before you start flashing lk

also maybe helpful this link for understanding boot chain
http://www.lieberbiber.de/2015/07/05...-little-kernel
14th December 2019, 09:10 AM |#5  
OP Member
Thanks Meter: 6
 
More
Any body know why i when i try to finish my lil tutorial here i cant do any more code blocks?
14th December 2019, 10:45 AM |#6  
Senior Member
Thanks Meter: 151
 
More
it's a bug in forum. i can't even post ls -l
15th December 2019, 07:36 PM |#7  
Senior Member
Thanks Meter: 151
 
More
i don't know much about compiling but i would scan lk.bin for strings containing oem fastboot commands (if they still left somewhere), and then scan the whole source code for respective strings in order to find the required build tree
15th December 2019, 08:06 PM |#8  
OP Member
Thanks Meter: 6
 
More
Um well the problem is that im not familiar with the source code components and there are soooooooo
many components and lil info and no common place so far but here to ask questions and where do i start my questions.

Like what is the bootloader source code called. I guess i could load it up in android studio and do a search of all strings that way.

Right now im trying to grasp why all of a sudden 3 lmx210 variants known to be easily bl unlockable are now not. Lg is pkaying dumb or thier drones arent equipped with the proper knowledge
15th December 2019, 09:35 PM |#9  
Senior Member
Thanks Meter: 151
 
More
idk download from opensource.lge.com and search for fastboot
Code:
grep -ir fastboot .
kernel-3.18/arch/arm/boot/compressed/sdhi-shmobile.c
kernel-3.18/arch/parisc/kernel/process.c
kernel-3.18/drivers/gpu/drm/i915/i915_params.c
kernel-3.18/drivers/gpu/drm/i915/intel_display.c
kernel-3.18/drivers/gpu/drm/i915/intel_fbdev.c
kernel-3.18/drivers/mfd/si476x-cmd.c
kernel-3.18/drivers/misc/mediatek/usb2jtag/Kconfig
kernel-3.18/drivers/net/ethernet/broadcom/tg3.c
kernel-3.18/include/linux/mfd/si476x-platform.h
btw why don't you cross-compile on linux machine, this would be probably easier as it seems it is well documented.

if one can help you re-enable fastboot in lk then its member @xyz`
25th December 2019, 06:37 AM |#10  
OP Member
Thanks Meter: 6
 
More
Ok i want to do an experimental kernel build for my Alcatel tetra to try some things i hope to implement into my lmx210 build.

Can someone help me figure out to add a few of these options...'

Overclocked cpu or adjustable clock speed

Devtmpfs so i can fastboot other phones

power enabled otg

Loop device

Also which android kernel source should i download. Upstream or experimental or what. I just know i need a 4.4 + kernel

Alexcs.... Its an experimental issue with compiling on phone to see if there is a way to configure the system to allow for every thing needed to be able to do so. I cant always get to my pc and dont always have the option to dual boot or ubuntu. Some folks may not have access at all or only enough time to flash thier phone.

In this case the person compiling could build thier rom on thier device then take it and flash it when they can get to a pc
13th January 2020, 03:01 AM |#11  
OP Member
Thanks Meter: 6
 
More
Ok i need some help here. pleeeeeeeaaaassee

i have been trying to compile a kernel for the Aristo 2 LMX210MA for three days and im about to lose it. My steps this far....


install ubuntu 18 on aristo 2

mkdir -p ~/kernel

cd ~/kernel

copied kernel source from storage and tar xvzf'd it

read the read me file for instruction and to get the name of the prebuilt tool chain. downloaded the toolchain and copied it to the /kernel/msm-3.18/android folder in ubuntu fs and tar xvzf`d it there as per read me file. made a few tweaks to the defconfig file. i wanted to build a devtmpfs and have full fs control over otg devices.

now i run these commands from msm-3.18 folder.........

mkdir -p out


make ARCH=arm O=./out cv1_lao_com-perf_defconfig

every thing goes fine til i run the next command and then it says no such file or directory for the androideabi-gcc file that is clearly in the tool chain and in the right place. and yes i set my path right i yell at the compiler on my phone.


make ARCH=arm O=./out CROSS_COMPILE=$(pwd)/root/kernel/kernel/msm-3.18/android/arm-linux-androideabi-4.9/bin/arm-linux-androideabi- KERNEL_COMPRESSION_SUFFIX=gz -j4
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes