I need a lil' help building a rom for the sm-t350. - Android Q&A, Help & Troubleshooting

I am trying to build a crdroid rom for the SM-T350. But i keep running into errors that im not sure how to fix.
steps i'v taken so far
Synced the CrDroid 9 repo
added a local manifest (this one https://github.com/Nubianprince/local_manifests/blob/master/crdroid-pie.xml)
repo synced again
Code:
repo sync -c --no-tags --no-clone-bundle -j2
git cloned this https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/
ran
Code:
export CROSS_COMPILE=/home/lividhen/crdroid/arm-eabi-4.8/bin/arm-eabi- && export ARCH=arm && export SUBARCH=arm
Code:
brunch gt58wifi
Ended with
Code:
(ninja: error: '/home/lividhen/crdroid/out/target/product/gt58wifi/kernel', needed by '/home/lividhen/crdroid/out/target/product/gt58wifi/boot.img', missing and no known rule to make it)
tried to build kernel, is that what i need to do?
Code:
(cd kernel/samsung/msm8916
ran
Code:
make menuconfig
then just saved with all the defaults, then ran
Code:
make msm8916_sec_gt58wifi_eur_defconfig)
ended with
Code:
make[2]: *** [scripts/Makefile.build:309: kernel/irq/irqdesc.o] Error 1
make[1]: *** [scripts/Makefile.build:455: kernel/irq] Error 2
make: *** [Makefile:834: kernel] Error 2
I feel as if I'm probably missing something important, I'm just not sure what. any help is appreciated. Do i need to provide more info? i am on WSL, but from what i'v heard, that shouldent make a difference.
Edit: ran make make VARIANT_CONFIG=msm8916_sec_gt58wifi_eur_defconfig again after running make clean and make mrproper in the kernel directory and got make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'. Stop

Try this.
Use this https://github.com/Nubianprince/local_manifests/blob/master/crdroid-pie.xml to update your crdroid-pie.xml file.
Delete device/samsung/msm8916-common
repo sync
. build/envsetup.sh && brunch gt58wifi

nubianprince said:
Try this.
Use this https://github.com/Nubianprince/local_manifests/blob/master/crdroid-pie.xml to update your crdroid-pie.xml file.
Delete device/samsung/msm8916-common
repo sync
. build/envsetup.sh && brunch gt58wifi
Click to expand...
Click to collapse
It is still throwing "ninja: error: '/home/lividhen/crdroid/out/target/product/gt58wifi/kernel', needed by '/home/lividhen/crdroid/out/target/product/gt58wifi/boot.img', missing and no known rule to make it
15:08:48 ninja failed with: exit status 1"

lividhen99 said:
It is still throwing "ninja: error: '/home/lividhen/crdroid/out/target/product/gt58wifi/kernel', needed by '/home/lividhen/crdroid/out/target/product/gt58wifi/boot.img', missing and no known rule to make it
15:08:48 ninja failed with: exit status 1"
Click to expand...
Click to collapse
In BoardConfigCommon.mk in msm8916-common folder what path are you using for TARGET_KERNEL_SOURCE and does it exist?

nubianprince said:
In BoardConfigCommon.mk in msm8916-common folder what path are you using for TARGET_KERNEL_SOURCE and does it exist?
Click to expand...
Click to collapse
It pointed twards kernel/samsung/msm8916 which no longer exists, so I changed it too kernel/samsung/evervolv, then I had a bunch of problems with the ncurses libs, but eventually got that sorted out, then FINALLY, it built successfully. Thank you.

Aaaaaand, audio not playing and camera is broken. How was this fixed?

lividhen99 said:
Aaaaaand, audio not playing and camera is broken. How was this fixed?
Click to expand...
Click to collapse
msm8916.mk & boardconfigcommon.mk update your audio config path.. change from TARGET_COPY_OUT_VENDOR to TARGET_COPY_OUT_SYSTEM
make clean && brunch gt58wifi

nubianprince said:
msm8916.mk & boardconfigcommon.mk update your audio config path.. change from TARGET_COPY_OUT_VENDOR to TARGET_COPY_OUT_SYSTEM
make clean && brunch gt58wifi
Click to expand...
Click to collapse
All the lines under audio already say TARGET_COPY_OUT_SYSTEM.
(also, quick off topic question, is the crdroid 6 usable yet? I'd guess not sence it hasn't been uploaded yet uploaded.)

lividhen99 said:
All the lines under audio already say TARGET_COPY_OUT_SYSTEM.
(also, quick off topic question, is the crdroid 6 usable yet? I'd guess not sence it hasn't been uploaded yet uploaded.)
Click to expand...
Click to collapse
How is this coming along?

nubianprince said:
How is this coming along?
Click to expand...
Click to collapse
Um... not. i'm not sure what else to do as i have never done this before . I guess i'll just keep poking around to see if i can do anything.

lividhen99 said:
Um... not. i'm not sure what else to do as i have never done this before . I guess i'll just keep poking around to see if i can do anything.
Click to expand...
Click to collapse
Maybe there is something missing from my git repos, I will update those this weekend.

nubianprince said:
Maybe there is something missing from my git repos, I will update those this weekend.
Click to expand...
Click to collapse
Okay, thanks.

Hey, I tried building with your latest commit, and I am not sure if that was supposed to fix anything,but it is still broken. I keep fiddling with the audio paths and can't seem to fix it ?

lividhen99 said:
Hey, I tried building with your latest commit, and I am not sure if that was supposed to fix anything,but it is still broken. I keep fiddling with the audio paths and can't seem to fix it ?
Click to expand...
Click to collapse
Did you do a clean build?

nubianprince said:
Did you do a clean build?
Click to expand...
Click to collapse
Yeah ? I'm just going to delete my entire android directory and start fresh.

okay, here is what i'm doing, just in case i'v done something terribly wrong. Initalize the crdroid repo, added crdroid-pie.xml to local_manifests, repo sync, then i try to build and it gives a liblights error so i comment out all of hardware/qcom/display-caf/msm8916/liblight/Android.mk and do a clean build.
Edit 1: I forgot to correct the kernel path in BoardConfigCommon.mk so i fixed that.
Edit 2: i am now getting build/make/core/shared_library_internal.mk:17: error: hardware/qcom/display-caf/msm8916/libmemtrack: Illegal use of OVERRIDE_BUILT_MODULE_PATH. which i wasn't getting before, so... potential progress?? i don't know.

lividhen99 said:
okay, here is what i'm doing, just in case i'v done something terribly wrong. Initalize the crdroid repo, added crdroid-pie.xml to local_manifests, repo sync, then i try to build and it gives a liblights error so i comment out all of hardware/qcom/display-caf/msm8916/liblight/Android.mk and do a clean build.
Edit 1: I forgot to correct the kernel path in BoardConfigCommon.mk so i fixed that.
Edit 2: i am now getting build/make/core/shared_library_internal.mk:17: error: hardware/qcom/display-caf/msm8916/libmemtrack: Illegal use of OVERRIDE_BUILT_MODULE_PATH. which i wasn't getting before, so... potential progress?? i don't know.
Click to expand...
Click to collapse
Sound like you messed something out in display-caf when you commented out liblight

okay, i got it to build again, i deleted display-caf and synced again, then commented the other of the two files defining liblights. now i'm back at the same issue again, neither camera nor audio works ?. all the audio paths in BoardConfigCommon.mk and msm8916.mk say TARGET_COPY_OUT_SYSTEM already, and i'm not sure what to do about the camera.

upload your device trees so I can take a look, I will upload my vendor trees and you can try building with those

nubianprince said:
upload your device trees so I can take a look, I will upload my vendor trees and you can try building with those
Click to expand...
Click to collapse
device/samsung
https://drive.google.com/open?id=11V3pcrDgMEId13l0bXG7inpyPUVx7FWp

Related

[ROM][CM11][dev only] cm-11-UNOFFICIAL-d620 Alpha

CyanogenMod 11 for the LG G2 mini D620r
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
All Credits so far go to Quarx and his project CM11 for LG L90
What i have done so far:
Setup Ubuntu on my Laptop
Installed CM dev environment like described here!
Made a new device folder following THIS guide and build some recoveries.
Took the sources from CM11 for LG L90 and integrated them to my build environment.
CM11 for LG L90 builds fine but i can not test it.
Took the files i thought we need from L90 and put them to my d620 tree.
Trial and error till it compiled for d620.
For the kernel i use original LG sources extracted to kernel/lge/msm8226.
Switched to kernel source from Quarx and tweaked it for d620.
Find sources i use here.
Unfortunately the kernel i have build leads to boot loops. (Yes i have wiped everything)
If i only install the system with the original LG stock kernel i get an security error.
How can i find out why the kernel boot loops?
(had to use the dt.img from stock kernel because mine didn't work, phone gets stuck in fastboot)
Kernel now boots with recovery.
Touch only works if i copy the FW to system folder.
CM11 now works quit well.
Known issues:
- NFC not working at all
- Vibration not working at all
- Back/Main camara has overexposure on bright scenes
- LTE can only be activated by adding quick setting for LTE
Testers welcome.
Video review from simo14
Alpha: Download
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Any help appreciated.
Port rom!!
Good job! I think You can port rom l90 for g2 mini. Read it: http://forum.xda-developers.com/showthread.php?t=2545618 (my English is bad, sorry!!)
I think we need a "extract-files.sh" to extract device proprietary files with connected and enabled usb debbuging. I do some research but didnt luck. My English is weak and i don't know how to do this script. I know its necesary for boot and compile with success.
Maybe Quarx can help us.
Probably kernel boot loops because you compile with CM source and that its not compatible with stock rom.
Regards.
this is great progress
im trying like hell to make a custom recovery.
take a look at this zaaap
http://forum.xda-developers.com/android/help/building-kernel-error-lg-g2-mini-t2853390
maybe you could help me out a bit?
I'm extracted a system folder from TWRP backup and try to port by paste>copy method. I need a META-INF folder for our phone. I don't know how to make it.
Ok i found it.
I make four builds with AndroidKitchen but its always a update-binary script error.
Any help?
make -j4 otatools give me that error.
/media/radek/bee9f4ae-71a6-4ed8-9153-7dd674ea803d/CM11/out/target/product/generic/obj/APPS/SignatureTest_intermediates
"ebtables is disabled on this build"
find: `src': Nie ma takiego pliku ani katalogu
grep: /build/target/board/generic/recovery.fstab: Nie ma takiego pliku ani katalogu
No private recovery resources for TARGET_DEVICE generic
build/core/tasks/kernel.mk:91: **********************************************************
build/core/tasks/kernel.mk:92: * Kernel source found, but no configuration was defined *
build/core/tasks/kernel.mk:93: * Please add the TARGET_KERNEL_CONFIG variable to your *
build/core/tasks/kernel.mk:94: * BoardConfig.mk file *
build/core/tasks/kernel.mk:95: **********************************************************
make: Nie ma nic do zrobienia w `otatools'.
/build/target/board/generic/recovery.fstab exists in the directory.
When try to compile kernel:
*** Can't find default configuration "arch/arm/configs/w7ds_open_cis_defconfig"!
***
make[2]: *** [w7ds_open_cis_defconfig] Błąd 1
make[1]: *** [w7ds_open_cis_defconfig] Błąd 2
make: *** [w7ds_open_cis_defconfig] Błąd 2
That's mean the Quarx kernel should work for us?
partyzant_x said:
When try to compile kernel:
*** Can't find default configuration "arch/arm/configs/w7ds_open_cis_defconfig"!
***
make[2]: *** [w7ds_open_cis_defconfig] Błąd 1
make[1]: *** [w7ds_open_cis_defconfig] Błąd 2
make: *** [w7ds_open_cis_defconfig] Błąd 2
That's mean the Quarx kernel should work for us?
Click to expand...
Click to collapse
w7ds is an LG L90 dual sim.
Go to your kernel folder /arch/arm/configs and look for a g2m... ...defconfig where the name fits your device.
Try to compile with the g2m defconfig should work.
You might be missing touch and other hardware if you didn't get all property blobs needed for our device.
This is the point where I got struck at the moment.
/tmp/ccfkEagn.s: Assembler messages:
/tmp/ccfkEagn.s:166: Warning: swp{b} use is deprecated for this architecture
/tmp/ccfkEagn.s:192: Warning: swp{b} use is deprecated for this architecture
CC arch/arm/mach-msm/smd_private.o
CC arch/arm/mach-msm/smem.o
CC arch/arm/mach-msm/smd_init_dt.o
arch/arm/mach-msm/smd_init_dt.c:24:25: fatal error: smd_private.h: No such file or directory
compilation terminated.
make[2]: *** [arch/arm/mach-msm/smd_init_dt.o] Błąd 1
make[1]: *** [arch/arm/mach-msm] Błąd 2
make: *** [zImage] Błąd 2
Click to expand...
Click to collapse
I'm try to compile the LG source with:
Run following scripts to build kernel
a) cd kernel
c) make ARCH=arm CROSS_COMPILE=../prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi- g2m_global_com_defconfig zImage
Zaaap can you share your device tree?
Ok. I fixed the errors. Now I have "zImage" how flash that?
What did you do to fix the errors? And wich toolchain did you use?
The zimage comes with some .ko files? You have to make a .zip file of those and flash it through custom recovery or a flash app from market! Like rashr
I fixed the errors that occurred when compiling. Compile the source cm and lg according to instructions in the readme.txt from lg. Thanks Zaaap changed command from w7ds_open_cis_defconfig on g2m_global_com_defconfig. After compiling I received two files zImage and Image.
partyzant_x said:
I fixed the errors that occurred when compiling. Compile the source cm and lg according to instructions in the readme.txt from lg. Thanks Zaaap changed command from w7ds_open_cis_defconfig on g2m_global_com_defconfig. After compiling I received two files zImage and Image.
Click to expand...
Click to collapse
Don't flash the zImage as it is only a part of the needed boot.img.
There is a command like 'make boot.img'. I'll have to look for it.
I'll explain more later when I get to my laptop.
partyzant_x said:
I fixed the errors that occurred when compiling. Compile the source cm and lg according to instructions in the readme.txt from lg. Thanks Zaaap changed command from w7ds_open_cis_defconfig on g2m_global_com_defconfig. After compiling I received two files zImage and Image.
Click to expand...
Click to collapse
look at the last stages of this how to.
http://playfuldroidz.com/wiki/Compiling_a_Kernel#Making_a_Flashable_Zip
Now I'm trying to create a device tree manually. A bit of getting lost in this. Zaaap can share with your device tree. Rather than create new ones we can work on one and make any fixes.
partyzant_x said:
I fixed the errors that occurred when compiling. Compile the source cm and lg according to instructions in the readme.txt from lg. Thanks Zaaap changed command from w7ds_open_cis_defconfig on g2m_global_com_defconfig. After compiling I received two files zImage and Image.
Click to expand...
Click to collapse
where did you find the readme.txt where it said wich toolchain you should use?
invaderjohn said:
look at the last stages of this how to.
http://playfuldroidz.com/wiki/Compiling_a_Kernel#Making_a_Flashable_Zip
Click to expand...
Click to collapse
Give me: Error executing updater binary in zip.
Downloaded kernel source from lg site. Unpack it and there is two files readme.txt and packed kernel source, unpacked it copy kernel folder to cm source then cd kernel and:
make ARCH=arm CROSS_COMPILE=../prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi- g2m_global_com_defconfig zImage
When I have error for example:
arch/arm/mach-msm/smd_init_dt.c:24:25: fatal error: smd_private.h: No such file or directory
compilation terminated.
make[2]: *** [arch/arm/mach-msm/smd_init_dt.o] Błąd 1
make[1]: *** [arch/arm/mach-msm] Błąd 2
make: *** [zImage] Błąd 2
Click to expand...
Click to collapse
Then open smd_init_dt.c find line with smd_private.sh. Its look include <smd_private.sh> and change it to include "smd_private.sh".
Sorry for my English.
Make boot.img
Here you can find the official doc about making boot.img: HERE
I took the device tree from Quarx found here made a copy in a new folder 'd620' but i think 'g2m' would have been correct for phone.
Find my device folder here.
Find my vendor folder here.
The kernel source is located under kernel/lge/msm8226
I normaly compile a recovery and see if the kernel works with it.
Thus i don't risk a semi brick because if the kernel is bad, then recovery may not start but system will start and i can flash an other recovery with a new kernel.
If recovery boots, i can use adb to get dmesg.log and see what works and what not.
On my last try, touch didn't initialize complete.
Thanks Zaaap.
I broke something in the source of CM. I have to download again. Can someone check zImage which I compiled.
partyzant_x said:
Thanks Zaaap.
I broke something in the source of CM. I have to download again. Can someone check zImage which I compiled.
Click to expand...
Click to collapse
It boot, but takes long to do so and there is no touch.
This is the same problem i have.
We need to get the correct touch firmware + patch.
Find log attached.
Kernel boots with touch
Got touch working.
The firmware doesn't get copied to /system/lib/firmware.
When i copy the firmware in via AIK kernel boots fast and with touch.
Now i will investigate how to include the FW in compile process.
Very good news. I asked for help a member of XDA @ moonbutt74. I hope he will have the time and inclination to help us.
Zaaap72 said:
Got touch working.
The firmware doesn't get copied to /system/lib/firmware.
When i copy the firmware in via AIK kernel boots fast and with touch.
Now i will investigate how to include the FW in compile process.
Click to expand...
Click to collapse
partyzant_x said:
Very good news. I asked for help a member of XDA @ moonbutt74. I hope he will have the time and inclination to help us.
Click to expand...
Click to collapse
okay so root is good
look in /proc for
/proc/config.gz
it might be there it might not. i need the stock boot.img please. looking through source right now and unsure of which defconfig.
your modules also depend on libraries in system/vendor - you need that entire directory for your device tree. you may also need
manufacturer/device specific/proprietary libraries from system/lib
starting in /system/vendor type in terminal
strings [nameoflib].so | grep "\.so"
these will bring up a list of additional libraires needed. the ones you already have in vendor don't worry about. the ones you
will find in system/lib are the additional ones you need to get for your device tree. go to the thread i'm working in with restl3ss and read through the whole thing but please do not post any questions there. post here use the mention function @moonbutt74
or pm me or click reply button below any of my posts in this thread and i will know by email.
m
on defconfig readme suggests w7ds_open_cis_defconfig but will try g2m_global_com_defconfig

