Pitch Black Recovery Project based on TWRP (SM-A750FN/..) - Samsung Galaxy A7 (2018) ROMs, Kernels, Recoveries

Hello I wanna tray to compile width community a recovery because all posted TWRP'S for SM-A750FN/DS are unbotablle. From page 4 was booted but not properly and stayed in bootloop. (for some reason my Fastboot mode on device don't initialize on phone, means I flash just over download mode) I was trying all recovery a month without success. Because of this reasons I was do decision that I wanna tray to compile a recovery. For this project I place for help to collect all relevant data and how they should and must be sorted in dictionary. And for changes in files for recovery itself, exist enough tutorials. My first question it is how do download the from relevant page the Source Code Android and if I need it to compile a recovery, in principle im a noob. Have Experience to compile Linux Kernel but not width android. I work on MAC OS Big Sur and Pitch Black Recovery Project is based on TWRP. For any advice I will be grateful. I work long on projects and thorough.
Found:
Samsung Open Source SM-A750FN
Source Code Android ... Android Open Source
Establishing a Build Environment
Pitch Black Recovery ... guide-XDA by Dees_Troy
[NOOB FRIENDLY]How to compile TWRP from source step by step by Hacker432
Samloader ... Factory firmware for SM-A750FN or other Samsung Devices
Twrp Device Tree Generator
build.prop of my device
exynos7885 - Recovery Device Tree for the 2019 Samsung Galaxy Tab A [SM-T515]
minimal-manifest-twrp
The Build System by oreilly.com
Building Android O with a Mac
TWRP Tree From Scratch - YouTube
[DEV]How to compile TWRP touch recovery XDA
Exemple
{
"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"
}
Models

Krys89 said:
Hello I wanna tray to compile width community a recovery because all posted TWRP'S for SM-A750FN/DS are unbotablle. From page 4 was booted but not properly and stayed in bootloop. (for some reason my Fastboot mode on device don't initialize on phone, means I flash just over download mode) I was trying all recovery a month without success. Because of this reasons I was do decision that I wanna tray to compile a recovery. For this project I place for help to collect all relevant data and how they should and must be sorted in dictionary. And for changes in files for recovery itself, exist enough tutorials. My first question it is how do download the Source Code Android and if I need it to compile a recovery, in principle im a noob. Have Experience to compile Linux Kernel but not width android. I work on MAC OS Big Sur and Pitch Black Recovery Project is based on TWRP. For any advice I will be grateful. I work long on projects and thorough.
Found:
Samsung Open Source SM-A750FN
Source Code Android
Pitch Black Recovery ... guide
Samloader ... Factory firmware for SM-A750FN
build.prop
Exemple
View attachment 5289289​
Click to expand...
Click to collapse
Hi im not developer and im cant help you in thiss but i can try it and saw if it work or no. My phone :A750FNXXU5CUA1 and please if it work in these divice now send it to me because i have many work by custom recovery and there aren't any custom recovery's work in my device to now!! Thanks for you im waiting reply

Don't worry I don't have plans to buy a new phone... was so angry thet's even I was tray to Brik my phone but was not able to do it, if you don't touch boot partitions (except 'boot.img is needed to flash for Root Without TWRP and then on XDA root SM-A750 without TWRP width Magsik for root boot partition ') If you flash wrong (other - means second boot partition as example "don't tray it to flash") boot of phone will be initialize in FSM ( factory service mode width where I use still heimdall it is impossible to Brik phone when all use just stock boots/partitions/files 'for models for phone and not files from second hand file poster / use samloader as my experience trusted files are to find on this webpage for stock firmware and everything will work like from samloader' partitions named boot flash width stock '*.img' and phone is "unbrikable" and even if you have no Fastboot then you flash over download mode. And if this project success then it will be posted on XDA forum. Wanna lern and even write a guide for community width my experience how to compile a recovery in this case of SM-A750FN/... So far I know you can't downgrade binary ('U5 '- A750FNXXU5CUA1 - newest) without Fastboot mode ( and why for some reason don't work by me), maybe in new models it dosent work at all ...
To root widhout TWRP are steps needed:
Download latest release of Magsik.apk from GitHub and use it to mod boot.img from stock rom, then the (boot.img magsik) from Dowanlods folder on phone download it to your computer / linux device.
Then you power off device and then by holding (Vol UP +Vol DOWN) you put a pc a compatible cable 'while connected to pc' in phone to entrance a download. Then use heimdall to flash rooted boot.img.
(look my pit and then yours file but behave yours 'option show pit by heimdal is needed- the Partition Name and Flash Filename must match' for every section)
Flash width heimdall of rotted boot.img width Magsik:
Code:
heimdall flash --BOOT boot.img
Done your phone is rooted.
Example of flash of full stock firmware (14 partitions) with heimdall, follow-up is also important to:
Code:
heimdall flash --BOOTLOADER sboot.bin --CM cm.bin --BOOT boot.img --RECOVERY recovery.img --SYSTEM system.img --VENDOR vendor.img --CACHE cache.img --ODM odm.img --OMR omr.img --HIDDEN hidden.img --RADIO modem.bin --PARAM param.bin --CP_DEBUG modem_debug.bin --USERDATA userdata.img
Don't dissconect or shutdown phone while flashing.
Then my question for XDA is, do I collected all files ? What for files I excly need ?

