how to make roms? - OnePlus X Q&A, Help & Troubleshooting

can some dev post the method to make roms like @hunfatal it will be easier to bring other roms to this device. im sure a lot of users would be interested in using variety of roms

https://www.google.pt/search?source...i19k1j0i22i30i19k1j0i22i10i30k1.0.f0TyAkeA2NU
google is your friend...
you have to learn by yourself if you have no one that teaches you... I learned myself too...
4 essential things:
1- rom source
2-device tree
3- device kernel
4-device vendor

Marado said:
https://www.google.pt/search?source...i19k1j0i22i30i19k1j0i22i10i30k1.0.f0TyAkeA2NU
google is your friend...
you have to learn by yourself if you have no one that teaches you... I learned myself too...
4 essential things:
1- rom source
2-device tree
3- device kernel
4-device vendor
Click to expand...
Click to collapse
how do u integrate security patches?

psychem said:
how do u integrate security patches?
Click to expand...
Click to collapse
Security patches are integrated when you update the source with "Repo sync"...
on older versions like lollipop or marshmallow don´t know never tried it..
maybe with git pull or git merge...

Marado said:
Security patches are integrated when you update the source with "Repo sync"...
on older versions like lollipop or marshmallow don´t know never tried it..
maybe with git pull or git merge...
Click to expand...
Click to collapse
what if the source hasnt been updated? like hunfatal was updating RR before LOS was updated by YM

psychem said:
what if the source hasnt been updated? like hunfatal was updating RR before LOS was updated by YM
Click to expand...
Click to collapse
You can send a pm to @hunfatal, he will certainly respond your questions....
but RR is based on lineage, so their source is synchronized.

:good: I left a msg on his thread. He wants to keep it a secret :angel:

psychem said:
:good: I left a msg on his thread. He wants to keep it a secret :angel:
Click to expand...
Click to collapse
Send pm to him...
I could build a rom, but Yumemichi is doing a great job, then i´m focusing my energy
on a great custom kernel for onyx...:silly:

Marado said:
Send pm to him...
I could build a rom, but Yumemichi is doing a great job, then i´m focusing my energy
on a great custom kernel for onyx...:silly:
Click to expand...
Click to collapse
looking forward to the kernel!

psychem said:
looking forward to the kernel!
Click to expand...
Click to collapse
It´s a kernel like many others...:crying:
but did you already build a rom or not? just ask if you have any questions...

Marado said:
It´s a kernel like many others...:crying:
but did you already build a rom or not? just ask if you have any questions...
Click to expand...
Click to collapse
will do it over the weekend when i have free time. will ask then

Marado said:
Send pm to him...
I could build a rom, but Yumemichi is doing a great job, then i´m focusing my energy
on a great custom kernel for onyx...:silly:
Click to expand...
Click to collapse
I have tried most of the custom ROMs available for onyx but I always had to switch back to stock because I faced one common issues in all ROMs : heavy app like snapchat, amazon, Instagram, etc stops working in some time and I have to reopen that app to continue might be because:
>> Its not allowing more CPU usage or might be I need to change Kernel
or
>> device get uncertified after installing custom ROM so version of apps from playstore are not stable or compatible with device
or
>> Some problem with patching WebView with G-Apps
I am just guessing the reasons but you can guide me with possible solution to help my experience with customized ROMs more smoother on OPX

cd247 said:
I have tried most of the custom ROMs available for onyx but I always had to switch back to stock because I faced one common issues in all ROMs : heavy app like snapchat, amazon, Instagram, etc stops working in some time and I have to reopen that app to continue might be because:
>> Its not allowing more CPU usage or might be I need to change Kernel
or
>> device get uncertified after installing custom ROM so version of apps from playstore are not stable or compatible with device
or
>> Some problem with patching WebView with G-Apps
I am just guessing the reasons but you can guide me with possible solution to help my experience with customized ROMs more smoother on OPX
Click to expand...
Click to collapse
Have no idea... But i know that Snapchat was app problem, i think with the last update is working...
other apps i dont know...

Marado said:
Have no idea... But i know that Snapchat was app problem, i think with the last update is working...
other apps i dont know...
Click to expand...
Click to collapse
@Marado
 @YumeMichi
 @hunfatal
i was trying to build but got into some problems
i overwrote this symlink file when i was trying to solve the errors below - manifest.xml from /root/android/lineage/.repo/ . how do i get it back?
errors were
Code:
[email protected]:~/android/lineage# repo init -u https://github.com/YumeMichi/kernel_oneplus_onyx.git -b lineage-16.0
From https://github.com/YumeMichi/kernel_oneplus_onyx
+ 0419ab9712e...975fdef3f0e cm-14.1 -> origin/cm-14.1 (forced update)
+ 954e6772a58...4e6c6a06b1e cm-14.1-sultan -> origin/cm-14.1-sultan (forced update)
+ 3e184d8da6c...c87e54b532b lineage-15.1-sultan -> origin/lineage-15.1-sultan (forced update)
+ 5b3dca0a275...674e2f500b0 lineage-16.0 -> origin/lineage-16.0 (forced update)
.repo/manifests/: discarding 23 commits
fatal: manifest 'default.xml' not available
fatal: manifest default.xml not found
Code:
[email protected]:~/android/lineage# breakfast onyx
including vendor/lineage/vendorsetup.sh
build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_onyx".
11:42:12 dumpvars failed with: exit status 1
Device onyx not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Found repository: android_device_oneplus_onyx
Traceback (most recent call last):
File "vendor/lineage/build/tools/roomservice.py", line 258, in <module>
default_revision = get_default_revision()
File "vendor/lineage/build/tools/roomservice.py", line 114, in get_default_revision
m = ElementTree.parse(".repo/manifest.xml")
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1182, in parse
tree.parse(source, parser)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 647, in parse
source = open(source, "rb")
IOError: [Errno 2] No such file or directory: '.repo/manifest.xml'
build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_onyx".
11:42:14 dumpvars failed with: exit status 1
build/make/core/product_config.mk:234: error: Can not locate config makefile for product "lineage_onyx".
11:42:14 dumpvars failed with: exit status 1
** Don't have a product spec for: 'lineage_onyx'
** Do you have the right repo manifest?

Marado said:
Send pm to him...
I could build a rom, but Yumemichi is doing a great job, then i´m focusing my energy
on a great custom kernel for onyx...:silly:
Click to expand...
Click to collapse
Whoa !!
For Pie ?
Great news ! You can PM me for testing !

@psychem you are building Lineageos?
---------- Post added at 12:17 PM ---------- Previous post was at 12:15 PM ----------
Kéno40 said:
Whoa !!
For Pie ?
Great news ! You can PM me for testing !
Click to expand...
Click to collapse
I will release it for everybody testing....:silly:

Marado said:
you are building Lineageos?
---------- Post added at 12:17 PM ---------- Previous post was at 12:15 PM ----------
I will release it for everybody testing....:silly:
Click to expand...
Click to collapse
trying to.

psychem said:
trying to.
Click to expand...
Click to collapse
try repo sync again...

Marado said:
try repo sync again...
Click to expand...
Click to collapse
Code:
[email protected]:~/android/lineage# repo sync
Traceback (most recent call last):
File "/root/android/lineage/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/root/android/lineage/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/root/android/lineage/.repo/repo/main.py", line 158, in _Run
copts, cargs = cmd.OptionParser.parse_args(argv)
File "/root/android/lineage/.repo/repo/command.py", line 67, in OptionParser
self._Options(self._optparse)
File "/root/android/lineage/.repo/repo/subcmds/sync.py", line 189, in _Options
self.jobs = self.manifest.default.sync_j
File "/root/android/lineage/.repo/repo/manifest_xml.py", line 360, in default
self._Load()
File "/root/android/lineage/.repo/repo/manifest_xml.py", line 407, in _Load
self.manifestProject.worktree))
File "/root/android/lineage/.repo/repo/manifest_xml.py", line 443, in _ParseManifestXml
root = xml.dom.minidom.parse(path)
File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 922, in parse
fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: '/root/android/lineage/.repo/manifest.xml'