[GUIDE] Building Pure Nexus

Introduction
Hello everyone, this is a guide to get you up and running with your own build of Pure Nexus for the Nexus 6. In this thread, you will learn how to get your computer set up to build and the commands you will need to run. Please read the entire guide and the FAQ. Additionally, this is a developer's thread, there should be no off topic discussion.
Compilation Guide
This is available on my Github, where it may be a little more up to date.
0. Getting started
In this guide, I will go over how to build Pure Nexus on your Linux machine. This particular tutorial will focus on Ubuntu 16.04 as that is what I use (Mint 18 is also good) but this should work with any version of Linux; it does need to be 64-bit however. I will leave the installation of that up to you, Google is a wonderful resource. If you don't have a good computer but still want to build, check out this thread on XDA: http://forum.xda-developers.com/chef-central/android/guide-how-to-build-rom-google-cloud-t3360430
1. Set up your environment
1. Automatically
Code:
sudo apt-get install git-core
git clone https://github.com/akhilnarang/scripts
cd scripts
ls
bash <script-name>
<script-name> should be one of the scripts in the folder for your particular architecture.
2. Manually
1. Install Java 8
Code:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-8-jre
2. Install other build tools
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
2. Configure repo and git
If you have any problems with the below commands, try running as root:
Code:
sudo -s
Git is an open source version control system which is incredibly robust for tracking changes across repositories. Repo is Google's tool for working with Git in the context of Android. More reading if you are interested: https://source.android.com/source/developing.html
Run these commands to get repo working (only do this if you did the manual set up method above:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Run these commands to get git working:
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
3. Download the source
First, before downloading the source, create a folder for the source and move into it.
Code:
mkdir ~/<foldername> (eg. mkdir ~/PN or ~/PureNexus)
cd ~/<foldername>
Then, we need to grab the manifest and sync down the repositories. Here are the commands to do this for Pure Nexus for Nougat (make sure you are in the source folder you made above):
Code:
repo init -u https://github.com/PureNexusProject/manifest.git -b n
repo sync --force-sync
Here is the process generally for other ROMs:
When you go to build a ROM, you must download its source. All, if not most, ROMs will have their source code available on Github. To properly download the source, follow these steps:
Go to your ROM's Github (e.g. http://github.com/PureNexusProject)
Search for a manifest (usually called manifest or android_manifest).
Go into the repo and make sure you are in the right branch (located right under the Commits tab).
Go into the README and search for a repo init command. If one exists, copy and paste it into the terminal and hit enter.
If one does not exist, you can make one with this formula:
Code:
repo init -u <url_of_manifest_repo>.git -b <branch_you_want_to_build>
For example:
Code:
repo init -u http://github.com/PureNexusProject/manifest.git -b n
After the repo has been initialized, run this command to download the source:
Code:
repo sync --force-sync
This process can take a while depending on your internet connection.
4. Build it!
At this point, it'd be a good idea to set up ccache. ccache is a compiler cache, it stores previously compiled files in a directory and pulls from that instead of recompiling if nothing has changed. This speeds up compilation a LOT. If you want to use it, follow the below steps:
Open up your .bashrc file in your home directory using a text editor or nano and append this to the end of it:
Code:
export USE_CCACHE=1
Then type:
Code:
source ~/.bashrc
After that, run one of the below command (replacing the # with how many GBs of ccache you want, 50 is recommended)
Use this one if you used the manual method of set up in section 1:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M #G
Use this one if you used the automatic method of set up in section 1:
Code:
ccache -M #G
After that, it's time to build!
Code:
. build/envsetup.sh
breakfast shamu
mka bacon
After that, your computer will build the flashable zip file and if you see something that says make completed, you've done it!
Any time that you want to rebuild, type the following commands:
Code:
repo sync --force-sync
. build/envsetup.sh
breakfast shamu
mka clobber
mka bacon
I also have a script to do this on my Github here
Frequently Asked Questions
1.1 Q: I got an error, what do I do??
1.1 A: Well to start, if it is anything with Ninja, I would go ahead and disable it. You can add this to your .bashrc file:
Code:
export USE_NINJA=false
Then type this
Code:
source ~/.bashrc
. build/envsetup.sh
breakfast shamu
mka clobber
mka bacon
If it is saying you ran out of memory, follow this post.
If it isn't Ninja related, check out @AzraelsKiss's post here, where he has documented a few common issues. If none of those apply, post here with a detailed list of what you have done and we will do our best to help you.
1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!
u mean Nexus 6.
@The Flash
bit of a typo on the device bro, but thanks for the write up. I've not followed your build guide but I've heard great things about it,
[email protected] said:
u mean Nexus 6.
Click to expand...
Click to collapse
Lawlrus said:
@The Flash
bit of a typo on the device bro, but thanks for the write up. I've not followed your build guide but I've heard great things about it,
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is genius! Thanks for the write-up!
Sent from my Nexus 6 using XDA-Developers mobile app
giving this a try today! I resized my partitions to give linux as much room as possible, but idk if that will still be enough considering i have a SSD. I have a 130gb home partition right now. Wish I could give up more of my 256GB, but I'm triple booting windows 10, ubuntu, and the new cm13 androidx86.
I def want to be able to do this though, I may have to go out today and pickup an externel hdd
slothdabski said:
giving this a try today! I resized my partitions to give linux as much room as possible, but idk if that will still be enough considering i have a SSD. I have a 130gb home partition right now. Wish I could give up more of my 256GB, but I'm triple booting windows 10, ubuntu, and the new cm13 androidx86.
I def want to be able to do this though, I may have to go out today and pickup an externel hdd
Click to expand...
Click to collapse
Source is usually about 30-50 gigs the first time you synch
Lawlrus said:
Source is usually about 30-50 gigs the first time you synch
Click to expand...
Click to collapse
I see that lol, I'm at 13gb so far. I've been reading the building how to in the 6p forum since it has a lot more comments and info. I know I'm really going to be cutting it close and theres a good chance I'll run out of space. Depending on how close I get, I may try to shave another 10gb off my windows partition to get 1 actual build done before I drop money on an external hdd. Although that may not be worth the trouble since it looks like I can pick up a 1tb external for around $55. And I would really like to have a large enough ccache to keep build times down
Sent from my NuttyNexus using Tapatalk
slothdabski said:
I see that lol, I'm at 13gb so far. I've been reading the building how to in the 6p forum since it has a lot more comments and info. I know I'm really going to be cutting it close and theres a good chance I'll run out of space. Depending on how close I get, I may try to shave another 10gb off my windows partition to get 1 actual build done before I drop money on an external hdd. Although that may not be worth the trouble since it looks like I can pick up a 1tb external for around $55. And I would really like to have a large enough ccache to keep build times down
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
Yeah, plus I'm not sure if building on a ssd would burn it out fast or not. I always wondered that myself, but the price of ssd is getting so low anymore, I guess its not that big of an issue.
After the first synch, it gets much easier on the downloads lol. First is always the most intensive, any time you synch after its just the small updates.
Lawlrus said:
Yeah, plus I'm not sure if building on a ssd would burn it out fast or not. I always wondered that myself, but the price of ssd is getting so low anymore, I guess its not that big of an issue.
After the first synch, it gets much easier on the downloads lol. First is always the most intensive, any time you synch after its just the small updates.
Click to expand...
Click to collapse
I didn't realise that was that much of an issue with ssd's! S***, I may have to get the external anyways BC I'm using a 2in1 tablet style laptop that doesn't have a user serviceable drive! I don't want a $750 machine to go bust, I'd rather drop $55 on the external lol.
Is it syncing or building that is the most taxing on the drive, or both?
Sent from my NuttyNexus using Tapatalk
slothdabski said:
I didn't realise that was that much of an issue with ssd's! S***, I may have to get the external anyways BC I'm using a 2in1 tablet style laptop that doesn't have a user serviceable drive! I don't want a $750 machine to go bust, I'd rather drop $55 on the external lol.
Is it syncing or building that is the most taxing on the drive, or both?
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
I honestly don't even know if it is, might want to wait for Nathan or someone else to chime in, I would think it would be the act of building. But as I've never actually gotten a build to work properly, I'd take what I said with a grain of salt
Lawlrus said:
I honestly don't even know if it is, might want to wait for Nathan or someone else to chime in, I would think it would be the act of building. But as I've never actually gotten a build to work properly, I'd take what I said with a grain of salt
Click to expand...
Click to collapse
Hmm so it sounds likes a lot can go wrong with building. Well, if I can do one build successfully, I can justify buying a drive to build more. One build shouldn't kill my drive since I usually don't usually do r/w intensive tasks on this computer
Sent from my NuttyNexus using Tapatalk
slothdabski said:
I didn't realise that was that much of an issue with ssd's! S***, I may have to get the external anyways BC I'm using a 2in1 tablet style laptop that doesn't have a user serviceable drive! I don't want a $750 machine to go bust, I'd rather drop $55 on the external lol.
Is it syncing or building that is the most taxing on the drive, or both?
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
It's probably the repeated compilitations.
While modern SSDs do a good job of balancing wear and tear... SSDs by the simple nature of Solid State storage have a finite number of write cycles. During normal usage you should really never max this out. However, when compiling you're performing ALOT of write cycles.
There are ways to optimize this. But if you're looking at getting an external harddrive it might be an easier option.
The Flash said:
Introduction
Click to expand...
Click to collapse
Wonderful guide The Flash. Followed everything to the T. Keeps failing with the out of memory issues as documented in your FAQ. I tried the FAQ suggestion and it still fails with same issue. Any suggestion?
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
DreamFX said:
Wonderful guide The Flash. Followed everything to the T. Keeps failing with the out of memory issues as documented in your FAQ. I tried the FAQ suggestion and it still fails with same issue. Any suggestion?
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
Click to expand...
Click to collapse
How much RAM do you have?
The Flash said:
How much RAM do you have?
Click to expand...
Click to collapse
It's an older machine I use for just building and running Linux. Only 4gig. So left kill jack at 4g.
Sent from my Nexus 6 using XDA-Developers mobile app
DreamFX said:
It's an older machine I use for just building and running Linux. Only 4gig. So left kill jack at 4g.
Sent from my Nexus 6 using XDA-Developers mobile app
Click to expand...
Click to collapse
Hmmm to be honest, you may not be able to compile Nougat. I have heard quite a few people having issues with 8GB, not sure anyone has done it with less than that.
The Flash said:
Hmmm to be honest, you may not be able to compile Nougat. I have heard quite a few people having issues with 8GB, not sure anyone has done it with less than that.
Click to expand...
Click to collapse
Going to throw some more ram in her and give her another go. Thanks for the quick responses [emoji3]
Sent from my Nexus 6 using XDA-Developers mobile app
The Flash said:
Hmmm to be honest, you may not be able to compile Nougat. I have heard quite a few people having issues with 8GB, not sure anyone has done it with less than that.
Click to expand...
Click to collapse
Will a large swap help with this? Or is it purely a hardware restriction?
Sent from my NuttyNexus using Tapatalk
DreamFX said:
Going to throw some more ram in her and give her another go. Thanks for the quick responses [emoji3]
Sent from my Nexus 6 using XDA-Developers mobile app
Click to expand...
Click to collapse
Let me know how it goes!
slothdabski said:
Will a large swap help with this? Or is it purely a hardware restriction?
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
I think someone said that swap doesn't help all that much but it is worth a shot.

My device is not listed in lunch (Error: Do you have the right repo manifest?)

Hello guys,
I'm curious about how to build a Dirty Unicorns rom for our device (ZTE Axon 7), which has not been build yet. I searched before in other threads but did not find any wort solution. I followed kindly this guide: https://raw.githubusercontent.com/nathanchance/Android-Tools/master/Guides/Building_AOSP.txt, but got an error after typing the command: "breakfast axon7".
The error itself:
** Don't have a product spec for: 'du_axon7'
** Do you have the right repo manifest?
ls: cannot access 'device/*/axon7/du.mk': No such file or directory
build/core/product_config.mk:246: *** Can not locate config makefile for product "du_axon7". Stop.
** Don't have a product spec for: 'du_axon7'
** Do you have the right repo manifest?
Click to expand...
Click to collapse
When typing "lunch", my device is also not listed there. And when typing 1 (full-eng) I get this:
Go ahead and pick a number... 1
Trying dependencies-only mode on a non-existing device tree?
============================================
DU_VERSION=
TARGET_BUILD_VARIANT=eng
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
BUILD_ID=NJH47B
OUT_DIR=/home/mariusfl0rian/DU/out
============================================
[email protected]:~/DU$
Click to expand...
Click to collapse
As I'm a newbie when building roms, I need your help. How can I solve this?
Thanks in advance
Link to the device tree you're using?
osas514 said:
Link to the device tree you're using?
Click to expand...
Click to collapse
The thing is, I followed the guide and there was no need of my device tree. I'm a noob, it's the first time I try to build a rom for my device.
mariusfl0rian said:
The thing is, I followed the guide and there was no need of my device tree. I'm a noob, it's the first time I try to build a rom for my device.
Click to expand...
Click to collapse
Do you have any github link to the tree you're using? And have you made the necessary changes? Can you provide a screenshot or a github link of your device tree
osas514 said:
Do you have any github link to the tree you're using? And have you made the necessary changes? Can you provide a screenshot or a github link of your device tree
Click to expand...
Click to collapse
Brother, i did not make any changes, i just followed that guide. Which changes you mean?
Thanks btw
mariusfl0rian said:
Brother, i did not make any changes, i just followed that guide. Which changes you mean?
Thanks btw
Click to expand...
Click to collapse
Where did you download the device tree from? Can you send d link?
You need to download or clone the git files into it's proper location as mentioned in your error

Help building LineageOS for LeEco (LeTV) LeMax 1 (X900/Max1) CN

If you're in a hurry and just want to know the latest news, follow this link:
https://forum.xda-developers.com/showpost.php?p=80393641&postcount=58
Keep reading for some background info.
Hi there!
So... I'm trying to port LineageOS (version 15.1) from OnePlus - OnePlus2 device to the LeEco LeMax 1 phone.
Why I've chosen this device to port from?
It has the MSM8994 (Qualcomm Snapdragon 810) SoC, which is the same as Max1, so (supposedly) a kernel compile would not be too much hassle. Besides it also has many similarities in terms of hardware.
What I did for device dir:
I took the tree from https://github.com/LineageOS/android_device_oneplus_oneplus2 and modified it to meet max1 requirements.
Current tree: https://github.com/alexsmithbr/android_device_letv_max1
What I did for vendor dir:
I compared the tree with Max1 tree, excluding everything that was not found in Max1. The plan is to add more vendor stuff if necessary.
Current tree: https://github.com/alexsmithbr/android_device_letv_max1
What I did for kernel dir:
I downloaded Le_Max_OpenSource.zip from opensource.le.com (in fact, as the site is down, I got a copy from http://web.archive.org/web/20180626053054/http://opensource.le.com:80/ and, from there, I found the file I needed was named Le_Max_OpenSource.zip. I got it from here.
The kernel config in this zip file is exactly the same I get from the device itself, with adb pull /proc/config.gz.
Current tree: https://github.com/alexsmithbr/android_kernel_letv_max1
Interesting related threads:
https://forum.xda-developers.com/showpost.php?p=78690008&postcount=7
https://forum.xda-developers.com/le.../cm-14-1-android-7-1-unofficial-letv-t3530173
Other possibly useful resources:
http://web.archive.org/web/20180626053054/http://opensource.le.com:80/
https://forum.xda-developers.com/showpost.php?p=78676206&postcount=2402
These are thanks to @rico69310, specifically this post:
https://www.mediafire.com/folder/ff7hbpa62ivsg/
https://yadi.sk/d/RPfdh3glmhzarw
https://cloud.mail.ru/public/GP9g/cWpyeYbuK/
Another useful resource, in case you brick your X900. This is thanks to @Phsh:
https://forum.xda-developers.com/showpost.php?p=75157516&postcount=2375
Current status
I can build LineageOS 15.1 completely, but, once flashed, the kernel doesn't boot and phone enters bootloader (the penguin screen) and stay there.
What I need
It's pretty obvious I need the ROM working...
But the focus now would be to have a working boot.img. I really don't know what I'm doing wrong.
I can't get any logs, as LeEco patched the kernel so that we don't have a last_kmsg. Instead, they apparently put last_kmsg into another partition in /dev/block/platform/soc.0/f9824900.sdhci/by-name/letvconfig2. You can check this in the kernel, file kernel/printk/last_kmsg.c, line 124:
Code:
#define DEFAULT_KERNELLOG_FILENAME "/dev/block/bootdevice/by-name/letvconfig2"
char *kernlog_file = DEFAULT_KERNELLOG_FILENAME;
Well, I tried to give an overview of all steps I took. Please feel free to ask anything or give hints.
Together we can make LeEco LeMax 1 live longer!
Thought it would be nice to describe my build process.
Basically I'm following these instructions: https://wiki.lineageos.org/devices/oneplus2/build
Of course these instructions are for oneplus2, but the step-by-step is pretty much the same for any device.
I'm using Ubuntu 18.04.1 LTS, in which I created a user specifically for building LineageOS.
I followed all steps on the above link until breakfast oneplus2, since, at this point, I had to create my own device/vendor/kernel tree, so that I can breakfast it.
To do this, I did:
Code:
# clone max1 device
cd ~/android/lineage/device
mkdir letv
cd letv
git clone https://github.com/alexsmithbr/android_device_letv_max1.git max1
# clone max1 vendor
cd ~/android/lineage/vendor
mkdir letv
cd letv
git clone https://github.com/alexsmithbr/android_vendor_letv_max1.git max1
# setup kernel
cd ~/android/lineage/kernel
mkdir letv
cd letv
# change <path_to_file> to the correct path to Le_Max_OpenSource.zip
# you downloaded from the link on the previous post.
unzip <path_to_file>/Le_Max_OpenSource.zip -d max1
# as the zip has unnecessary subfolders, I just moved them
# to their correct names and deleted other rubbish.
mv max1/LeMax_kernel/kernel/ max1/msm8994
rm max1/LeMax_kernel/ -R
In the end, you need a structure like this:
Code:
~/android/lineage/device/letv/max1
~/android/lineage/vendor/letv/max1
~/android/lineage/kernel/letv/msm8994
Finally, put config.gz in its dir:
Code:
adb pull /proc/config.gz /tmp
gunzip /tmp/config.gz -c > ~/android/lineage/kernel/letv/msm8994/arch/arm64/configs/msm8994-max1-perf_defconfig
Okay, now everything is set up for the build to start.
Code:
source build/envsetup.sh
breakfast max1
export USE_CCACHE=1
ccache -M 50G
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
croot
Just before start building, I choose which kind of build I want:
Code:
choosecombo
Build type choices are:
1. release
2. debug
Which would you like? [1] 1
Which product would you like? [lineage_max1]
Variant choices are:
1. user
2. userdebug
3. eng
Which would you like? [eng]
Now, if you want a normal build, you can enter:
Code:
brunch max1
But, if you want a really verbose log (very useful to debug build errors), you can enter:
Code:
mka -j 4 showcommands
Note that -j 4 means 4 simultaneous jobs. You can specify another number. A rule of thumb is to use <number_of_cpus> * 2.
Now the system should build...
At this point:
https://github.com/alexsmithbr/andr...tree/0f9134dd09c269b2da9008c5598060b9d19ac2ef
https://github.com/alexsmithbr/andr...tree/9ece561a945867ab2af733c5ef890b6df5438a8b
The system builds and mka -j 4 showcommands bacon will build flashable lineage-15.1-20190128-UNOFFICIAL-max1.zip.
Unfortunately, when flashing this zip, and restarting the phone, it will vibrate twice when showing the LeEco first screen, then it vibrates twice again and shows me the penguin screen (bootloader).
No luck up to now.
Keep up with the good work... I hope you get the kernel working.
Spunkination said:
Keep up with the good work... I hope you get the kernel working.
Click to expand...
Click to collapse
Me too!
It's so hard to get any help... I've been to freenode as well and nobody wanted to help there. :/
So it feels like a very lonely path. But I'm still on to it.
Currently I'm recompiling everything, now getting "my" tree a bit closer to @ABM30 tree, adapted to LineageOS, instead of CyanogenMod.
Let's see what happens next.
No luck. Boots to penguin (bootloader) screen again.
---------- Post added at 09:37 AM ---------- Previous post was at 09:33 AM ----------
I'm cheering for you. I would very much like 8.1 Good luck ! Good work!
htimsxela said:
Me too!
It's so hard to get any help... I've been to freenode as well and nobody wanted to help there. :/
So it feels like a very lonely path. But I'm still on to it.
Currently I'm recompiling everything, now getting "my" tree a bit closer to @ABM30 tree, adapted to LineageOS, instead of CyanogenMod.
Let's see what happens next.
No luck. Boots to penguin (bootloader) screen again.
Click to expand...
Click to collapse
Hope you are good friend?
How is the build going?
I updated the git repositories. The current version compiles as well and I get a ROM at the end, but unfortunately it doesn't boot. I'm probably missing something in the kernel build. I'm still investigating, but I don't even get to the LineageOS logo. When I turn on the phone, it goes straight to bootloader (penguin) screen.
I'll keep trying. Since a build involves a lot (really!) of variables, there's always something new to try.
And it's good that we keep this thread active. Maybe someone with more knowledge shows up and is able to help.
My biggest issue is I can't find a way of seeing what's wrong, since LeEco patched the kernel in a way there is no /proc/last_kmsg file, nor /sys/fs/pstore/console-ramoops. LeEco implemented it in a way the logs would be written to a partition called letvconfig2, but even there I cannot see any logs.
I read another way of seeing kernel logs would be to use the phone's serial port, but then I'd have to reach its main board, which is not an option currently, since this is my only phone.
In other words, my options now resume to keep trying.
Tomorrow I expect to have some time to resume the work. Will give it some more tries. I'm even thinking about checking out a previous version of LineageOS (when it was still called CyanogenMod), then, once I get it working, try to make my way to newer versions.
Stay tuned!
And again: any hints are more than welcome!
I really believe this thread may become kind of a roadmap to compile android for any unsupported device.
Update: by looking at recovery.img and comparing to the recovery partition on device, I noticed the kernel being built by LineageOS doesn't contain any DTBs. Without DTBs, the kernel won't be able to identify the phone's hardware.
How I checked this:
Code:
$ mkdir /tmp/boot
$ cd /tmp/boot
$ unpackbootimg -i ~/android/lineage/out/target/product/max1/recovery.img -o .
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 androidboot.selinux=permissive buildvariant=userdebug
BOARD_KERNEL_BASE 00000000
BOARD_PAGE_SIZE 4096
$ split-appended-dtb-master/split-appended-dtb recovery.img-zImage
ERROR: Appended Device Tree Blob not found!
I'll try to find out how to automatically add DTBs to the images.
I know there was a variable called TARGET_KERNEL_APPEND_DTB, which should be set to true on older (cyanogenmod) versions, but it is now deprecated. So deprecated that even the "deprecated" messages have been removed by now.
As far as I could figure out, now the action of appending/not appending DTBs to the kernel image is guessed by variable BOARD_KERNEL_IMAGE_NAME. For example:
To add dtb to kernel image, one would do:
Code:
BOARD_KERNEL_IMAGE_NAME := Image-dtb
To don't add dtb to kernel image, one would do:
Code:
BOARD_KERNEL_IMAGE_NAME := Image
I was hoping this would change something, as for me that variable was defined without the -dtb suffix, but I figured out I broke the kernel build:
Code:
make[1]: *** No rule to make target 'Image-dtb'. Stop.
I guess this is because the original kernel is too old (3.10.84) and it's AndroidKernel.mk still relies on TARGET_KERNEL_APPEND_DTB, as we can see on line 68:
Code:
ifeq ($(TARGET_KERNEL_APPEND_DTB), true)
$(info Using appended DTB)
TARGET_PREBUILT_INT_KERNEL := $(TARGET_PREBUILT_INT_KERNEL)-dtb
endif
Patch the kernel? Wow! This is going deep...
* unpackbootimg is part of the android_bootimg_tools. I got it from here: wget https://storage.googleapis.com/goog...d-serialport-api/android_bootimg_tools.tar.gz
* split-appended-dtb is this tool: https://github.com/dianlujitao/split-appended-dtb
Turns out there are two ways of adding DTBs.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
By checking my current recovery partition, I noticed DTBs are attached to partition, not to kernel. I also noticed it is not using a compressed kernel. So I'll configure BoardConfig.mk as:
Code:
BOARD_KERNEL_IMAGE_NAME := Image
If I wanted it gzipped, I'd make it Image.gz. If I wanted the DTBs attached to kernel (not to image), I'd do Image.gz-dtb.
Apparently no kernel patch will be needed... Anyway I created a git repository for it, just in case I need to change something.
Again, the build works, but it doesn't boot.
As I'm focusing on testing the kernel, I'm using the recovery partition.
I just dumped a copy of it with:
Code:
host$ adb shell
phone$ su
phone# cp /dev/block/bootdevice/by-name/recovery /sdcard
phone# exit
phone$ exit
host$ adb pull /sdcard/recovery
and I'm flashing it over and over to test.
To do this, I do
Code:
host$ adb reboot bootloader
# phone reboots
host$ fastboot flash recovery /path/to/recovery.img
# it flashes, then, holding volume-up, I type:
host$ fastboot reboot
Phone will reboot into recovery and test my image (up to now, I only get back to penguin screen (bootloader)).
To flash back my working recovery image, I do the same as above, just changing the path to recovery image.
Bless you and your work
Dude, I would definitely-definitely liked to help; I understand and root for your hard work. But unfortunately I don't possess any knowledge in this area. Yeah, I can flash using manual, but I'm lamer in terms of programming, not even close to IT.
htimsxela said:
Hi there!
Click to expand...
Click to collapse
I rarely meet such wonderful and persistent people like you. I sincerely hope you will succeed and achieve your goal! :good:
Santey Maas said:
Dude, I would definitely-definitely liked to help; I understand and root for your hard work. But unfortunately I don't possess any knowledge in this area. Yeah, I can flash using manual, but I'm lamer in terms of programming, not even close to IT.
Click to expand...
Click to collapse
Thanks, mate! I didn't give up yet. Each try brings more knowledge and I hope I'm able to share all I'm learning. Sort of paving the road for newcomers.
Tircon said:
I rarely meet such wonderful and persistent people like you. I sincerely hope you will succeed and achieve your goal! :good:
Click to expand...
Click to collapse
Thanks! My hope is that - if I succeed - more people can benefit from my work and give these phones a longer life.
LeEco Le Max (max1/x900) Secret Codes
A bit off-topic, but here it goes... While looking for a way to debug kernel boot, I came across those famous secret codes you can type on phone screen to access secret/test menus... This site, for example, says you can use code *#*#76937#*#* to have access to a menu where you can enable/disable some log, debug and AT commands options. I tested and it worked with my phone. Not happy enough, I did a
Code:
grep 76937 / -rl
on the phone and found out system/app/LetvDebugUtil/oat/arm64/LetvDebugUtil.odex was the only place where it occurred. Inspecting the file, I found, right next to the occurrence, the code 9439. Just to test, I entered *#*#9439#*#* on the phone and got to a Chinese menu (see attached picture). The translation of these Chinese stuff is "Launch China Telecom Network (CDMA)". I didn't check that box to see what happens.
Current known codes
*#*#76937#*#* - Menu where you can enable/disable some log, debug and AT commands options.
*#*#9439#*#* - Launch China Telecom Network (CDMA)
*#*#8888#*#* - Advanced settings. Here you can turn on logging of App, Modem, Net, Kernel, Bluetooth, GPS and WiFi. Logs are stored in /sdcard
*#0000# - About phone. Information about each card slot.
*#06# - MEID & IMEI numbers.
If you're having this error while trying to build LineageOS:
Code:
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -o/home/android_build/android/lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll"
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/android_build/android/lineage'
You're probably having the same issue I'm having with Flex. The easiest option is to recompile it. And it's easy.
Code:
$ cd prebuilts/misc/linux-x86/flex
$ mkdir flex-2.5.39-src
$ cd flex-2.5.39-src
$ tar zxvf ../flex-2.5.39.tar.gz
$ ./configure
$ make
$ cp flex ../flex-2.5.39
$ cd ..
$ rm flex-2.5.39-src -R
The above commands will recompile Flex for your architecture and everything should be fine (with Flex).
Some news regarding the overall progress with LineageOS.
I checked out the repo from cm-14.1 (cyanogenmod 14.1) and am now trying to build for it. If it builds, at least we'll have Android 7.1.x running on device. And - I believe - it could bring some light to start a port to a newer version (Lineage 15.1).
Up to now, I faced the same compile errors I got when compiling for 15.1, so it's being straight forward. I'm anxious to see if it'll boot. :fingers-crossed:
As usual, I'll keep you posted.
htimsxela said:
Some news regarding the overall progress with LineageOS.
I checked out the repo from cm-14.1 (cyanogenmod 14.1) and am now trying to build for it. If it builds, at least we'll have Android 7.0.1 running on device. And - I believe - it could bring some light to start a port to a newer version (Lineage 15.1).
Up to now, I faced the same compile errors I got when compiling for 15.1, so it's being straight forward. I'm anxious to see if it'll boot. :fingers-crossed:
As usual, I'll keep you posted.
Click to expand...
Click to collapse
Thanks for your effort!
This phone is great and it's pity that it was left without support..
htimsxela said:
Some news regarding the overall progress with LineageOS.
I checked out the repo from cm-14.1 (cyanogenmod 14.1) and am now trying to build for it. If it builds, at least we'll have Android 7.0.1 running on device. And - I believe - it could bring some light to start a port to a newer version (Lineage 15.1).
Up to now, I faced the same compile errors I got when compiling for 15.1, so it's being straight forward. I'm anxious to see if it'll boot. :fingers-crossed:
As usual, I'll keep you posted.
Click to expand...
Click to collapse
BTW if someone is curious out there, here's the CyanogenMod 14.1 branch I'm working on: https://github.com/alexsmithbr/android_device_letv_max1/tree/cm-14.1
It was based on CyanogenMod 12.1 and the code is almost three years old (last commit), so I'm spending some time updating obsolete code, etc.
Donnie2Darko said:
Thanks for your effort!
This phone is great and it's pity that it was left without support..
Click to expand...
Click to collapse
Yeah, let's see if I can help changing this scenario.

[SM-G9750] Random root reboot fix (Snapdragon S10 & S10e probably, too)

WARNING: This won't work currently for the SM-G9730. I need a recovery.img(.lz4) from the latest firmware.
Here's a not-so-widely-tested fix for the spontaneous reboot that occurs after rooting the SM-G9750 and other Snapdragon S10 models.
tulth located this patch. If you read the description of that patch, it mentions a NULL pointer getting dereferenced in find_get_entry (such a thing tends to cause crashes in your average program, so when this happens in the kernel, it's not surprising that a crash and reset is the response). If you look at tulth's last_kmsg, my last_kmsg and G-ThGraf's last_kmsg from a G9730, you'll notice they all have one thing in common: SHTF at smaps_pte_range+0x29c. What's at that location on those devices' kernel? Why it's only find_get_entry(vma->vm_file. So yeah, it's the same bug, already known to Google and it's been fixed in their kernel tree since January. The bug is triggered externally by reading /proc/<pid>/smaps_rollup under certain conditions. You might be able to workaround this by disabling programs to get more free RAM, but The Only Way To Fix the Underlying Kernel Bug Is To Fix the Kernel Itself™.
We're probably not going to see a new kernel update until (if?) we get an update for the next major version of Android. We Snapdragon S10* users already have an older kernel compared to Exynos S10 owners (our 4.14.78 vs. their 4.14.85) and it's probably because of that they don't see this bug. So I think the idea of Samsung fixing this is a non-starter. While I did manage to build an SM-G9750 kernel from source (their instructions leave a lot to be desired) with that patch applied, I could not get my phone to boot the result.
I am not a programmer, but I do know just slightly enough to get the ball rolling and provide the fix that that aforementioned patch does in the opcode form that can be applied onto the existing kernel on the phone.
While I've not half-arsed it in the sense I took the easy way out (always having mss->check_shmem_swap set to zero is an easy one-liner workaround; however, freeing of unneeded SHM pages wouldn't happen, eventually causing your phone to crawl to a halt), I am not familiar with assembly language for any platform at all and, as such, I could not find a way to free up enough space in the show_smap function. So I jump quite far out into a chunk of the .text section where it's full of zeroes. I don't know anything about the ELF format to be able to tell you why this section of zeroes exists - I make the probably-wrong assumption it's perhaps a requirement of the ELF format if a linker that's very good at producing optimised code still bothers to output that or it's optimisation by alignment - but it's there and it's a good place to add extra code to on account of, you know, being empty and marked executable.
As far as I can see, where I have placed the code isn't referenced by anything else at all in the kernel but I can't be 100% certain on that. Nevertheless, I've been testing this on and off (I've had to manually initiate reboots in between for various reasons) myself for the past seven days or so and I've not noticed any adverse effects.
EDIT: Saying that, I think I'll try and move the code into load_module() when I get time because this kernel can't actually load modules (see below) thus much of the code there is pointless.The risk is yours, should you choose to apply this fix.
I would've liked to wrote this as a kernel module, being far easier to maintain, and hooked the relevant smap functions (in a similar vein to flar2's wp_mod and AleksJ's ric_mod) but thanks to the geniuses at Samsung, load_module() will always return early and the compiler accordingly realises it can optimise the function by excising all the code needed to actually load a module - there's no point in keeping unreachable code. Why Samsung bothered turning on mandatory module signing is beyond me because modules will never load! You can see this for yourself: insmod /system/vendor/lib/modules/wil6210.ko will always fail with "Exec format error", and that's a signed module built and shipped by Samsung themselves for their kernel. Anyway.
As long as the kernel version remains the same, it's likely, but not guaranteed, the same patches will work for future software updates from Samsung and all I'll have to do is update the compatibility list. If you try this on any other kernel version, the chances of not being able to boot are very high. The task of maintaining this doesn't enthuse me, but I'll continue to do so out of necessity, for I like having a rooted phone but not one that restarts at the worst of times.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I know people have reported longer uptimes than that on their phone before having a forced restart, but in my case, my phone has AOD enabled, the latest stable Magisk version installed and is running EdXposed. Before this fix, I've never seen an uptime longer than about 16 hours (usually less), regardless of whether the phone was in use or not, as getting multiple restarts in a day tends to have that effect.
As long as you only write to the recovery partition (and that's the only block device that this guide tells you to write to ), you should always be able to use Odin to reflash it to reverse this, the process being somewhat similar to flashing Magisk in the first place but with the notable exception of not needing to factory reset anything. The following flashing routine was adapted from Magisk, so my thanks to topjohnwu.
If someone has the bright idea of sharing their already-patched recovery.img because typing copy and pasting commands is hard, I'll point out the following: anybody flashing such an image should really make sure they're running the same firmware and Magisk version the image was designed for. (And after reading ianmacd's posts, topjohnwu supposedly doesn't like pre-patched images with Magisk being shared. I'll respect that, and so should you.)
I won't take any responsibility if this damages your phone. Perform the following at your own risk. If you agree, then:
If you haven't already, root the phone with Magisk. Make sure to keep a copy of the magisk_patched.tar somewhere on your computer so you can reflash it with ODIN if something goes wrong here. Always make sure Magisk is installed before modifying the recovery partition yourself. If you have a pending software update, install that with Odin and root that first before doing the following.
Set up ADB on your phone and computer
From your computer, adb shell into the phone
Run
Code:
uname -r
Only attempt to apply these patches if you get 4.14.78-16509050 back. For an older version, the bottom of this post has previous patches that may or may not apply. Or just update your phone.
Run
Code:
su
and then
Code:
rm -rf /data/local/tmp/q12kpwrk ; mkdir /data/local/tmp/q12kpwrk && cd /data/local/tmp/q12kpwrk
Run
Code:
mkdir recovery && cd recovery
Find the recovery partition on your phone by running:
Code:
recovery_blk="`readlink -f /dev/block/by-name/recovery`" ; [ -b "$recovery_blk" ] || echo "Eh, something's off here. Don't continue"
Dump it to a file by running:
Code:
dd if="$recovery_blk" of=recovery.img
Extract the kernel by running:
Code:
/data/adb/magisk/magiskboot unpack recovery.img || echo "Stop! Do not continue!"
If you see the warning message again on a new line, then stop.
Otherwise, if all went well with the step above (the message "Kernel is uncompressed or not a supported compressed type!" can be safely disregarded), then note that for any of these patches, if you don't get any matches or get more than one, then do not continue any further. Don't selectively apply any of these patches; it's all or nothing.
Apply the first patch by running:
Code:
/data/adb/magisk/magiskboot hexpatch kernel F7030032895240F9F64F00F9 F7030032FD10F997F64F00F9
Run
Code:
/data/adb/magisk/magiskboot hexpatch kernel 02000014C02E00F9E1630191 02000014ED10F997E1630191
If you have an SM-G9750/Snapdragon S10+: run
Code:
/data/adb/magisk/magiskboot hexpatch kernel F30300AAA1010035F40313AA750640F9890E41F83F7500F103010054AA02098BC10501B0407100D121B83191 F30300AA0D000014895240F9DF420239C0035FD600000000D22E40F94E02008BCE2E00F9C0035FD621B83191
OR if you have an SM-G9730/Snapdragon S10: there is currently no patch. Feel free to send me a recovery.img from the latest firmware and I'll adapt it
OR if you have an SM-G9700/Snapdragon S10e (thanks to Laikar_ for the recovery.img and testing): run
Code:
/data/adb/magisk/magiskboot hexpatch kernel F30300AAA1010035F40313AA750640F9890E41F83F7500F103010054AA02098BA10501D0407100D121B81D91 F30300AA0D000014895240F9DF420239C0035FD600000000D22E40F94E02008BCE2E00F9C0035FD621B81D91
Have the patched kernel placed into a new recovery image, new-boot.img, by running:
Code:
/data/adb/magisk/magiskboot repack recovery.img || echo "Stop! Do not continue!"
Check to see if new-boot.img isn't somehow larger than the recovery partition itself by running
Code:
[ `stat -c '%s' "new-boot.img"` -gt `blockdev --getsize64 "$recovery_blk"` ] && echo "Do not continue!"
Flash the new recovery image by running
Code:
cat new-boot.img /dev/zero >"$recovery_blk" 2>/dev/null
Run
Code:
sync ; sync ; sync ; reboot recovery
If the phone boots again, great! If you're stuck at the Samsung-only logo that fades in and out for many minutes, just restart the phone again whilst holding the recovery button combo to boot into Android with Magisk activated like normal.
You can rm -rf the /data/local/tmp/q12kpwrk folder afterwards to get some space back.
If your phone keeps restarting, or you automatically get put into semi-bootloader flashing mode, hold the bootloader button combo to get to the blue-background downloading mode and reflash magisk_patched.tar (and HOME_CSC) with Odin. If you didn't keep said file or a Magisk-patched recovery.img you can tar up with 7-Zip and get Odin to flash as AP, you'll need to download the latest firmware for your SM-G9750 with Frija or similar, reflash that and then follow the instructions to root your phone again with Magisk.
If you do get a reboot after applying this, looking at /proc/last_kmsg will indicate if it's something to do with this patch or something else entirely.
Q&A:
Q: Will I have to reapply this if I update Magisk from Magisk Manager with a direct install?
A: No.
Q: Will I have to reapply this if I update the phone's firmware?
A: Yes, but check the new kernel's version first and see if it's listed in the compatibility section. If not, then you'll need to wait for an update to this fix. And remember to make sure that Magisk is installed first before modifying the recovery partition yourself.
Q: I don't want to wait hours to see if my phone will restart out of the blue. How can I test for this bug?
A: A variation on the steps to reproduce here, you can do this:
Code:
su
dd if=/data/media/0/AP_G9750ZHU1ASF1_CL16082828_QB24224470_REV00_user_low_ship_MULTI_CERT_meta_OS9.tar.md5 of=/dev/shm # or any very large file (3-4 GB, /dev/urandom might work). This fills up the allocated space for shared memory
cat /proc/*/smaps_rollup
If your kernel isn't patched, restart your phone certainly does. (Of course, you should probably run reboot recovery anyway if not because a full SHM isn't really conducive to a well-running Android session.)
Q: Do you have any other kernel patches?
A: Just the one, only tested on the SM-G9750, and it seems to not be needed at all - it has no bearing on this specific reboot issue anyway. This one disables one aspect of RKP. Again, I don't think this is actually needed on the S10+ , but Magisk still attempts to patch for this issue indiscriminately (probably for the benefit of older devices), although its patch will not apply to our kernel.
Code:
/data/adb/magisk/magiskboot hexpatch kernel 1FA50F7143010054491540B93FA50F71E30000544B0940B97FA50F71830000544A1940B95FA10F7168090054 1FA10F71810A0054491540B93FA10F71200A00544B0940B97FA10F71C00900544A1940B95FA10F7161090054
Q: Are you a dirty GPL violator, qwerty12?
A: No! What I am providing is the compiled form of the patch linked to in the beginning of this thread. If you want to understand what this does in lovely C, just look at that patch. Of course, I have to deal with this on the assembler level, so there is no source per se, just dump all the hex strings into an online disassembler. The first two magiskboot hexpatch invocations replace two existing instructions with jumps into the new code I add. The third hexpatch invocation adds the additional code implementing the patch - the original replaced instruction is executed, along with the code I added to set mss->check_shmem_swap to zero before vma->vm_file is checked for != NULL and for shmem_swapped to be added to mss->swap instead of replacing it.
Patches for older kernels:
4.14.78-16082828:
Use Magisk Manager to install the Busybox Magisk module. No, this is not optional. You can use a version of Busybox from another source, but note that this is the version I have personally tested all this with. Restart your phone anyway if you already have it installed; you want your phone's running state to be as fresh as possible to avoid the possibility of running into this bug while attempting to fix it.
Code:
/data/adb/magisk/magiskboot hexpatch kernel F7030032895240F9F64F00F9 F70300327ED15494F64F00F9
Code:
/data/adb/magisk/magiskboot hexpatch kernel 02000014C02E00F9E1630191 020000146ED15494E1630191
Code:
printf '\x89\x52\x40\xF9\xDF\x42\x02\x39\xC0\x03\x5F\xD6\x00\x00\x00\x00\xD2\x2E\x40\xF9\x4E\x02\x00\x8B\xCE\x2E\x00\xF9\xC0\x03\x5F\xD6' | busybox dd of=kernel bs=1 seek="$((0x017F9AAC + 20))" conv=notrunc
The magiskboot hexpatch equivalent of this was too large, so I settled for writing to a hard coded offset.
I have random reboot... will try this patch tomorrow.
Sent from my SM-G9750 using Tapatalk
Hi... already doing your patches... i thinks succesfully, because i dont have any error, and boot normally after last command.
So.... i have to wait if random reboot appear right ? *to test*
Thank you... will report in about 3 days
Hi,
Vuska said:
So.... i have to wait if random reboot appear right ? *to test*
Click to expand...
Click to collapse
You can run the commands under "Q: I don't want to wait hours to see if my phone will restart out of the blue. How can I test for this bug?" in the first post. If your phone restarts automatically when running cat, then your phone is still susceptible to restarting itself during use.
If it doesn't restart, then you need to run reboot recovery yourself immediately, but it means the fix was successfully applied.
PS D:\S10+\ADB platform-tools> ./adb devices
List of devices attached
R28M31K3DNZ device
PS D:\S10+\ADB platform-tools> ./adb shell
beyond2q:/ $ su
Permission denied
1|beyond2q:/ $
?????
N1ldo said:
PS D:\S10+\ADB platform-tools> ./adb devices
List of devices attached
R28M31K3DNZ device
PS D:\S10+\ADB platform-tools> ./adb shell
beyond2q:/ $ su
Permission denied
1|beyond2q:/ $
?????
Click to expand...
Click to collapse
do you already install busybox via magisk ? also there will be a pop up in your device to request access from computer. accept it
already enable usb debugging in developer menu ?
permission denied .... [emoji848] .. strange... already rooted right ?
Sent from my SM-G9750 using Tapatalk
Vuska said:
do you already install busybox via magisk ? also there will be a pop up in your device to request access from computer. accept it
already enable usb debugging in developer menu ?
permission denied .... [emoji848] .. strange... already rooted right ?
Sent from my SM-G9750 using Tapatalk
Click to expand...
Click to collapse
Yes.
As you can see in the prints below.
i try install another busybox to.
N1ldo said:
beyond2q:/ $ su
Permission denied
1|beyond2q:/ $
?????
Click to expand...
Click to collapse
Check your Magisk settings to see if you haven't turned off ADB superuser access and your apps list for a denied Shell entry.
qwerty12 said:
Check your Magisk settings to see if you haven't turned off ADB superuser access and your apps list for a denied Shell entry.
Click to expand...
Click to collapse
Thank you all ...:good::good:
Yes Shell was unauthorized root on Magisk application list :victory:
3 days now.... i can say it successfully fixed.... [emoji106][emoji106]
Thank you.
hope you will update too when new firmware arrives....
because i dont understand some code mean.... just follow and copy paste
Sent from my SM-G9750 using Tapatalk
*ASG7 firmware is out
I can provide a recovery.img from s10e (smg9700), also any way i can contact you for some help about building the kernel? I have been trying to do with s10e's one and i'm not having much success
FlatOutRU said:
*ASG7 firmware is out
Click to expand...
Click to collapse
Downloading...
is ASG7 can use this patches ?
Sent from my SM-G9750 using Tapatalk
FlatOutRU said:
*ASG7 firmware is out
Click to expand...
Click to collapse
Vuska said:
s ASG7 can use this patches ?
Click to expand...
Click to collapse
I'll download the update later and give it a once-over; however, I'll quote myself:
qwerty12 said:
As long as the kernel version remains the same, it's likely, but not guaranteed, the same patches will work for future software updates from Samsung and all I'll have to do is update the compatibility list.
Click to expand...
Click to collapse
Laikar_ said:
I can provide a recovery.img from s10e (smg9700), also any way i can contact you for some help about building the kernel? I have been trying to do with s10e's one and i'm not having much success
Click to expand...
Click to collapse
That would be appreciated, thanks. I can move the S10e into the "Patch not tested" section of the compatibility list.
I wish you'd have asked me this a few days ago, I deleted the kernel tree I had on my disk because I thought a new source ZIP from Samsung would be forthcoming for the new firmware. I'd've just attached a diff...
I did get the kernel to build but I could not get the result to boot. Some of the compiler warnings displayed during build didn't make it seem like I was going to get a working kernel image. I'll get back to you soon with some steps
qwerty12 said:
That would be appreciated, thanks. I can move the S10e into the "Patch not tested" section of the compatibility list.
I wish you'd have asked me this a few days ago, I deleted the kernel tree I had on my disk because I thought a new source ZIP from Samsung would be forthcoming for the new firmware. I'd've just attached a diff...
I did get the kernel to build but I could not get the result to boot. Some of the compiler warnings displayed during build didn't make it seem like I was going to get a working kernel image. I'll get back to you soon with some steps
Click to expand...
Click to collapse
I can't post links yet, tinyurl(dot)com/y537462u for the drive download link
Does EdXposed work for G9750?
qwerty12 said:
I'll download the update later and give it a once-over; however, I'll quote myself:
Click to expand...
Click to collapse
Its changed a bit
kakahoho said:
Does EdXposed work for G9750?
Click to expand...
Click to collapse
Yes.
FlatOutRU said:
Its changed a bit
Click to expand...
Click to collapse
Good call; there's now code at 0x017F9AAC + 20, probably not a good idea to overwrite that...
I was hoping the newer build date might have meant that Samsung applied the patch, meaning I could abandon this thread, but no such luck: I did the quick writing to /dev/shm test and my phone kernel panicked. Lovely.
I've updated the first thread with an updated patch. I followed through with my plan of moving my extra code into load_module() instead of the empty section of zeros as, thanks to Samsung's kernel developers' ineptness, that function will always fail - may as well make it early return and then use the extra space gained to store my code in.
Laikar_ said:
I can't post links yet, tinyurl(dot)com/y537462u for the drive download link
Click to expand...
Click to collapse
Thanks for the S10e recovery image, Laikar_. I've checked the recovery image's kernel and moved the S10e into the "Patch not tested" section. I'll write up some steps soon on building a kernel that won't boot
Anyway,
The S10 and S10e recovery images are not from ASG7, however, so I don't know if my newer patch applies to it but my old ones do. I think my newer one will do, too, but that's an educated guess.
Just like with the S10, anybody's welcome to try this on their S10e and let me know of the result.
qwerty12 said:
Yes.
Good call; there's now code at 0x017F9AAC + 20, probably not a good idea to overwrite that...
I was hoping the newer build date might have meant that Samsung applied the patch, meaning I could abandon this thread, but no such luck: I did the quick writing to /dev/shm test and my phone kernel panicked. Lovely.
I've updated the first thread with an updated patch. I followed through with my plan of moving my extra code into load_module() instead of the empty section of zeros as, thanks to Samsung's brainiac developers, that function will always fail - may as well make it early return and then use the extra space gained to store my code in.
Thanks for the S10e recovery image, Laikar_. I've checked the recovery image's kernel and moved the S10e into the "Patch not tested" section. I'll write up some steps soon on building a kernel that won't boot
Anyway,
The S10 and S10e recovery images are not from ASG7, however, so I don't know if my newer patch applies to it but my old ones do. I think my newer one will do, too, but that's an educated guess.
Just like with the S10, anybody's welcome to try this on their S10e and let me know of the result.
Click to expand...
Click to collapse
so the first post already update to 050 kernel right ?
mean after i updated my s10+ magisk etc.. i can do that all steps right ?
cool...
still not yet finished my download since yesterday... my internet down.. [emoji2357]
Sent from my SM-G9750 using Tapatalk
Vuska said:
so the first post already update to 050 kernel right ?
mean after i updated my s10+ magisk etc.. i can do that all steps right ?
Click to expand...
Click to collapse
Yep, the first post is updated for ASG7. Those steps are working on my SM-G9750 running it, anyway
Laikar_ said:
[...]any way i can contact you for some help about building the kernel? I have been trying to do with s10e's one and i'm not having much success
Click to expand...
Click to collapse
I'll mention again that I couldn't get the result to boot. If you work it out, please let me know. I hate loading kernel images into a disassembler
I did this on a Ubuntu 18.04.2 minimal installation. I figure that if you want to build a kernel then you, like me, have at least a working familiarity with GNU/Linux, so I won't go too in-depth.
First, install the packages needed to build:
Code:
sudo apt install git-core gnupg flex bison gperf build-essential zip zlib1g-dev libxml2-utils xsltproc unzip python bc libssl-dev
Download the toolchain mentioned in README_kernel.txt:
Code:
git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
Download Snapdragon LLVM Compiler for Android v6.0.9 - Linux64 from https://developer.qualcomm.com/software/snapdragon-llvm-compiler-android/tools and untar it somewhere on your system. (This isn't actually the exact compiler Samsung use - if you look at /proc/version on your phone, you'll see it says 6.0.10 - but this is the closest we mere mortals will get.)
Download the source code zip from Samsung and untar Kernel.tar.gz into a newly-created folder. Inside said folder, run chmod 644 Makefile ; chmod 755 build_kernel.sh.
Open build_kernel.sh in your favourite editor. Make the following changes:
Set BUILD_CROSS_COMPILE to the folder where aarch64-linux-android-gcc, aarch64-linux-android-ld etc. are after cloning from git. Make sure to leave the aarch64-linux-android- suffix at the end. For me, this line looks like this:
Code:
BUILD_CROSS_COMPILE=/home/fp/x/aarch64-linux-android-4.9/bin/aarch64-linux-android-
KERNEL_LLVM_BIN needs to be set to the location of the Clang binary downloaded from Qualcomm. For me, this line looks like this:
Code:
KERNEL_LLVM_BIN=/home/fp/x/93270/toolchains/llvm-Snapdragon_LLVM_for_Android_6.0/prebuilt/linux-x86_64/bin/clang
After both REAL_CC=$KERNEL_LLVM_BIN instances add
Code:
CFP_CC=$KERNEL_LLVM_BIN
(although I think this is the wrong way to do it, consider just disabling CONFIG_RKP_CFP)
Open the Makefile in your favourite editor. Find the following line
Code:
@echo Cannot use CONFIG_CC_STACKPROTECTOR_$(stackp-name): \
$(stackp-flag) not supported by compiler >&2 && exit 1
Remove the "&& exit 1". The proper way to fix this would be to set CONFIG_CC_STACKPROTECTOR_STRONG to n in the config file; however if you run clang --help, you'll see that -fstack-protector-strong is actually supported. Why turn off a useful security feature?
Run build_kernel.sh and the kernel should build (albeit with a metric crap-ton of warnings, which is just one reason why it's not surprising the resulting kernel won't boot)

Categories

Resources