As Tutorial's follows I was use Twrp Device Tree Generator to make from stock recovery a device tree of recovery. With output:
Code:
.
├── device_tree_from_stock_recovery
│ └── samsung
│ └── a7y18lte
│ ├── Android.mk
│ ├── AndroidProducts.mk
│ ├── BoardConfig.mk
│ ├── device.mk
│ ├── omni_a7y18lte.mk
│ ├── prebuilt
│ │ ├── Image.gz
│ │ └── dt.img
│ ├── recovery
│ │ └── root
│ │ └── ueventd.rc
│ ├── recovery.fstab
│ └── vendorsetup.sh
└── recovery.img
6 directories, 11 files
To comile on Mac OS we need to do it on "case-sensitive filesystem" follows the tutorial from google it needs to be created a ".dmg" file where data will be stored.
Example of creating ".dmg" file.
Code:
hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 250g ~/android.dmg.sparseimage
The next step will be to clone the Pitch Black Recovery Project and Get android open source I downloaded the omni repo as well. From android_device_samsung_gta3xl I can take configurations for exynos7885.
Then I have now:
​On Mac OS i was going intro multiprocessing issues while repo sync.
To solve this problem I edited the "pool.py" and add a line of code.
Code:
import multiprocessing
nano /usr/local/Cellar/[email protected]/3.9.4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py
Then... ( "-j8" is faster)
Code:
repo sync -c -j1
The result is no errors while sync of repository.
iMac-von-macOSmni macos$ repo sync -c -j1 --fail-fast
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Fetching: 100% (362/362), done in 1m6.207s
Updating files: 100% (67/67), done.m/test/vts-testcase/performanceUpdating files: 29% (20/67)
Checking out: 100% (362/362), done in 40.780s
repo sync has finished successfully.
Click to expand...
Click to collapse
While tray of first build was missing module because omni dosen't allow full repository from google for download architecture to work width it I use command .
Code:
cd /Volumes/dmg_omni/omnii/prebuilts/go/
git clone https://android.googlesource.com/platform/prebuilts/go/darwin-x86
Its all data ? Or is missing something ...

Krys89 said:
As Tutorial's follows I was use Twrp Device Tree Generator to make from stock recovery a device tree of recovery. With output:
Code:
.
├── device_tree_from_stock_recovery
│ └── samsung
│ └── a7y18lte
│ ├── Android.mk
│ ├── AndroidProducts.mk
│ ├── BoardConfig.mk
│ ├── device.mk
│ ├── omni_a7y18lte.mk
│ ├── prebuilt
│ │ ├── Image.gz
│ │ └── dt.img
│ ├── recovery
│ │ └── root
│ │ └── ueventd.rc
│ ├── recovery.fstab
│ └── vendorsetup.sh
└── recovery.img
6 directories, 11 files
The next step will be to clone the Pitch Black Recovery Project and Get android open source.
Then I have now:
View attachment 5290153
View attachment 5290163​Its all data ? Or is missing something ...
Click to expand...
Click to collapse
Im dont untrestand any think of them but please end speed we need TWRP

Thank you for taking your time to work on a recovery for this phone. The previous model of this gets so much support yet this is lacking. If there is any way I could support you let me know!

I'm moving project intro
Ubuntu 18.04​i was copy PBRP intro folder work/botable/PBRP and device tree created width tool I was copy to work/devices. After first tray of compelling without success I get output. Means i get "soong" issues while research i was find few solutions for synce repo but without success. Allowing more ram for virtual machine and use
Code:
make -j1 recoveryimage ALLOW_MISSING_DEPENDENCIES=true
i was able to start compiling but agin i go intro issuses this time width "TARGET_SCREEN_WIDTH and TARGET_SCREEN_HEIGHT" i was set in
/home/lol/Schreibtisch/work/bootable/recovery/gui/Android.mk
DEVICE_RESOLUTION :=1080x1920
Click to expand...
Click to collapse
I build PBRP as few changes as posible after using TWRP genegator for the tree. After this i done few changes about wpa_supplicant width uncommenting contend
device/generic/goldfish/wifi/wpa_supplicant_8_lib/Android.mk
Click to expand...
Click to collapse
but in recovery he is not needed. I tray some day to reproduce the whole procedure and notice all changes one after another. When it comes to compress img then it is crashing. Means mayby i need just create a empty file inside because of rsync. Then lets tray. On GitHub I found the same issuse means I will be need agin download full google AOSP. Recovery can't be builded on OMNI anymore. I take a few days to investigate it. So first image was unbootable i tray to recompile it agin like in other post with the 64bit binder flag.
BoardConfig.mk TARGET_USES_64_BIT_BINDER := true
Click to expand...
Click to collapse
Im using commands:
Code:
rm -rf out/ ; make clobber ; make clean ; rm -rf out ; . build/make/envsetup.sh ; lunch omni_a7y18lte-eng ; make -j8 recoveryimage ALLOW_MISSING_DEPENDENCIES=true LLC_ALL=C
make -j8 bootimage ALLOW_MISSING_DEPENDENCIES=true
Last issue what i have to do width. Spited output command works but not this one width rsync . Means this --exclude log... it is still ram issuse adding more of it sloves sometimes the problem.
A screenshot while building.
Im do recovery as first time I need a few tray to understand tree structure of OMNI and AOSP.​