you have the repo bin folder inside Lineage source folder?
if yes delete it, and open terminal in desktop and place it there...
you´re using yumemichi´s sources right? the easiest way to build is download the sources direct from yume github, place in lineage source "device" "kernel" and "vendor", change the makefiles in device folder (in this case there is no need because yumemichi source is for lineage too) and brunch onyx....
In this way you don´t need to mess with manifest files (that is probably what you did) and if they´re wrong is a pain to sync back the source...

Related

GT-S 5300 kernel recompile

Good morning from Germany!
I would like to recompile my kernel on the gt-s 5300 device, so that i could install / setup some application and modules.
Basically i would like to enable the usb gadget on this android device, as far as i am informed, a kernel recompile is needed.
i have done a few kernel recompiles for linux systems, but never for a android smartphone.
maybe someone could point me to the right path ?
thanks all for your help!
kind regards
no help ?
no help ?
thanks a lot ...
Self-plug.
http://forum.xda-developers.com/showthread.php?t=1748297
thewadegeek said:
Self-plug.
http://forum.xda-developers.com/showthread.php?t=1748297
Click to expand...
Click to collapse
Hello,
Yes I have read your post - and everything worked fine.
My question now is how to get my own module to be compiled?
I have my sourcecode but not sure where to place the module and what references in which Makefile have to be done ..?
Thanks for your help.
Kind regards
Stock GT-5300 kernel built, but won't boot
I've been able to create a zImage from the GT-S5300 open source kernel code, using the bcm21553_cori_04_defconfig as indicated by the accompanying readme file.
However, when I use this kernel to create a boot.img and download using Odin, I get a quick S5300 startup screen, then nothing.
At this point, I'm just trying to build a stock kernel, no modifications. I'm looking for helpful hints on where to find any debug or error messages that will help indicate what is going wrong. I can use Odin to put the prebuilt stock kernel back, and it boots ok once again.
I've compared my boot.img with a stock boot.img (samfirmware sourced), and they are similar in terms of addresses and pagesizes. The ramfs file is also stock, taken from that same stock boot.img. The built kernel is a bit larger than the stock and I'm not sure if I should expect my built kernel to be exactly the same size, or if it's ok for it to be a few KBs different.
Any other parameters or configurations that I might be missing or should check? (And to samsungkid, were there any special steps that you took?)
Thank You!
ric105 said:
I've been able to create a zImage from the GT-S5300 open source kernel code, using the bcm21553_cori_04_defconfig as indicated by the accompanying readme file.
However, when I use this kernel to create a boot.img and download using Odin, I get a quick S5300 startup screen, then nothing.
At this point, I'm just trying to build a stock kernel, no modifications. I'm looking for helpful hints on where to find any debug or error messages that will help indicate what is going wrong. I can use Odin to put the prebuilt stock kernel back, and it boots ok once again.
I've compared my boot.img with a stock boot.img (samfirmware sourced), and they are similar in terms of addresses and pagesizes. The ramfs file is also stock, taken from that same stock boot.img. The built kernel is a bit larger than the stock and I'm not sure if I should expect my built kernel to be exactly the same size, or if it's ok for it to be a few KBs different.
Any other parameters or configurations that I might be missing or should check? (And to samsungkid, were there any special steps that you took?)
Thank You!
Click to expand...
Click to collapse
Thanks for bashing my thread...
Might be better to create your own ?
Will do.
samsungkid said:
Thanks for bashing my thread...
Might be better to create your own ?
Click to expand...
Click to collapse
Hadn't seen much traffic on S5300, saw you 'everything worked fine' comment, and thought I might find some tips here.
I will post a separate thread.
Regards
ric105 said:
Hadn't seen much traffic on S5300, saw you 'everything worked fine' comment, and thought I might find some tips here.
I will post a separate thread.
Regards
Click to expand...
Click to collapse
yes please - coz this thread is still open...
waiting for someone to reply for my last questions...
ric105 said:
I've been able to create a zImage from the GT-S5300 open source kernel code, using the bcm21553_cori_04_defconfig as indicated by the accompanying readme file.
However, when I use this kernel to create a boot.img and download using Odin, I get a quick S5300 startup screen, then nothing.
At this point, I'm just trying to build a stock kernel, no modifications. I'm looking for helpful hints on where to find any debug or error messages that will help indicate what is going wrong. I can use Odin to put the prebuilt stock kernel back, and it boots ok once again.
I've compared my boot.img with a stock boot.img (samfirmware sourced), and they are similar in terms of addresses and pagesizes. The ramfs file is also stock, taken from that same stock boot.img. The built kernel is a bit larger than the stock and I'm not sure if I should expect my built kernel to be exactly the same size, or if it's ok for it to be a few KBs different.
Any other parameters or configurations that I might be missing or should check? (And to samsungkid, were there any special steps that you took?)
Thank You!
Click to expand...
Click to collapse
have you checked command line?
Resolved by switching toolchains. OP query remains...
mr.harsh said:
have you checked command line?
Click to expand...
Click to collapse
No errors reported anywhere that I could find, but thanks for the response.
UPDATE: I resolved my original issue: toolchain was wrong. The readme from samsung tried to tell me, but I refused to listen... Once I changed to the Code Sourcery toolchain, the zImage loaded fine.
But back to samsungkid's issue....
I believe he is still trying to get his own custom module compiled into the kernel. I know that building a module separately as an LKM would work technically, but I don't know if that makes sense for the use case.
Regards
cleudde thetical
ric105 said:
No errors reported anywhere that I could find, but thanks for the response.
UPDATE: I resolved my original issue: toolchain was wrong. The readme from samsung tried to tell me, but I refused to listen... Once I changed to the Code Sourcery toolchain, the zImage loaded fine.
But back to samsungkid's issue....
I believe he is still trying to get his own custom module compiled into the kernel. I know that building a module separately as an LKM would work technically, but I don't know if that makes sense for the use case.
Regards
Click to expand...
Click to collapse
Yes, I would be glad if someone could help me with this...
still working on it
Thanks for every information you can give me !
Maybe I need to give you more details, so:
I downloaded the corresponding kernel for my samsung device.
Then I unpacked the file and opened the readme file, which states:
HOW TO BUILD KERNEL 2.6.35 FOR GT-S5300
1. How to Build
- get Toolchain
Visit http://www.codesourcery.com/, download and install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI.
Extract kernel source and move into the top directory.
$ cd common/
$ make bcm21553_cori_04_defconfig
$ make
2. Output files
- Kernel : kernel/common/arch/arm/boot/zImage
3. How to make .tar binary for downloading into target.
- change current directory to kernel/common/arch/arm/boot
- type following command
$ tar cvf GT-S5300_Kernel_Gingerbread.tar zImage
Click to expand...
Click to collapse
So I downloaded the appropriate toolchain and created my directories under /root/projects/android
[email protected]:~/projects/android# ls
infofiles kernel tarballs toolchain
Click to expand...
Click to collapse
In the directory infofiles are only the readme files from Samsung.
Kernel contains the extracted files from the archives, downloaded from Samsung.
tarballs contain all the tarballs meaning the kernel.tar.gz and the toolchain.tar.gz
toolchain contains the extracted files from toolchain
I then do all the thinks written in the readme file:
[email protected]:~/projects/android# cd kernel/common/
[email protected]:~/projects/android/kernel/common# make bcm21553_cori_04_defconfig
#
# configuration written to .config
#
Click to expand...
Click to collapse
and then I run into an error:
[email protected]:~/projects/android/kernel/common# make
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
CC kernel/bounds.s
arm-eabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
Click to expand...
Click to collapse
So could please, anybody help me with me issue?
Thank you !
no one ?
Have you EXPORTed variables to point to the compiler directory?
A guess, but is the error message saying it cannot find the cross compile toolchain? Generally, you need to either export a couple of variables, or add them to the make command line. Something like:
ARCH=arm SUBARCH=arm CROSS_COMPILE= /home/yourhome/toolchains/.../arm-none-eabi- make
Hope it helps.
ric105 said:
A guess, but is the error message saying it cannot find the cross compile toolchain? Generally, you need to either export a couple of variables, or add them to the make command line. Something like:
ARCH=arm SUBARCH=arm CROSS_COMPILE= /home/yourhome/toolchains/.../arm-none-eabi- make
Hope it helps.
Click to expand...
Click to collapse
Thanks.
I added the path to the toolchain directly into the $PATH variable...
Even tried your above statement - the same error again
Maybe need this...
You may need to edit the Makefile:
export KBUILD_BUILDHOST := $(SUBARCH)
ARCH ?=arm
#this is original ---> CROSS_COMPILE ?=/home/aniruddh/sgy/arm-eabi-4.4.3/bin/arm-eabi-
CROSS_COMPILE ?=/home/your_user_name_here/arm-2009q3/bin/arm-none-eabi-
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
Then you will run 'make' without export any variables.
Regards
tokomotxo said:
You may need to edit the Makefile:
export KBUILD_BUILDHOST := $(SUBARCH)
ARCH ?=arm
#this is original ---> CROSS_COMPILE ?=/home/aniruddh/sgy/arm-eabi-4.4.3/bin/arm-eabi-
CROSS_COMPILE ?=/home/your_user_name_here/arm-2009q3/bin/arm-none-eabi-
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
Then you will run 'make' without export any variables.
Regards
Click to expand...
Click to collapse
THAT, did the trick!
Thanks a lot for this awesome hint !
I own you
samsungkid said:
THAT, did the trick!
Thanks a lot for this awesome hint !
I own you
Click to expand...
Click to collapse
Thanks to you :good:
tokomotxo said:
Thanks to you :good:
Click to expand...
Click to collapse
Maybe you could answer me another question?
When I want to compile a normal .c program (like a Hello World Program) for my Samsung phone, how would I proceed?
Do I have to write a Makefile for this?
Thanks