I got Pitch Black Recovery to work on my A750F, I still need to fix some bugs (adb, fstab, etc) but overall it's working.

Got ADB and MTP to work!
I've been trying in the past few days to get encryption to work, but with no luck.
Should I post it in another thread as an unofficial release or just share the file here?
Please tell me if you find bugs
Downloads:
installable zip (you need a working TWRP to install using zip)
flashable image (flash using heimdall, no need for TWRP)
kernel source
device tree
NOTE: The device tree is a TWRP device tree, so if you want to build it you need to change in omni_a7y18lte.mk from
Code:
$(call inherit-product, vendor/omni/config/common.mk)
to
Code:
$(call inherit-product, vendor/pb/config/common.mk)

itmr said:
Got ADB and MTP to work!
I've been trying in the past few days to get encryption to work, but with no luck.
Should I post it in another thread as an unofficial release or just share the file here?
Click to expand...
Click to collapse
I think you should have a new thread with only releases or updates

Dark8812 said:
I think you should have a new thread with only releases or updates
Click to expand...
Click to collapse
Done

Is it compatible with A750N?

I have SM-A750FN for testing. Unfortunately, I cannot install any custom ROMs in this recovery mode. Bootloop without interruption. I added an installation log file with Recovery PBRP 3.1.0 Unofficial. Log file from the installation of TreeUI+ 0.9.5 Beta for SM-A750FN Help me?

Mark.Kerensky said:
I have SM-A750FN for testing. Unfortunately, I cannot install any custom ROMs in this recovery mode. Bootloop without interruption. I added an installation log file with Recovery PBRP 3.1.0 Unofficial. Log file from the installation of TreeUI+ 0.9.5 Beta for SM-A750FN Help me?
Click to expand...
Click to collapse
Do you have latest firmware? downgrade it to december or below security patch level.
treeui don't work on latest firmware. (from what I know).

xxfDeadStar88x said:
Do you have latest firmware? downgrade it to december or below security patch level.
treeui don't work on latest firmware. (from what I know).
Click to expand...
Click to collapse
It is not possible to change to a different security level, e.g. in December. ODIN shows an error, the latest firmware is installed without any problem. Can you get around it somehow?

Mark.Kerensky said:
It is not possible to change to a different security level, e.g. in December. ODIN shows an error, the latest firmware is installed without any problem. Can you get around it somehow?
Click to expand...
Click to collapse
I can upgrade or downgrade mine without error.
Unlock your bootloader in developer options before flashing using odin.
and also prefer to enable usb debugging.

xxfDeadStar88x said:
I can upgrade or downgrade mine without error.
Unlock your bootloader in developer options before flashing using odin.
and also prefer to enable usb debugging.
Click to expand...
Click to collapse
Debugging enabled, OEM lock removed. I run in download mode and connect five files as it should and start and immediately after a few seconds ODIN error. Latest software no problem. December is impossible. What a ?

How to do a successful debranding to the December version? Everything is failing so far.

Mark.Kerensky said:
How to do a successful debranding to the December version? Everything is failing so far.
Click to expand...
Click to collapse
u need flash the oldest SAME SECURITY BIT firmware.
i.e if u have 6 bit firmware, you need flash the oldest 6 bit firmware.
Use this page https://samfw.com/ and filter the firmware list by your bit number.

xkovgjdakmhz said:
u need flash the oldest SAME SECURITY BIT firmware.
i.e if u have 6 bit firmware, you need flash the oldest 6 bit firmware.
Use this page https://samfw.com/ and filter the firmware list by your bit number.
Click to expand...
Click to collapse
Thank you very much. You're right. The bit is good and everything is ok. Custom Rom TreeUI + 0.9.5 Beta already works on SM-A750FN uploaded by TWRP 3.2.3-1
Man learns all his life, and insists stupid.

Related

how to build kernel ramdisk

let me explain my problem, i've created a .ftf (kernel for xperia x8) and it is boot up but i missed some files inside the ramdisk, so now i need to repack my new ramdisk folder into ramdisk file and i don't know how to do that .
Read my guide on how to compile and put together a custom kernel for the X8: http://forum.xda-developers.com/showthread.php?t=1923240
The method (whatever it is) you are following is not correct for any Android phone.
Oops. I guess it isn't mentioned there.
Basically what you have to do is open up a Terminal in Ubuntu. Navigate to your ramdisk folder (the one that contains the init.rc, init.usb.rc etc.). Then issue this command:
Code:
find . | cpio -o -H newc | gzip > ../ramdisk
Grab the ramdisk from one directory above your ramdisk folder.
Sorry for the confusion.
sgt. meow said:
Read my guide on how to compile and put together a custom kernel for the X8: http://forum.xda-developers.com/showthread.php?t=1923240
The method (whatever it is) you are following is not correct for any Android phone.
Click to expand...
Click to collapse
i don't understund one thing, when i'm getting the ramdisk file? when compiling the rom?or the kernel?
i've compiled cm10.1 rom and i need to change the bootclasspath
You have to unpack a working kernel with DooMLorD's kernel.sin unpacker. You'll get the ramdisk. Then edit the BOOTCALSSPATH in init.rc.
sgt. meow said:
Read my guide on how to compile and put together a custom kernel for the X8: http://forum.xda-developers.com/showthread.php?t=1923240
The method (whatever it is) you are following is not correct for any Android phone.
Oops. I guess it isn't mentioned there.
Basically what you have to do is open up a Terminal in Ubuntu. Navigate to your ramdisk folder (the one that contains the init.rc, init.usb.rc etc.). Then issue this command:
Code:
find . | cpio -o -H newc | gzip > ../ramdisk
Grab the ramdisk from one directory above your ramdisk folder.
Sorry for the confusion.
Click to expand...
Click to collapse
when i run the i get this error
bash: ../ramdisk: Is a directory
Name the folder that has the ramdisk contents something like "XYZ" and put it in another folder named "ABC". Then issue this command.
So basically the structure would be:
/ABC/XYZ/* /*ramdisk contents have been denoted by * */
And after issuing the command grab the ramdisk from ABC folder.
sgt. meow said:
Name the folder that has the ramdisk contents something like "XYZ" and put it in another folder named "ABC". Then issue this command.
So basically the structure would be:
/ABC/XYZ/* /*ramdisk contents have been denoted by * */
And after issuing the command grab the ramdisk from ABC folder.
Click to expand...
Click to collapse
yeah thank you now it's working but i think something is missing , can you help me in developed kernel for cm10.1 ?
i already compiled the rom but now i'm struggling with the kernel part , i can send you all the files for the ramdisk and if you can put together a working kernel it will be great and i can move on and fix the problems with the rom itself
Look man. I can download the source and help you compile the kernel and the ramdisk. But as Daveee10 has said, even if you get it booting, there are tons of things that need to be backported (which is extremely hard) for it to work properly. So it's almost like choosing a route that you know will lead to a dead-end. But I'll help anyway.
PM me.

How do you unpack and repack boot.img?