[HELP] Compiling Android from source (sm-g360f)

Hi there,
I have Samsung Galaxy Core Prime LTE and I could not find any custom ROMs so I decided that I will try to compile it myself. I downloaded the LineageOS source code from git (cm 14.1), the device trees and kernel from here: github/MSM8916-Samsung, and the samsung vendor files from the extraxt-files.sh script. The qcom-common files from here: github/CyanogenMod/android_device_samsung_qcom-common. Then I set up the environment (source build/envsetup.sh), ran breakfast and everything went fine. And then came brunch... It's running for about 40-50 minutes, and then stopes because "ninja: build stopped: subcommand failed". Here's the output from my terminal: https:/ /drive.google.com/fi le/d/0Bzbi _UspTWqac3ZkV2RhRjJGeW8/view?usp=drivesdk (remove spaces - sorry for that, but I cannot add links yet)
If the ninja log is needed I will post it.
Can someone help me to understand the code and find out why it is failing?
(I am new to developing stuff, but I have already compiled programs back in the days, and I am familiar with Linux, which is my daily driver)
what version of linux are you using at the moment?
Ubuntu 17.04, but I have also tried it on 16.10 last week, and openjdk-8
wasowski02 said:
Ubuntu 17.04, but I have also tried it on 16.10 last week, and openjdk-8
Click to expand...
Click to collapse
I can't speak for others but I have not had success building anything android on 15.10,16.04,16.10... I always end up on a wild goose chase with all the compiling errors. I have consistently compiled without errors using 14.04 with oracle java 8 as that is what many of the manufacturers are using to make their own builds. If or oracle spits errors with 14.04 i try to use the rule of thumb and thats openjdk-6 and jre for LP, openjdk-7 and jre for MM and openjdk-8 for nougat builds but im only working on MM builds at the moment so your results may vary. Hope this helps a bit, just remember you can use sudo update-alternatives --display java to switch versions on the fly if needed and make sure you incorporate Google prebuilts as well. good luck ?
Sent from my LGLS676 using Tapatalk
Sands207 said:
I can't speak for others but I have not had success building anything android on 15.10,16.04,16.10... I always end up on a wild goose chase with all the compiling errors. I have consistently compiled without errors using 14.04 with oracle java 8 as that is what many of the manufacturers are using to make their own builds. If or oracle spits errors with 14.04 i try to use the rule of thumb and thats openjdk-6 and jre for LP, openjdk-7 and jre for MM and openjdk-8 for nougat builds but im only working on MM builds at the moment so your results may vary. Hope this helps a bit, just remember you can use sudo update-alternatives --display java to switch versions on the fly if needed and make sure you incorporate Google prebuilts as well. good luck ?
Click to expand...
Click to collapse
Then I will try 14.04 and see what happens. Thanks for help
@Sands207 Is there by any chance a site where you can learn to do this? Tutorial for noobs of sort.
Sent from my SM-N920P using Tapatalk
ninja_unmatched said:
@Sands207 Is there by any chance a site where you can learn to do this? Tutorial for noobs of sort.
Click to expand...
Click to collapse
Yes, luckily for us xda members we have our own Android college built right into xda https://forum.xda-developers.com/general/xda-university its a great starting point and rom compiling guide is also there. Its all aimed to help new folks find their way ? jump right in ?
If you need TWRP for it I have it. It was built by blaz3r64, but since AA51 is down I can upload it for you. I can confirm that it works on both the ST Galaxy Core Prime and the Boost Prevail LTE.
Sent from my XT1609 using Tapatalk
RealWelder said:
If you need TWRP for it I have it. It was built by blaz3r64, but since AA51 is down I can upload it for you. I can confirm that it works on both the ST Galaxy Core Prime and the Boost Prevail LTE.
Click to expand...
Click to collapse
So I have already downloaded the official TWRP, but thanks for your interest.
I have tried to compile using ubuntu 14.04 (with openjdk-8) as @Sands207, but I get this error:
Code:
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/bison/bison -d --defines=/home/karol/android/system/out/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_y.h -o /home/karol/android/system/out/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_y.cpp system/tools/aidl/aidl_language_y.yy"
/bin/bash: prebuilts/misc/linux-x86/bison/bison: No such file or directory
wasowski02 said:
So I have already downloaded the official TWRP, but thanks for your interest.
I have tried to compile using ubuntu 14.04 (with openjdk-8) as @Sands207, but I get this error:
Code:
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/bison/bison -d --defines=/home/karol/android/system/out/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_y.h -o /home/karol/android/system/out/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_y.cpp system/tools/aidl/aidl_language_y.yy"
/bin/bash: prebuilts/misc/linux-x86/bison/bison: No such file or directory
Click to expand...
Click to collapse
I recommend trying this keychain as it has full support for what you are attempting https://forum.xda-developers.com/showthread.php?t=3606941 I have tried it myself but Id recommend cleaning your build folder before incorporating them, maybe even a reboot as well. i had forgotten about this but it has far more tools than the normal keychain.
Sent from my LGLS676 using Tapatalk
---------- Post added at 04:29 PM ---------- Previous post was at 04:22 PM ----------
remember to select the right architecture ??
Sent from my LGLS676 using Tapatalk
Sands207 said:
I recommend trying this keychain as it has full support for what you are attempting https://forum.xda-developers.com/showthread.php?t=3606941 I have tried it myself but Id recommend cleaning your build folder before incorporating them, maybe even a reboot as well. i had forgotten about this but it has far more tools than the normal keychain.
Sent from my LGLS676 using Tapatalk
---------- Post added at 04:29 PM ---------- Previous post was at 04:22 PM ----------
remember to select the right architecture ?
Click to expand...
Click to collapse
So I downloaded the new toolchain/keychain/cross compiler (just to make sure - this is the same, yes?), but I cannot find how to choose it to compile android. The official post says:
Code:
# for arm64
export CROSS_COMPILE=$(pwd)/bin/aarch64-linux-gnu-
but as I'm not compiling the kernel I assume it is not what I need (I think) and
Code:
echo $CROSS_COMPILE
does not return anything by default. If I should have used the export function then which file should I choose, because there are many (-strip, -strings, -size, -run, etc.).
There is a directory called toolchain (it contains only binutils) in the folder containing the source code. Should I add a folder called gcc and put the files there? Or maybe I have to run brunch with some options or change an entry in a configuration/make file?
I use the aarch64 version, but not the newest (20170515 not 20170520).
wasowski02 said:
So I downloaded the new toolchain/keychain/cross compiler (just to make sure - this is the same, yes?), but I cannot find how to choose it to compile android. The official post says:
but as I'm not compiling the kernel I assume it is not what I need (I think) and
does not return anything by default. If I should have used the export function then which file should I choose, because there are many (-strip, -strings, -size, -run, etc.).
There is a directory called toolchain (it contains only binutils) in the folder containing the source code. Should I add a folder called gcc and put the files there? Or maybe I have to run brunch with some options or change an entry in a configuration/make file?
I use the aarch64 version, but not the newest (20170515 not 20170520).
Click to expand...
Click to collapse
I do think as you said you will need to run brunch but resetting up your build & source environment to use the new keychain as you attempted to switch from one keychain to the other as well may help if this doesn't work as well take a look at your build configuration. rc file and make sure you don't have double entries or the new keychain missing i usually import the prebuilts i need as I am using arm architecture at the moment but i either download the individual keychain i need and place it in my source folder when i setup my build environment to be added to the build along with my sources before i run lunch because my source folder is untouched by me besides that at that point. I'll be home in an hour or so I'm going to see if i can track down some info to help you get untangled but i do recommend downloading the folder and making a gcc folder with the toolchain folder for arm64 as you said and and adding it to your build ensuring it is clean besides what you need and adding it then attempt to compile again.
I'm​ not sure if I should use aarch64. I have an armv7-a-neon (so 64-bit) and the internet says that aarch64 and arm64 is pretty much the same, but maybe I am wrong and I should use arm instead. But I think that does not matter until I put the new toolchain both to the aarch64 and arm directory (I guess the compilation process will choose the right one automatically). So I've put the compilers into prebuilts/gcc/linux-x86/... folders, but should I delete the old compilers? And then run the environment setup again (all this stuff starts to make sense to me ?)
Sent from my SM-G360F using Tapatalk
wasowski02 said:
I'm​ not sure if I should use aarch64. I have an armv7-a-neon (so 64-bit) and the internet says that aarch64 and arm64 is pretty much the same, but maybe I am wrong and I should use arm instead. But I think that does not matter until I put the new toolchain both to the aarch64 and arm directory (I guess the compilation process will choose the right one automatically). So I've put the compilers into prebuilts/gcc/linux-x86/... folders, but should I delete the old compilers? And then run the environment setup again (all this stuff starts to make sense to me )
Sent from my SM-G360F using Tapatalk
Click to expand...
Click to collapse
Yes you should delete the old ones and set up your enviroment again and it should include them. Also yes the compile proccess should pick the correct one in your case as long as you include them and you have, you are heading in the right direction for sure. :good:
Sands207 said:
Yes you should delete the old ones and set up your enviroment again and it should include them. Also yes the compile proccess should pick the correct one in your case as long as you include them and you have, you are heading in the right direction for sure. :good:
Click to expand...
Click to collapse
So I deleted the old ones and I get this error:
Code:
ninja: error: 'prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-strip', needed by '/home/karol/android/system/out/target/product/coreprimeltexx/obj/lib/libdl.so', missing and no known rule to make it
I guess it's because somewhere in a configuration file there is an entry for the old compiler. I have deleted the out directory and played with the envsetup.sh file (about line 210 there is something about compilers),
Code:
# defined in core/config.mk
targetgccversion=
targetgccversion2=
export TARGET_GCC_VERSION=$targetgccversion
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_TOOLCHAIN=
export ANDROID_TOOLCHAIN_2ND_ARCH=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/x86_64-linux-android-$targetgccversion/bin
;;
x86_64) toolchaindir=x86/x86_64-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/arm-linux-androideabi-$targetgccversion/bin
;;
arm64) toolchaindir=aarch64/aarch64-linux-android-$targetgccversion/bin;
toolchaindir2=arm/arm-linux-androideabi-$targetgccversion2/bin
;;
mips|mips64) toolchaindir=mips/mips64el-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
but this did not work either. The ninja files don't contain any gcc configuration. So where can I find the right configuration file? (I can't find the suggested configuration.rc file)
wasowski02 said:
So I deleted the old ones and I get this error:
I guess it's because somewhere in a configuration file there is an entry for the old compiler. I have deleted the out directory and played with the envsetup.sh file (about line 210 there is something about compilers),
but this did not work either. The ninja files don't contain any gcc configuration. So where can I find the right configuration file?
Click to expand...
Click to collapse
I usually compile using clang or maven as I only build AOSP atm https://ninja-build.org/manual.html this page includes directions that should assist you. Do you have maven or clang installed on your linux box?
Sands207 said:
I usually compile using clang or maven as I only build AOSP atm https://ninja-build.org/manual.html this page includes directions that should assist you. Do you have maven or clang installed on your linux box?
Click to expand...
Click to collapse
So it seems that nor klang nor maven is installed on my machine (but as my computer claims ninja is not installed either I guess that they may be installed somewhere in the build directories). Should I try them instead of ninja?
wasowski02 said:
So it seems that nor klang nor maven is installed on my machine (but as my computer claims ninja is not installed either I guess that they may be installed somewhere in the build directories). Should I try them instead of ninja?
Click to expand...
Click to collapse
yes absolutely
Sands207 said:
yes absolutely
Click to expand...
Click to collapse
So what I understand is:
(1) Install maven or clang (let's say clang because I found it in the official ubuntu repository)
(2) Configure brunch to use clang instead of ninja
So I checked the internet if there are any options I can use with brunch to run clang, but I didn't find any. Also looked through the envsetup.sh file, but there is nothing there, or I missed it.
wasowski02 said:
So what I understand is:
(1) Install maven or clang (let's say clang because I found it in the official ubuntu repository)
(2) Configure brunch to use clang instead of ninja
So I checked the internet if there are any options I can use with brunch to run clang, but I didn't find any. Also looked through the envsetup.sh file, but there is nothing there, or I missed it.
Click to expand...
Click to collapse
tonight i will try doing some digging to see if i can help you. im away from my computer right now but ill do what i can. i would try would maven. clang assists with aosp primarily but maven should work for you as far as using a custom command to run maven, log out or reboot after you install it and run brunch as you normally would also please read this https://clang.llvm.org/comparison.html

Compiling Lineage 15.1

Does anybody know current stage Lineage 15.1 for x2? Is it usable after compiling as is, or some fixes are still needed to get it bootable and usable?
There is already a LOS 15.1 thread and please delete this thread from here.
giaur said:
Does anybody know current stage Lineage 15.1 for x2? Is it usable after compiling as is, or some fixes are still needed to get it bootable and usable?
Click to expand...
Click to collapse
Heyyo, it was bootable yes but right meow I'm currently having issues and attempting to synchronize from scratch again. Not sure if I changed something or if a repo sync is causing issues.
Currently moto999999 and I are the only people trying to fix bugs on the x2 for lineage-15.1... So any extra help is appreciated.
---------- Post added at 06:15 PM ---------- Previous post was at 06:13 PM ----------
[email protected] said:
There is already a LOS 15.1 thread and please delete this thread from here.
Click to expand...
Click to collapse
If you're taking about the LineageOS 15.1 blue thread I don't think luchetto was using official lineage-15.1 sources so his build would never be official. It's just a build he was working on.
The official lineage-15.1 is currently only being worked on by moto999999 and I... Hence me saying if anyone wanted to help fix bugs with us the assistance would be appreciated.
I haven't bothered making a thread about it since there's still a bit of work to be done.
Or if you're taking about the Lineage-15.0 thread by andr68rus? It has been long since discontinued and he no longer develops for the Le Max 2 as he now owns a Xiaomi Mi Mix 2 (and a smexy device it is).
---------- Post added at 06:22 PM ---------- Previous post was at 06:15 PM ----------
@giaur I forgot to mention but here is my local manifest and my build scripts if you wish to help or if anyone else wants to help.
https://github.com/lineage-o-x2/local_manifests
For now I am unable to compile Lineage 15.1 sources. Do you have any working build?
giaur said:
For now I am unable to compile Lineage 15.1 sources. Do you have any working build?
Click to expand...
Click to collapse
Heyyo, sorry for late reply. Please check the github link in my previous post.
Do you have telegram? We use that for LeEco devs to communicate
ThE_MarD said:
Heyyo, sorry for late reply. Please check the github link in my previous post.
Do you have telegram? We use that for LeEco devs to communicate
Click to expand...
Click to collapse
Thanks for info. I'm planning to launch daily builds, as soon as I manage to compile sources. I will try your manifest tomorrow, mine contains TheMuppets only. I own already set server +script to automatically upload builds to mega.nz.
I don't have Telegram, but I can create account
Almost there... something happened with Jack, but I'm not sure what exactly - the same config was working to compile Nougat:
Code:
[ 83% 81888/98073] Building with Jack: /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack
FAILED: /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack
/bin/bash -c "(rm -f /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack ) && (rm -rf /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc ) && (mkdir -p /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/ ) && (mkdir -p /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc ) && (rm -f /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) && (touch /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) && (if [ -d \"/home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src\" ]; then find /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/src -name '*.java' >> /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list; fi ) && (tr ' ' '\\n' < /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list | build/tools/normalize_path.py | sort -u > /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq ) && (if [ -s /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq ] ; then export tmpEcjArg=\"@/home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq\"; else export tmpEcjArg=\"\"; fi; JACK_VERSION=4.32.CANDIDATE /home/michal/lineage15/out/host/linux-x86/bin/jack @build/core/jack-default.args -g -D jack.java.source.version=1.7 --classpath /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/sdk_v21_intermediates/classes.jack -D jack.import.resource.policy=keep-first -D jack.import.type.policy=keep-first -D jack.android.min-api-level=21 --output-jack /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack \$tmpEcjArg || ( rm -f /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/classes.jack ; exit 41 ) ) && (rm -f /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list ) && (mv /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc/java-source-list-uniq /home/michal/lineage15/out/target/common/obj/JAVA_LIBRARIES/org.apache.http.legacy_intermediates/jack-rsc.java-source-list )"
Connection to the Jack server timeout, retrying with debug
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8076 (#0)
ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /root/.jack-server/server.pem
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
} [5 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
* Operation timed out after 150000 milliseconds with 0 out of 0 bytes received
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
Machine has only 8 GB RAM, so I was forced to increase Jack cheap memory, like this:
Code:
JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
This was enough to compile Nougat, maybe I will should try with larger value.
why r u opening seperate thread for asking it @giaur
shivatejapeddi said:
why r u opening seperate thread for asking it @giaur
Click to expand...
Click to collapse
Beceause there is no existing one? This thread is about issues with Lineage 15.1 compilation.
@ThE_MarD your manifest giving me error message:
Code:
fatal: duplicate path device/leeco/x2 in /home/michal/lineage15/.repo/manifest.xml
With my previous manifest I had TheMuppets only included, build won't boot at all. Now I'm trying with your manifest, we'll see.
@ThE_MarD your manifest giving me error message:
Code:
fatal: duplicate path device/leeco/x2 in /home/michal/lineage15/.repo/manifest.xml
With my previous manifest I had TheMuppets only included, build won't boot at all. Now I'm trying with your manifest, we'll see.
giaur said:
@ThE_MarD your manifest giving me error message:
With my previous manifest I had TheMuppets only included, build won't boot at all. Now I'm trying with your manifest, we'll see.
Click to expand...
Click to collapse
Hmm that's not my manifest amigo. I don't have a manifest.xml. I'd recommend reviewing that XML file or deleting it if there's nothing in there you need.
my manifest is local_manifest.xml
ThE_MarD said:
Hmm that's not my manifest amigo. I don't have a manifest.xml. I'd recommend reviewing that XML file or deleting it if there's nothing in there you need.
my manifest is local_manifest.xml
Click to expand...
Click to collapse
Of course, I mean "local_manifest", after applying it I got that error message. Anyway, compilation has been succeded, if anybody wish to try:
https://mega.nz/#!LV1HVBDC!q---2tIplvLJUFbVv4VKr-V_JHVpiJrXPykR-AwXKUU
Md5:
https://mega.nz/#!yUFnmDzL!OrNT-rpaLFagY3BJwZ_vyTKQcBcjs5kr39mMnYUpeCY
I hope no bootloop this time.
giaur said:
Of course, I mean "local_manifest", after applying it I got that error message. Anyway, compilation has been succeded, if anybody wish to try:
https://mega.nz/#!LV1HVBDC!q---2tIplvLJUFbVv4VKr-V_JHVpiJrXPykR-AwXKUU
Md5:
https://mega.nz/#!yUFnmDzL!OrNT-rpaLFagY3BJwZ_vyTKQcBcjs5kr39mMnYUpeCY
I hope no bootloop this time.
Click to expand...
Click to collapse
Downloaded, will test and report back.
---------- Post added at 10:16 AM ---------- Previous post was at 09:56 AM ----------
giaur said:
Of course, I mean "local_manifest", after applying it I got that error message. Anyway, compilation has been succeded, if anybody wish to try:
https://mega.nz/#!LV1HVBDC!q---2tIplvLJUFbVv4VKr-V_JHVpiJrXPykR-AwXKUU
Md5:
https://mega.nz/#!yUFnmDzL!OrNT-rpaLFagY3BJwZ_vyTKQcBcjs5kr39mMnYUpeCY
I hope no bootloop this time.
Click to expand...
Click to collapse
Well, No error in installation, but not boot.
With GAPPS they enter on boot animation but still there forever, without they not pass the boot logo.
Beackman said:
Downloaded, will test and report back.
---------- Post added at 10:16 AM ---------- Previous post was at 09:56 AM ----------
Well, No error in installation, but not boot.
With GAPPS they enter on boot animation but still there forever, without they not pass the boot logo.
Click to expand...
Click to collapse
Yes, I can confirm. I'm going to make new, fresh build. Probably Lineage bug, already fixed: https://github.com/LineageOS/android_device_leeco_x2/commit/fd453e976c4f9ff828bf83310c2bab6563491f96 we'll see.
ThE_MarD said:
Heyyo, it was bootable yes but right meow I'm currently having issues and attempting to synchronize from scratch again. Not sure if I changed something or if a repo sync is causing issues.
Currently moto999999 and I are the only people trying to fix bugs on the x2 for lineage-15.1... So any extra help is appreciated.
---------- Post added at 06:15 PM ---------- Previous post was at 06:13 PM ----------
If you're taking about the LineageOS 15.1 blue thread I don't think luchetto was using official lineage-15.1 sources so his build would never be official. It's just a build he was working on.
The official lineage-15.1 is currently only being worked on by moto999999 and I... Hence me saying if anyone wanted to help fix bugs with us the assistance would be appreciated.
I haven't bothered making a thread about it since there's still a bit of work to be done.
Or if you're taking about the Lineage-15.0 thread by andr68rus? It has been long since discontinued and he no longer develops for the Le Max 2 as he now owns a Xiaomi Mi Mix 2 (and a smexy device it is).
---------- Post added at 06:22 PM ---------- Previous post was at 06:15 PM ----------
@giaur I forgot to mention but here is my local manifest and my build scripts if you wish to help or if anyone else wants to help.
https://github.com/lineage-o-x2/local_manifests
Click to expand...
Click to collapse
Thank you. I have LineageOS 15.1 sources already downloaded. I will sync x2 sources and try to help
Awesome! Glad to hear more people are jumping on board to help
If you have Telegram then please pm me I we have a developer chat group which is a little faster than these forums
New build up: https://mega.nz/#!fc9BmBQa!1u-Jv4nrLzAyCgPb8NcsGhz2tQ1gMtvvgjXRW31YIho
I'm confused. I'm pretty sure it booted, but after flashing it again only blue led and black screen. Or I just flashed different zip first time (so it booted). I am able to clean install rom I was before though. Totally confused. I've tried then 2 times to clean flash my build, not booting. Strange.
You can test and tell me if it works for you.
giaur said:
New build up: https://mega.nz/#!fc9BmBQa!1u-Jv4nrLzAyCgPb8NcsGhz2tQ1gMtvvgjXRW31YIho
I'm confused. I'm pretty sure it booted, but after flashing it again only blue led and black screen. Or I just flashed different zip first time (so it booted). I am able to clean install rom I was before though. Totally confused. I've tried then 2 times to clean flash my build, not booting. Strange.
You can test and tell me if it works for you.
Click to expand...
Click to collapse
Booted fine, now is OK.
Beackman said:
Booted fine, now is OK.
Click to expand...
Click to collapse
Strange

Building Samsung Open-Source Kernel and disable DEFEX

I'm going to show you how to build a custom kernel, and a custom boot.img.
Requirements
A linux OS
Kernel source code from Samsung
Android Image Kitchen (Required for the SEANDROID metadata it appends automatically)
GCC Cross Compilation Toolchain 4.8 (You may just clone the repo with git, or download a zip)
Hypothetical workspace directory on the filesystem: /workspace, now prepare it like this:
/workspace/kernel - this is where the kernel source code will be, this is what we will build. Extract the downloaded Kernel.tar.gz here
/workspace/build - this is the kernel compilation result, populated by the build
/workspace/toolchain - this is the required cross-compilation toolchain you download or check-out from the google link
/workspace/kitchen - Extract Android Image Kitchen here
Click to expand...
Click to collapse
Go to http://opensource.samsung.com/reception.do and search for SM-J415, download one of the results, extract Kernel.tar.gz to /workspace/kernel. I believe SWA stands for South West Asia, and MAE - Middle-east Africa, it doesn't matter which you pick, it is related to radio regulations.
Now overwrite the file /workspace/kernel/build_kernel.sh with:
Code:
#!/bin/bash
# The cross compilation toolchain path
export TOOLCHAIN=$(pwd)/../toolchain/arm-linux-androideabi-4.8
# This is the directory for the compiled kernel
export OUTDIR="O=$(pwd)/../build"
export PATH=$TOOLCHAIN/bin:$PATH
export ARCH=arm
export CROSS_COMPILE=arm-linux-androideabi-
export THREADS=$(nproc --all)
export COMMON_ARGS="-j$THREADS $OUTDIR arch=arm CFLAGS_MODULE=-fno-pic arch=arm"
if [ "$1" == "build" ]; then
make $COMMON_ARGS j4primelte_sea_open_defconfig
make $COMMON_ARGS
elif [ "$1" == "rebuild" ]; then
make $COMMON_ARGS
elif [ "$1" == "clean" ]; then
make $COMMON_ARGS distclean
make $COMMON_ARGS clean
else
echo "./build_kernel.sh build|rebuild|clean"
fi
Building kernel source code
Run the script:
$ cd /workspace/kernel/
edit: /workspace/kernel/arch/arm/configs/j4primelte_sea_open_defconfig
change CONFIG_SECURITY_DEFEX=y to CONFIG_SECURITY_DEFEX=n
$ bash build_kernel.sh build
It should build normally, if it fails there's something wrong with your OS setup. After a long time, you should see the compiled and compressed kernel with the DTP appended at:
/workspace/target/arch/arm/boot/zImage-dtb
The kernel configuration it created from the defconfig files in the kernel source tree is at
/workspace/target/.config
Build a new boot.img
$ cd /workspace/kitchen
$ bash unpackimg.sh /path/to/a/boot/or/recovery.img
Now you will have the unpacked kernel in: /workspace/kitchen/split_img/boot.img-zImage
Delete it
$ rm split_img/boot.img-zImage
Link the built custom kernel there instead
$ ln -s /workspace/target/arch/arm/boot/zImage-dtb /workspace/kitchen/split_img/boot.img-zImage
Now each time you create the boot.img, it will include your custom kernel instead.
Tweak the files and ramdisk as much as you want, and repackage the boot.img
$ bash repackimg.sh
Now you have a boot.img at /workspace/kitchen/image-new.img that is ready to flash to the device. You can unpack custom recoveries the same way as you unpacked boot.img to make them use your custom kernel.
Kernel configurations tried
CONFIG_SECURITY=n - boot loop
CONFIG_SECURITY_SELINUX=n - boot loop
CONFIG_SECURITY_DEFEX=n - works
CONFIG_DM_VERITY=n - works, does not prevent initramfs from using DM-VERITY, you still need some sort of ramdisk hack to disable verification of the next boot phase after initrd.
Often when editing the defconfig files, the same variables are declared in many different files so you might be better off using "sed' to change the variables, example:
$ grep -lr "CONFIG_SECURITY=y" | while read line; do sed -i 's/CONFIG_SECURITY=y/CONFIG_SECURITY=n/g' $line; done
When running "build_kernel.sh build", it will print "configuration written to .config" so verify that the variable was actually changed in the final config /workspace/build/.config
kapmino269 said:
and I think ,They aren't kernel see
Click to expand...
Click to collapse
No that is the latest kernel source code running on the latest firmware. You can use either of those 2 downloads from opensource.samsung.com
kapmino269 said:
it isn't working .
Click to expand...
Click to collapse
The kernel source code is on the Samsung opensource website.... there are two versions one that is MEA ( for Middle East and Africa roms) and the other one for SWA. It works if compiled properly
kapmino269 said:
ok
i have questions loop device depend on kernel and if it is .
How to add support?
Click to expand...
Click to collapse
It seems it depends on the kernel support but I haven't actually tried messing around that stuff
kapmino269 said:
it isn't working .
Click to expand...
Click to collapse
You need to install gcc, python and make before you run the command bash build_kernel.sh build
sudo apt install gcc make python
kapmino269 said:
I knew steps man I used Ubuntu for 2 years without windows .
thank you .
Click to expand...
Click to collapse
Do you tried make mrproper and make clean before you run build_kernel.sh?
kapmino269 said:
ok
i have questions loop device depend on kernel and if it is .
How to add support?
Click to expand...
Click to collapse
Type "make xconfig" in the kernel directory, and a window will open for configuring the .config file in that same directory.
Search for "Loopback device support" and add a checkmark (not a dot, so that the module is built into the kernel.)
kapmino269 said:
it isn't working .
Click to expand...
Click to collapse
Can you please provide a log or something? It sounds like you are missing dependencies in your operating system for building kernels.
how do you flash the new boot.img with a samsung device?
kapmino269 said:
By twrp
Click to expand...
Click to collapse
Thanks!!
I ended up using https://forum.xda-developers.com/showthread.php?t=2446269 which is pretty easy as well.
I am now stuck on how to enable wifi after flashing a different kernal.
Kernal = samsung opensource
Rom = nouget 7.1.1 (different to opensource kernal)
Any suggestions?
heavy load said:
Thanks!!
I ended up using https://forum.xda-developers.com/showthread.php?t=2446269 which is pretty easy as well.
I am now stuck on how to enable wifi after flashing a different kernal.
Kernal = samsung opensource
Rom = nouget 7.1.1 (different to opensource kernal)
Any suggestions?
Click to expand...
Click to collapse
Install the Magisk module LIBSECURE_STORAGE COMPANION
ashyx said:
Install the Magisk module LIBSECURE_STORAGE COMPANION
Click to expand...
Click to collapse
Thanks Ashyx, I had a play with your kernal on github, nice work there!
I ended up downloading a stock rom matching the samsung opensource kernal build number, worked out of the box.
kapmino269 said:
See that :
@ashyx any help
I NEED TO ADD SOME MODULES.
Click to expand...
Click to collapse
It's telling you the path to the defconfig doesn't exist.
Either the name is wrong or it doesn't exist in the config directory.
kapmino269 said:
This, I solved it yesterday, Thanks .
But I have 2 problems :
1- Device is arm and at bulid_kernel.sh tell me to use toolchain arch64 ,
Which I should Use arm or arm64 ,
I confused as cpu is arm64 .
https://www.qualcomm.com/products/snapdragon/processors/425
Or
Ndk
https://developer.android.com/ndk/downloads/index.html
2- Which command I should write after menuconfig
./build_kernel.sh
Or
make -jX .
Click to expand...
Click to collapse
Just use whichever is in the build script.
You will need to add menuconfig to build_kernel.sh before make or your changes will be lost.
Then run build_kernel.sh
kapmino269 said:
@ashyx ,all is ok .
The error from clang and there is 2 config files .
Fixed and I will test kernel but I have problem when compiling I choose lz4 type ,do U see I should choose another .
Also where is zimage now ,i compiled manually not with build_kernel.sh .
Click to expand...
Click to collapse
You don't need the export arguments which are contradictory anyway, as you have already defined your toolchain and architecture before hand.
Also the boot image does not need to be lz4. The compiler will tell you where the finished zImage is when completed. You should find it in the boot directory of the arm64 directory if you are not using OUT_DIR statements.
kapmino269 said:
Sorry ashyx this is last thing ,
-You told me later that device is arm not arm64 .
In Your twrp thread .
-Also defconfig of device in /arch/arm .
-Arch=arm in build_kernel.sh .
-Gsi system armaonly only work on the device .
-All apps told that device is arm .
I confused ,
Please tell that it is right to use arm64 tool chain .
Or How did U build it ?
By arm64 toolchain or arm toolchain ?
Very Thank U .
Click to expand...
Click to collapse
I was just going by the screen shot you posted. Like I said your commands are contradictory.
You have both arm and arm64 toolchains defined in the same script.
You also have an export statement for arm64 directly under a statement for an arm toolchain.
Not sure why you added both?
As far as I can see the architecture you're compiling for is arm, so you need an arm toolchain.
kapmino269 said:
It contains errors
Click to expand...
Click to collapse
This is the script I use.
You will need to modify the path to your toolchain.
can i use the source code to build kernel for android 10 one ui if the source built for mm

Question Propietary blobs/files for Odin

Hey, does anyone know how to get the propietary blobs out of the device? I'm kinda done with MIUI and i wanna try to compile some custom rom and maybe a legit twrp.
SanHelios said:
Hey, does anyone know how to get the propietary blobs out of the device? I'm kinda done with MIUI and i wanna try to compile some custom rom and maybe a legit twrp.
Click to expand...
Click to collapse
lol i am looking for the same
check this out
vamsi209 said:
lol i am looking for the same
check this out
Click to expand...
Click to collapse
what shall i check out?
SanHelios said:
what shall i check out?
Click to expand...
Click to collapse
Extracting proprietary blobs from LineageOS zip files | LineageOS Wiki
wiki.lineageos.org
SanHelios said:
Hey, does anyone know how to get the propietary blobs out of the device? I'm kinda done with MIUI and i wanna try to compile some custom rom and maybe a legit twrp.
Click to expand...
Click to collapse
Trying to look for the Chinese tool to flash the unofficial TWRP, once I manage to do that will try help on grabbing those needed proprietary blobs. May need guide on how to pull the blobs, am still a noob
dan079 said:
Trying to look for the Chinese tool to flash the unofficial TWRP, once I manage to do that will try help on grabbing those needed proprietary blobs. May need guide on how to pull the blobs, am still a noob
Click to expand...
Click to collapse
Me too... TWRP is tricky, since it can only be done by this OneInject-function of TWRP, but it's possible. I tried the 'current' unofficial release of TWRP for this, but all i got was a reboot to BL.
vamsi209 said:
Extracting proprietary blobs from LineageOS zip files | LineageOS Wiki
wiki.lineageos.org
Click to expand...
Click to collapse
yshalsager, who created the Firmware-script, told me the same.. here is his answer.
"
Hi,
Thanks for your words, glad to hear my work helps.
You can use LineageOS extract files script that will generate vendor tree for you. It is available in any device tree but you should use one of your device so it reads from its proprietary-files.txt or something.
"
Maybe LOS is closer than we think.
SanHelios said:
yshalsager, who created the Firmware-script, told me the same.. here is his answer.
"
Hi,
Thanks for your words, glad to hear my work helps.
You can use LineageOS extract files script that will generate vendor tree for you. It is available in any device tree but you should use one of your device so it reads from its proprietary-files.txt or something.
"
Maybe LOS is closer than we think.
Click to expand...
Click to collapse
niceee, so for mix 4, i extracted the twrp trees using this,
[SCRIPT] TWRP device tree generator
Create a TWRP-compatible device tree only from an Android recovery image (or a boot image if the device uses non-dynamic partitions A/B) of your device's stock ROM. It has been confirmed that this script supports images built starting from...
forum.xda-developers.com
setup the local repo for building twrp trees, using these
1. Installing the tools
A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image - twrpdtgen/twrpdtgen
github-wiki-see.page
tried building but the device doesn't lunch after following the steps shown above,
Code:
http://www.hastebin.com/jonexiyowu.md
and one of the dev https://github.com/imjyotiraditya , helped me build an aospa rom for g8x,
now he is on to building twrp for our device odin.
if anyone has twrp trees, we can try geting aospa build ready for our device
vamsi209 said:
niceee, so for mix 4, i extracted the twrp trees using this,
[SCRIPT] TWRP device tree generator
Create a TWRP-compatible device tree only from an Android recovery image (or a boot image if the device uses non-dynamic partitions A/B) of your device's stock ROM. It has been confirmed that this script supports images built starting from...
forum.xda-developers.com
setup the local repo for building twrp trees, using these
1. Installing the tools
A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image - twrpdtgen/twrpdtgen
github-wiki-see.page
tried building but the device doesn't lunch after following the steps shown above,
Code:
http://www.hastebin.com/jonexiyowu.md
and one of the dev https://github.com/imjyotiraditya , helped me build an aospa rom for g8x,
now he is on to building twrp for our device odin.
if anyone has twrp trees, we can try geting aospa build ready for our device
Click to expand...
Click to collapse
hey, i'm trying it right now... was able to manage a device tree from the latest weekly of the EU-rom. Repo is syncing right now for the aosp-twrp-11 repository.
U used the same script for the recovery trees?
vamsi209 said:
U used the same script for the recovery trees?
Click to expand...
Click to collapse
yes, i extracted it from the boot.img.
Update... build/envsetup.sh error, anyone any suggestions?
Update managed to get envsetup.sh to work, got following error messages
source build/envsetup.sh
including device/xiaomi/odin/vendorsetup.sh
COMMON_LUNCH_CHOICES: Befehl nicht gefunden.
COMMON_LUNCH_CHOICES: Befehl nicht gefunden.
lunch twrp_odin-eng
In file included from build/make/core/config.mk:291:
In file included from build/make/core/envsetup.mk:266:
build/make/core/product_config.mk:155: error: Can not locate config makefile for product "twrp_odin".
23:22:04 dumpvars failed with: exit status 1
WARNING: Trying to fetch a device that's already there
Traceback (most recent call last):
File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 431, in <module>
fetch_device(device)
File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 399, in fetch_device
git_data = search_gerrit_for_device(device)
File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 86, in search_gerrit_for_device
device_data = check_repo_exists(git_data, device)
File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 62, in check_repo_exists
raise Exception("{device} not found,"
Exception: odin not found,exiting roomservice
In file included from build/make/core/config.mk:291:
In file included from build/make/core/envsetup.mk:266:
build/make/core/product_config.mk:155: error: Can not locate config makefile for product "twrp_odin".
23:22:05 dumpvars failed with: exit status 1
** Don't have a product spec for: 'twrp_odin'
** Do you have the right repo manifest?
Anyone a good guess?
Did you had any luck, or any chance I can help?
Puksom said:
Did you had any luck, or any chance I can help?
Click to expand...
Click to collapse
well, i made some progress, but i failed again. I posted a thread in the official twrp forum. Maybe you might want to take a look at it.. thx.
Post in thread '[DEV]How to compile TWRP touch recovery' https://forum.xda-developers.com/t/dev-how-to-compile-twrp-touch-recovery.1943625/post-85686505
Puksom said:
Did you had any luck, or any chance I can help?
Click to expand...
Click to collapse
I'm a total beginner, so i might be wrong. But as far as i can tell, the makefiles of the extracted device tree need to be update or even completely rebuild.
Hi, it seems like I was able to execute the script successfully.
It didn't work on Windows because it got stuck on the execution of unpackimg.bat.
I ran it on Linux and it worked (after chmod 777 of boot.img). This is the command I ran:
python3 -m twrpdtgen -o ./odin ./boot.img
output:
Code:
TWRP device tree generator
Version 1.3.0
[INFO] Cloning AIK...
Done! You can find the device tree in odin/xiaomi/odin
I took boot.img from the latest MIUI 12.5.7.0 China Stable
Now I have what it seems to be the device tree (odin.zip) but I don't know what to do it it or what it is.
radoinc said:
Hi, it seems like I was able to execute the script successfully.
It didn't work on Windows because it got stuck on the execution of unpackimg.bat.
I ran it on Linux and it worked (after chmod 777 of boot.img). This is the command I ran:
python3 -m twrpdtgen -o ./odin ./boot.img
output:
Code:
TWRP device tree generator
Version 1.3.0
[INFO] Cloning AIK...
Done! You can find the device tree in odin/xiaomi/odin
I took boot.img from the latest MIUI 12.5.7.0 China Stable
Now I have what it seems to be the device tree (odin.zip) but I don't know what to do it it or what it is.
Click to expand...
Click to collapse
This is great, so we know this script works and does what it is supposed to do...
I checked the makefiles to see if there are any differences, but there are none. So it suggests that it doesn't matter, from which version you get the files from. I love, that the users of the Mi Mix 4 are more open so compiling than the community of the MI 11 Ultra is..
SanHelios said:
This is great, so we know this script works and does what it is supposed to do...
I checked the makefiles to see if there are any differences, but there are none. So it suggests that it doesn't matter, from which version you get the files from. I love, that the users of the Mi Mix 4 are more open so compiling than the community of the MI 11 Ultra is..
Click to expand...
Click to collapse
I'm trying to replicate your steps but I get the same "Can not locate config makefile for product "twrp_odin"." as you did above. In the other topic I see you managed to get past that step.
I see you get some output after executing envsetup.sh and it seems like this is related to the device tree.
Can you please share what you did with the device tree before attempting to compile twrp? I'd like to try myself but I can't find clear instructions.
radoinc said:
I'm trying to replicate your steps but I get the same "Can not locate config makefile for product "twrp_odin"." as you did above. In the other topic I see you managed to get past that step.
I see you get some output after executing envsetup.sh and it seems like this is related to the device tree.
Can you please share what you did with the device tree before attempting to compile twrp? I'd like to try myself but I can't find clear instructions.
Click to expand...
Click to collapse
Acutally i left it completely unchanged, the only thing i did was to change the repository. I deleted the aosp-repository and took the omni-twrp-repository
(https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni)
mkdir twrp
cd twrp
repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0
repo sync
after syncing was complete, i followed these instructions
4. Build TWRP from source
A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image - twrpdtgen/twrpdtgen
github-wiki-see.page
SanHelios said:
Acutally i left it completely unchanged, the only thing i did was to change the repository. I deleted the aosp-repository and took the omni-twrp-repository
(https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni)
mkdir twrp
cd twrp
repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0
repo sync
after syncing was complete, i followed these instructions
4. Build TWRP from source
A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image - twrpdtgen/twrpdtgen
github-wiki-see.page
Click to expand...
Click to collapse
Thanks! Now I managed to get the same result as you. The error seems to be raised by mkbootimg.py:
Python:
def write_header(args):
BOOT_IMAGE_HEADER_V1_SIZE = 1648
BOOT_IMAGE_HEADER_V2_SIZE = 1660
BOOT_MAGIC = 'ANDROID!'.encode()
if (args.header_version > 2):
raise ValueError('Boot header version %d not supported' % args.header_version)
To me it seems like this Omni repo includes old version of mkbootimg.py, because in the google repos I can see that the current version of this function looks like this:
Python:
def write_header(args):
if args.header_version > 4:
raise ValueError(
f'Boot header version {args.header_version} not supported')
if args.header_version in {3, 4}:
return write_header_v3_and_above(args)
It seems like Boot header version 3 was introduced with Android 11: https://source.android.com/devices/bootloader/boot-image-header
I think we can't do much with the Omnia repos until they get updated with current mkbootimg.
radoinc said:
Thanks! Now I managed to get the same result as you. The error seems to be raised by mkbootimg.py:
Python:
def write_header(args):
BOOT_IMAGE_HEADER_V1_SIZE = 1648
BOOT_IMAGE_HEADER_V2_SIZE = 1660
BOOT_MAGIC = 'ANDROID!'.encode()
if (args.header_version > 2):
raise ValueError('Boot header version %d not supported' % args.header_version)
To me it seems like this Omni repo includes old version of mkbootimg.py, because in the google repos I can see that the current version of this function looks like this:
Python:
def write_header(args):
if args.header_version > 4:
raise ValueError(
f'Boot header version {args.header_version} not supported')
if args.header_version in {3, 4}:
return write_header_v3_and_above(args)
It seems like Boot header version 3 was introduced with Android 11: https://source.android.com/devices/bootloader/boot-image-header
I think we can't do much with the Omnia repos until they get updated with current mkbootimg.
Click to expand...
Click to collapse
My question is, do the makefiles from the devicetree need to be adjusted or completely rebuild to android 11 parameters? I.e. rhe command "add_lunch_combo" is obsolete and "COMMAND_LUNCH_CHOICES" took its place..
Sorry in advance for this nooby questions...

Categories

Resources