NOTE: Unfortunately I've had to remove links from this post because I'm a new user. I'll add them back in once I have enough posts.
I've been trying to edit a file in boot.img from the CyanogenMod 12.1 (huashan) nightlies but I'm experiencing some issues finding the right tools/methods for the job.
Most scripts I've found expect an Android Magic number at the beginning of the file but this simply isn't there. It seems there is no header at all that matches the specification from bootimg.h (missing link) though I did discover the cmdline argument at the end of the file with a hex editor.
After searching and experimenting for hours I found a script here (missing link) which enabled me to extract the kernel and ramdisk images despite the missing header but now I don't know how to repack the files into a boot.img of the same structure.
I've tried the following but it results in a boot.img that is about 40% larger than the orginal (despite me only adding one line of code) and has an entirely different structure (with an Android Magic number, etc.).
Code:
mkbootimg --base 0x00200000 --pagesize 2048 --kernel boot.img-kernel.gz --ramdisk newramdisk.cpio.gz -o newboot.img
I found this resource (TWRP, missing link) which mentions that Xperia devices have special boot images (or something like that, I didn't understand all of it) - this might explain why the boot.img structure is so different - but I can't find any further documentation on this or instructions on how to deal with the format.
The Xperia devices have a recovery-in-boot arrangement. This means that the recovery is booted using the regular kernel / boot image in the device. Team Win has worked with the FreeXperia device maintainers to come up with a way to extract the ramdisk from the FOTAKernel partition and use the ramdisk from that partition instead of the recovery that is included in the boot image of your device. This means that if you install current CM nightlies and flash TWRP to the FOTAKernel partition, you will be able to use TWRP instead of the CWM or CM recovery that normally comes in a CM boot image. Other boot images including stock kernels can be repacked to include this extraction utility to allow you to use TWRP from the FOTAKernel partition. This setup allows you to choose what recovery you want to have installed and allows you to update your recovery more easily. Unfortunately this setup requires that the boot image that you have installed include the ramdisk extraction utility.
Click to expand...
Click to collapse
So now I'm at a loss at how to continue. I would much appreciate any pointers, ideas or help in general.
@infernalpostcard , hopefully this tool made by @Adrian DC will help you out.
https://github.com/AdrianDC/android_huashan_bootimg_editor
Raienryu said:
@infernalpostcard , hopefully this tool made by @Adrian DC will help you out.
https://github.com/AdrianDC/android_huashan_bootimg_editor
Click to expand...
Click to collapse
Thanks. This looks really promising. I'm trying it out now...
EDIT: It worked! This is exactly what I needed. Unfortunately what I was actually trying to achieve (apply a fix to break a boot-loop my phone gets in, due to an encrypted filesystem) didn't work so I'll have to come up with new ideas.

[SOLVED] Help building a custom kernel...

Whatever I do, my custom build kernels fail to boot. There's the ZUK logo very briefly, then device drops to bootloader screen. I'm out of ideas what I'm doing wrong, maybe someone here can give me a hint. :good:
I've tried with current AEX kernel git snapshot and also stock kernel sources. Building using the AEX_defconfig goes ok, I have Image.gz, replace it in previously extracted "stock" boot image and use mkbootimg.py to rebuild the new image. Offsets etc. are all correct (I think), like this: (from AEX)
Code:
kernel=kernel
ramdisk=ramdisk
page_size=4096
kernel_size=9101281
ramdisk_size=2671109
base_addr=0x80000000
kernel_offset=0x00008000
ramdisk_offset=0x01000000
tags_offset=0x00000100
cmd_line='androidboot.hardware=qcom ehci-hcd.park=3 lpm_levels.sleep_disabled=1 [email protected] buildvariant=userdebug'
board=""
format=gzip
But the damn new image won't boot, like described above. There has to be something (probably very stupid) I'm missing...
If I replace my own Image.gz with the originally extracted one and mkboot and so on, it's ok. So I guess it has something to do with my kernel build and/or environment. Are there any subsequent steps needed to do with the compiled kernel Image.gz? Or is it just my kernel config which is wrong? But I'm using the AEX defconfig (n7x-caf_z2_row_defconfig, to be exactly) so this should be fine, no?
Ok, I've got it. I had forgottten (=didn't know about at all) to append the device tree blob (arch\arm64\boot\dts\qcom\msm8996-v3-pmi8996-mtp.dtb) to kernel zImage... Simply cat'ing these together works!
Goodluck bro.
void23 said:
Ok, I've got it. I had forgottten (=didn't know about at all) to append the device tree blob (arch\arm64\boot\dts\qcom\msm8996-v3-pmi8996-mtp.dtb) to kernel zImage... Simply cat'ing these together works!
Click to expand...
Click to collapse
please explain .. what exactly i need to do with that file..

Samsung Galaxy Tab A 7.0 LTE (2016) SM-T285 Lineage OS complete build guide

For SM-T285 users that want to build Lineage OS for their own device I have posted a complete build guide here:
https://github.com/lineage-gtexslte/build_guide
jedld said:
For SM-T285 users that want to build Lineage OS for their own device I have posted a complete build guide here:
https://github.com/lineage-gtexslte/build_guide
Click to expand...
Click to collapse
Thanks for the ROM update!
I started from scratch and when I compiled, I got this error:
fixdep: error opening config file: ../../../../../../kernel/samsung/gtexslte/scripts/genksyms/parse.tab.c: No such file or directory
I have had this error before and had to copy the file from another folder, but I should not have to do this.
So, I copied the file to folder where it was missing.
New error:
target Prebuilt: am (/home/gcrutchr/taba/out/target/product/gtexslte/obj/EXECUTABLES/am_intermediates/am)
Symlink: /home/gcrutchr/taba/out/target/product/gtexslte/system/bin/app_process -> app_process32
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: linker command failed due to signal (use -v to see invocation)
gcrutchr said:
Thanks for the ROM update!
I started from scratch and when I compiled, I got this error:
fixdep: error opening config file: ../../../../../../kernel/samsung/gtexslte/scripts/genksyms/parse.tab.c: No such file or directory
I have had this error before and had to copy the file from another folder, but I should not have to do this.
So, I copied the file to folder where it was missing.
New error:
target Prebuilt: am (/home/gcrutchr/taba/out/target/product/gtexslte/obj/EXECUTABLES/am_intermediates/am)
Symlink: /home/gcrutchr/taba/out/target/product/gtexslte/system/bin/app_process -> app_process32
clang++: error: unable to execute command: Aborted (core dumped)
clang++: error: linker command failed due to signal (use -v to see invocation)
Click to expand...
Click to collapse
What's your gcc version? might need to use gcc 6
jedld said:
What's your gcc version? might need to use gcc 6
Click to expand...
Click to collapse
gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC)
gcrutchr said:
gcc version 8.1.1 20180712 (Red Hat 8.1.1-5) (GCC)
Click to expand...
Click to collapse
later versions of gcc may not work with lineage 14.1, I had to downgrade mine, though for another project.
you can do:
Code:
sudo apt-get install gcc-6 g++-6 g++-6-multilib
sudo update-alternatives --install
inform me if this works and I'll update my guide. Might consider making a docker based build if issues like this happen often.
jedld said:
later versions of gcc may not work with lineage 14.1, I had to downgrade mine, though for another project.
you can do:
Code:
sudo apt-get install gcc-6 g++-6 g++-6-multilib
sudo update-alternatives --install
inform me if this works and I'll update my guide. Might consider making a docker based build if issues like this happen often.
Click to expand...
Click to collapse
Actually, I am on Fedora Linux (uses less resources) and have been using gcc 8xx for some time. I compile LineageOS 14.1 for Note 3 (ha3g) and the Note Pro 12.3 (v1a3g) and have no problems. But, I will investigate further.
Ok...so I had issues building the kernel...could not find some include files.
So...I decided to use build_kernel.sh script to to make boot.img. The resultant file is about 1.4 MB smaller, there is no init file in the ramdisk folder and the boot.img-ramdisk.cpio.gz in the split_img folder is about 1/2 the size of your recent boot.img file.
Not sure when to go from here.
Okay, so I followed the instructions - after upgrading Fedora to v29 - but, this time I used Docker. Had to make some script changes for Fedora, but got most everything installed. The "work" directory is empty. I was able to make a working system.img that installed with the built .zip file. The kernel would not boot - hung on the logo screen. I restored the 10/17 boot.img and the system booted up. Now, I will work on the boot.img file. I did notice this time that the boot.img file was about the same size as the 10/17 boot.img file I downloaded. So, that's an improvement. I just finished modifying the build_kernel.sh file. So, I installed the kernel I made and it still hung on the logo screen. So, back to square 1 regarding the kernel.
gcrutchr said:
Okay, so I followed the instructions - after upgrading Fedora to v29 - but, this time I used Docker. Had to make some script changes for Fedora, but got most everything installed. The "work" directory is empty. I was able to make a working system.img that installed with the built .zip file. The kernel would not boot - hung on the logo screen. I restored the 10/17 boot.img and the system booted up. Now, I will work on the boot.img file. I did notice this time that the boot.img file was about the same size as the 10/17 boot.img file I downloaded. So, that's an improvement. I just finished modifying the build_kernel.sh file. So, I installed the kernel I made and it still hung on the logo screen. So, back to square 1 regarding the kernel.
Click to expand...
Click to collapse
Were you able to obtain a logcat with the failed boot? Possible issue is that the external kernel modules did not get compiled
jedld said:
Were you able to obtain a logcat with the failed boot? Possible issue is that the external kernel modules did not get compiled
Click to expand...
Click to collapse
Actually, not sure how I got it to compile. Having problems with docker. Cannot run python or any other dev command. Stuck as root user. So am trying to learn about docker. I do not think I was in docker when it compiled. Will get back to you after I figure this whole mess out.
27 October 2018
After reading the Docker documentation and playing with Docker, I removed it from Fedora. It is just too complicated to use even though it sounds simple. After removing Docker, I did a make clean and a make mrproper in the kernel folder. I ran 'brunch gtexslte'. The compile completed after I copied mkbootimg to the out folder - for some reason it is not getting copied there during the make process. This time the boot.img was over 9mb. It still will not boot. I will get log files today. I will also check to make sure the system files work with the good boot.img.
Question how do I update the system folder to the latest builds of lineage 14.1?
Your repo xml file restricts the source to your repo.
Okay!
Fixed boot.img not booting.
If you unpack boot.img, the file 'boot.img-imgtype' has an invalid image type. In the file, it says 'AOSP-PXA'.
It should say 'AOSP'.
I do not know where this is getting added. I have done a grep and could not find it.
As a side note, I used the build_kernel.sh script to make the kernel.
Question: How do I apply the security updates without manually following the (-) (+) in the diff file?
I am now able to do a complete make and install using the generated .zip file.
Here are the steps:
1. Setup your environment - I am using Fedora, but these instructions will work for any flavor of linux
2. Make sure you have the linaro gcc toolchain (32-bit) installed, and you have modified kernel/samsung/gtexslte/build_kernel.sh
3. Run: build/envsetup.sh, then brunch gtexslte
4. If the brunch stops near the end, copy mkbootimg from system/core/mkbootimg to out/host/linux-x86/bin
......or you can write a shell script to copy the file, as I did, before starting the build
5. After the build completes, cd into kernel/samsung/gtexslte
6. Run make mrproper, to clean the kernel folders
7. Run build_kernel.sh
8. After the kernel (zImage) is built, you need to make the boot.img
9. @jedld has posted how to do this in his build instructions
10. Now that you have a boot.img, you need to modify it.
11. Unpack boot.img
12. In the file 'boot.img-imgtype' , you need to change 'AOSP-PXA' to 'AOSP' - without the quotes
13. Repack boot.img
14. Replace boot.img in the lineage*.zip file with the one you just modified
15. Copy the lineage*.zip to you Tab-A, reboot into recovery and install it.
Here is my script for copying the mkbootimg file into the out folder, BEFORE I run brunch gtexslte:
if [ ! -d "out/host" ]; then
mkdir out/host
mkdir out/host/linux-x86
mkdir out/host/linux-x86/bin
fi
cp system/core/mkbootimg/mkbootimg out/host/linux-x86/bin
@jedld
Update on normal kernel build:
The reason the boot.img - when building via brunch gtexslte - will not boot is a bad zImage. If I replace the zImage from a bootable boot.img, the bad boot.img will boot okay.
Now I need to figure out what the problem is.
you can get the incremental diffs from linux.org
jedld said:
you can get the incremental diffs from linux.org
Click to expand...
Click to collapse
Is this for kernel changes or security patches?
gcrutchr said:
Is this for kernel changes or security patches?
Click to expand...
Click to collapse
My mistake, I meant kernel.org not linux.org. The incremental diffs contain changes to the mainline kernel which can contain security fixes and/or bug fixes. This is different from android specific patches which google releases separately as kernel patches. The kernel started out from the stock sources provided by samsung on 5.1.1 and then I added google's N and Oreo patches on it (patches related to selinux and oreo binder enhancements). I also added incremental diffs from kernel.org, it started out at 3.10.58 and then I applied incremental diffs until I got to 3.10.107. Unfortunately 3.10 is EOL now, upgrading the kernel to the 4.10 series will take a lot of work.
The SM-T285 Lineage OS is excellent. Is it possible to get the FM radio working? I have tried everything but can't get it to work. I would appreciate your help.
akasarf said:
The SM-T285 Lineage OS is excellent. Is it possible to get the FM radio working? I have tried everything but can't get it to work. I would appreciate your help.
Click to expand...
Click to collapse
It's probably not implemented in the kernel.
Just downloaded Radio FM from PlayStore and installed it. It works!!
I meant if there is a working FM radio tuner app that works without the internet on Lineage
gcrutchr said:
It's probably not implemented in the kernel.
Just downloaded Radio FM from PlayStore and installed it. It works!!
Click to expand...
Click to collapse

Building/Flashing custom kernel to SM-G780F(Exynos) help

Obligatory first post on the forums here so hopefully this is the right place!
I have been lurking on the forums for the past month or so and have been working on building a custom kernel from source for the SM-G780F/DSC(Exynos) edition. I've built some kernels from source before so I have some experience there, but actually getting the kernel to flash and run on the device is a different story. I have built the kernel with the modifications that I wanted, fixed some flashing issues I was running into, finally got the boot.img to flash succefully to the device, rebooted the device and the phone just hangs at the Samsung logo. (See "Image from iOS.png").
Here is the steps that I did:
Unlock Bootloader on the device.USB Debugging on, OEM Unlocking enabled in dev settings/ OEM Lock: OFF(U) in DL mode.
Checked to make sure KG State is not Prenormal, it is in checking state.
Device is currently running stock G780FXXS7CUI5, so I download this version source from https://opensource.samsung.com/uploadSearch?searchValue=SM-G780F
Extract Kernel.tar.gz, update toolchain paths in the Makefile/build_kernel.sh, and I make some modifications to the defconfig file.
Code:
./build_kernel.sh
; Fix compiler errors/warnings as they appear. Rinse and repeat until the kernel is built.
Now that the kernel is built I pull the stock ROM that this device is currently running from Sammobile. https://www.sammobile.com/samsung/g.../SM-G780F/MID/download/G780FXXS7CUI5/1583411/
Extract the AP directory from the Sammobile ROM download.
Extract the boot.img.lz4 from the AP directory so I now have the uncompressed boot.img.
Copy over the the stock boot.img to my AIK directory. (AIK-Kinux-V3.8)
Code:
./unpackimg.sh boot.img
, cd into split_img, rm the stock boot.img-kernel
Move my custom kernel image to the AIK directory,
Code:
mv kernel_source/out/arch/arm64/boot/Image /AIK-Linux/split_img/boot.img-kernel
Run AIK repackimage.sh
Now I have a SM-G780G(Snapdragon edition) S20_FE with Magisk installed. So I copy over my image-new.img to this device and patch the image-new.img with Magisk
Move back the patched image to my linux enviroment. Rename my patched image boot.img.
Compress my boot img with
Code:
lz4 -B6 --content-size boot.img boot.img.lz4
.
Replace the stock boot.img.lz4 in my AP directory with my modded boot.img.lz4
Pull down a clean vbmeta.img from https://dl.google.com/developers/android/qt/images/gsi/vbmeta.img
Compress this image as well
Code:
lz4 -B6 --content-size vbmeta.img vbmeta.img.lz4
Replace the stock vbmeta.img.lz4 in the AP directory with my clean vbmeta.img.lz4 in the
So the contents of the AP directory currently is
Code:
22556009 Apr 7 12:57 boot.img.lz4
1155 Sep 23 2021 dqmdbg.img.lz4
219753 Sep 23 2021 dtbo.img.lz4
4096 Sep 23 2021 meta-data
1148 Sep 23 2021 metadata.img.lz4
2773 Sep 23 2021 misc.bin.lz4
35115127 Sep 23 2021 recovery.img.lz4
5457239441 Sep 23 2021 super.img.lz4
822394050 Sep 23 2021 userdata.img.lz4
2375 Apr 7 12:57 vbmeta.img.lz4
2812 Sep 23 2021 vbmeta_samsung.img.lz4
tarball all these files with
Code:
tar -cvf Modded_AP.tar *
Spin up latest version of ODIN
Place Custom AP into AP slot, Stock BL into BL slot, Stock CP into CP slot, and Stock HOME_CSC into CSC slot
Start Flashing.
Flashing is successful.
Device reboots, and hangs at the Samsung Galaxy S20FE Screen with the warning "I am not running samsungs official software."
A couple of questions I am asking myself is the stock vbmeta_samsung.img.lz4 necessary, as well as some of the other stock files? Is patching my boot.img with Magisk running on a different
device giving me issues? Am i missing a step somewhere or is there still extra steps I need to take to get a modded kernel running on this device. Any help would be greatly appreciated or if I need to provide any more insight please let me know! Thanks again!
you'd be extremely welcome in our little group
S20 FE Modding
Exynos AOSP: https://t.me/S20FE_Exy TurboUI: https://t.me/projectxs20fe Prime Kernel Snap: https:/t.mes20fesnapdragon Prime Kernel Exynos: https://t.me+vpzEK9kPMc41MmY9 Bandido Kernel https://t.me/bandidokernel Klimbo Kernel https://t.me/klimbokernel
t.me
there's also a kernel dev there from time to time who has built kernels for all versions FE completely blind, i.e. without being able to flash them himself. maybe we can get you two talking.
it sounds like you've added two kernels to your AP archive. as I understand it once you've built your kernel, compressed it to .lz4 you can just archive it inside a tar file and flash that alone (as long as it matches your firmware).
Hi there Buddy, so answering your questions- we dont need vbmeta everytime, we only use it once to flash twrp after which flashing vbmeta not necessary. Now yes patching boot.img with other device other than the one you are running causes problems here and device doesnt like to boot. As per the last kernel dev he just used our stock boot.img and compiled his changes. And we flash hi kernel like normal flash.
S20 FE Modding
Exynos AOSP: https://t.me/S20FE_Exy TurboUI: https://t.me/projectxs20fe Prime Kernel Snap: https:/t.mes20fesnapdragon Prime Kernel Exynos: https://t.me+vpzEK9kPMc41MmY9 Bandido Kernel https://t.me/bandidokernel Klimbo Kernel https://t.me/klimbokernel
t.me
You can even join this group, there are many people willing to help others.
Also i have been developing stock based roms for all the variants, so would be happy to test them once they get stable enough to boot.
Thanks for the responses everyone! I'll take my follow up questions to the group!
Hi. There are some kernel changes that is needed to be applied in order to successfully boot the custom kernel. I suggest you post the kernel source so I can review it. You don't need to place everything inside the AP. You can just archive the boot.img.lz4 as tar.
Also, a lot of your steps can be simplified by making a twrp-flashable zip instead. You can use my template here:
android_kernel_samsung_s20fe/AnyKernel3 at exynos · pascua28/android_kernel_samsung_s20fe
Custom kernel for Samsung S20 FE (Snapdragon and Exynos variants) - android_kernel_samsung_s20fe/AnyKernel3 at exynos · pascua28/android_kernel_samsung_s20fe
github.com
Just move the arch/arm64/boot/Image as zImage and you can zip the AnyKernel3 folder and there you have a twrp-flashable zip. It's a lot more convenient this way as people do not need to carry around their computers whenever they need to flash custom stuffs plus, it's more universal this way as they don't have to have a matching firmware version; it will just use the existing boot image, unpack it, replace the kernel, repack and then flash it back to the device.
If you have any questions, feel free to contact me on telegram (pascua14). I hope you succeed
Regards

Categories

Resources