[TOOLS] Boot image tools for Samsung Galaxy Tab 4 7.0 - Galaxy Tab 4 Original Android Development

Boot image tools for Samsung Galaxy Tab 4 7.0, Degas board Marvell PXA1088
Unpack boot.img:
Code:
$ mkdir boot
$ tools/degas-unpackbootimg -i boot.img -o boot
$ mkdir -p boot/ramdisk
$ cd boot/ramdisk/
$ gunzip -c ../boot.img-ramdisk.gz | cpio -i
$ cd ../
Repack boot.img:
Code:
$ ../tools/mkbootfs ramdisk | ../tools/minigzip > boot.img-ramdisk-new.gz
$ ../tools/degas-mkbootimg --kernel boot.img-zImage
--ramdisk boot.img-ramdisk-new.gz --dt boot.img-dt
--signature boot.img-signature -o ../boot-new.img
$ cd ../
I'm not sure about boot image signature, you can try without --signature option. By comparing boot image to recovery image, I found a different signature and of course a different ramdisk but the rest is the same, including kernel and device tree table.
To confirm this tools reliability, you can unpack and then repack original boot/recovery image without modification. You will got two identical image, check it using a diff tool.
Generate kernel spesific device tree table:
Code:
$ tools/degas-dtbTool -o boot.img-dt-new -p kernel/scripts/dtc/ kernel/arch/arm/boot/dts/
Repack a new recovery as a flashable Odin:
Code:
$ tar -H ustar -c recovery-testkey.img > recovery-testkey.img.tar
$ md5sum -t recovery-testkey.img.tar >> recovery-testkey.img.tar
$ mv recovery-testkey.img.tar recovery-testkey.img.tar.md5
DISCLAIMER:
USE THIS TOOLS AT YOUR OWN RISK, I DON'T OWN TAB 4 7.0 FOR TESTING
Ketut P. Kumajaya, June 2014
XDA:DevDB Information
degas-mkbootimg, Tool/Utility for the Samsung Galaxy Tab 4
Contributors
ketut.kumajaya, Android Open Source Project, CyanogenMod Team, The Linux Foundation
Version Information
Status: Testing
Created 2014-06-17
Last Updated 2014-07-31

Android boot image:
Standard Android header:
Magic (8B)
kernel size (4B)
kernel addr (4B)
ramdisk size (4B)
ramdisk addr (4B)
2ndary size (4B)
2ndary addr (4B)
tags addr (4B)
page size (4B)
unused #1 (4B) (zero in standard Android)
unused #2 (4B) (zero in standard Android)
product name (16B)
kernel cmdline (512B)
id (8B)
Samsung Galaxy Tab 4 7.0 header:
Magic (8B, ANDROID!)
kernel size (4B)
kernel addr (4B, 0x10008000)
ramdisk size (4B)
ramdisk addr (4B, 0x11000000)
2ndary size (4B, 0x0)
2ndary addr (4B, 0x10f00000)
device tree size (4B, 534528)
unknown (4B, 0x02000000)
tags addr (4B, 0x10000100)
page size (4B, 2048)
product name (24B, empty)
kernel cmdline (512B, empty)
id (8B, empty)
Samsung Galaxy Tab 4 7.0 layout:
A. header (as above - 1 page)
B. kernel (n pages)
C. ramdisk (m pages)
D. second stage (o pages)
E. device tree table (started with PXA-DT magic, p pages)
F. signature (256 bytes)
Samsung Galaxy Tab 4 7.0 PXA1088 device tree format:
magic (6B, PXA-DT)
version (uint32)
num of DTBs (uint32)
platform id #1 (uint32)
soc rev #1 (uint32)
offset #1 (uint32)
size #1 (uint32)
...
platform id #Z (uint32)
soc rev #Z (uint32)
offset #Z (uint32)
size #Z (uint32)
0 ("zero")
padding
DTB #1
padding
...
DTB #Z
That's why standard tool fail to unpack this degas board boot.img

We need a brave Tab 4 7.0 owner here :laugh: Don't hesitate to ask me to repack a slight modified boot.img or a recovery repack with Google testkey so you can flash a signed flashable zip using stock recovery.

And let the games begin...Kernel check...Shoot for recovery tomorrow/later today.... Thanks bro Ive been killing myself over this
{
"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"
}

Great, a dead man back alive :laugh:

Device tree combiner tool added!

Can I use it on my tab 4 10.1 T530?

No. The tools that I share here special for Tab 4 7.0 PXA1088. For Qualcomm based platform, I think you can use standard CM boot tools (unpackbootimg, mkbootimg, and dtbToolCM).

I may be up for testing what are the risks?
Sent from my SM-T230NU using XDA Free mobile app

If you still need an idiot to brick his brand new 4.7, you can count on me

im in
im familiar with linux and what not so im in just let me know in a PM ill brick it

I don't see links to download the degas-unpackbootimg or the degas-dtbTool or for source code for these tools. At least you outlined the differences between the boot image formats in post 2 though.

Dees_Troy said:
I don't see links to download the degas-unpackbootimg or the degas-dtbTool or for source code for these tools. At least you outlined the differences between the boot image formats in post 2 though.
Click to expand...
Click to collapse
I managed to find what i believe is them here on github.

@Dees_Troy and Team Win Recovery Project, I almost forgot to say thank you for all your hard work
to make TWRP source code. Now i had compiled TWRP 2.8.0.0, and it seems working fine in my galaxy tab 7 SM-T231
mtp can detect, but still can't pullout backup at the moment. but it is not big problem fo me
@ketut.kumajaya thanks again for making degas unpackbootimg tools for pxa1088.
actually i was using it to unpack recoveryimage
mantap kali ah bro :good:
without you guys, i can't make my custom recovery
Thanks

Dees_Troy said:
I don't see links to download the degas-unpackbootimg or the degas-dtbTool or for source code for these tools. At least you outlined the differences between the boot image formats in post 2 though.
Click to expand...
Click to collapse
http://forum.xda-developers.com/devdb/project/?id=4629#downloads

ShinySide said:
And let the games begin...Kernel check...Shoot for recovery tomorrow/later today.... Thanks bro Ive been killing myself over this
Click to expand...
Click to collapse
Aside from using the degas tools, did you do anything special to make the kernel work? By special I mean did you do anything besides:
make ARCH=arm CROSS_COMPILE=arm-eabi- pxa1088_degaswifi_usa_defconfig
make ARCH=arm CROSS_COMPILE=arm-eabi- zImage
... and also possibly regenerate the device tree.
I was trying to compile & run the kernel, but it keeps getting stuck at the power-on screen (not boot animation). The kernel source is T230NUUE0ANE2, taken from the opensource center.

geseeker said:
Aside from using the degas tools, did you do anything special to make the kernel work? By special I mean did you do anything besides:
make ARCH=arm CROSS_COMPILE=arm-eabi- pxa1088_degaswifi_usa_defconfig
make ARCH=arm CROSS_COMPILE=arm-eabi- zImage
... and also possibly regenerate the device tree.
I was trying to compile & run the kernel, but it keeps getting stuck at the power-on screen (not boot animation). The kernel source is T230NUUE0ANE2, taken from the opensource center.
Click to expand...
Click to collapse
Just ran what was in the read me and used a Linaro toolchain. 4.7.4 I think. I havent messed with it much. Have it on my github but only have 2 commits pushed. stock source and update to the toolchain path but dont believe I did anything more then that.
Also dont know if you released it, but the modules are in/go in the boot.img

ShinySide said:
Just ran what was in the read me and used a Linaro toolchain. 4.7.4 I think. I havent messed with it much. Have it on my github but only have 2 commits pushed. stock source and update to the toolchain path but dont believe I did anything more then that.
Also dont know if you released it, but the modules are in/go in the boot.img
Click to expand...
Click to collapse
I guess the modules you referred to are generated by running `make modules`? How were you able to pack them into boot.img? I thought the only things that are in boot.img are the kernel (zImage), ramdisk, and the device tree, no?

geseeker said:
I guess the modules you referred to are generated by running `make modules`? How were you able to pack them into boot.img? I thought the only things that are in boot.img are the kernel (zImage), ramdisk, and the device tree, no?
Click to expand...
Click to collapse
After you compile the kernel, taek the zimage and modules (modules are built when you compile the kernel so in your kernel working folder do a search for ".ko" and youll find them all, then take the stock boot.img and use this to unpack, swap the zimage in and then do a search for .ko in the extracted boot.img folder and paste your new .ko's / modules in there. I say search for them because I cant remember if the directory is system/lib/modules or lib/modules in the boot.img and then repack it with the same tool

ShinySide said:
After you compile the kernel, taek the zimage and modules (modules are built when you compile the kernel so in your kernel working folder do a search for ".ko" and youll find them all, then take the stock boot.img and use this to unpack, swap the zimage in and then do a search for .ko in the extracted boot.img folder and paste your new .ko's / modules in there. I say search for them because I cant remember if the directory is system/lib/modules or lib/modules in the boot.img and then repack it with the same tool
Click to expand...
Click to collapse
I've got it working! The modules are actually in the ramdisk under /lib/modules, so you'd have to update the ramdisk as well... I see.
Thanks bro, for the quick reply!

Related

[HowTo] Compile the Kernel Source Code for the HTC One XL

Hi guys!
Someone requested a tutorial on how to build the kernel source code, so I thought I might as well do it I'll give you a bit more information too.
Maybe this will kick start kernel development a little bit too. Who knows.
Anyway:
1. Set up your build environment as per this guide by AOSP here: http://source.android.com/source/initializing.html
This guide will be primarily aimed at Ubuntu, but it should be easy enough to do on other Linux PCs. Ubuntu is highly recommended. And don't ask about Windows.
2. Download the toolchains: http://code.google.com/p/rohan-kernel-evita/downloads/detail?name=toolchains.tar.gz&can=2
I've hosted both GCC 4.4 and GCC 4.6 (prebuilt) on my Google Code page. These are for Linux.
Download the toolchain package here: http://code.google.com/p/rohan-kernel-evita/downloads/detail?name=toolchains.tar.gz&can=2
Then un-tar the archive and extract it to your home folder so that the path to the toolchain directories are ~/toolchain/whatever-one-you-want
3. At this point you can decide which kernel source you want to download. There are really two sources.
The first choice is getting it from HTC Dev directly. This is good if you want to build your kernel for a Sense 4 ICS ROM. If you want to build for AOSP/JB, then scroll down below all the following HTC stuff.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
To use HTC's source:
Go to HTCdev.com and make an account. Then download the source code for our device (I'd recommend the "One X" source under carrier "AT&T" version "2.20". Let the zip file download and extract it to your home folder (so the path is /home/user/evita-ics..../
To build HTC's source, run these commands:
Code:
cd ~/evita-ics-whatever_the_directory_is_named
export ARCH=arm
make elite_defconfig
Second command is saying what type of architecture we want (we are compiling for ARM processors, so we want ARM)
Third command is saying to make the default config for our device (whose hardware is codenamed "elite")
Then to build the actual kernel:
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
In the command above, there is "-j#". Replace the "#" with the number of CPUs you have.
Ask me about it if you need help. That should be it! Let the build go and in a few minutes you should have a zImage file located at ~/evita-ics-..../arch/arm/boot. That is the actual kernel.
To test out the zImage (kernel), connect your device via fastboot mode and type:
Code:
fastboot boot /path/to/zImage
Combined with the ramdisk, thats what makes the boot.img file. Eventually if you want to distribute your kernel, you should use an installer that injects the zImage into the boot.img or combine the zImage with a ramdisk to make a boot.img. I can do a tutorial on that later on as well.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
To get the "other" source:
This source is based off of HTC's source and includes other devices as well in it (the One S and Evo 4G LTE). Its good if you want to build JB AOSP kernels.
To download this kernel source do this:
Code:
mkdir ~/kernel
cd ~/kernel
git clone https://github.com/CyanogenMod/android_kernel_htc_msm8960.git -b android-msm-evita-3.0
This version also includes a number of optimizations and odd bug fixes present in the HTC version.
To build this second source, run these commands:
Code:
cd ~/kernel/android_kernel_htc_msm8960
export ARCH=arm
make elite_defconfig
Second command is saying what type of architecture we want (we are compiling for ARM processors, so we want ARM)
Third command is saying to make the default config for our device (whose hardware is codenamed "elite")
Then to build the actual kernel:
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-linux-androideabi-4.6/bin/arm-eabi-
In the command above, there is "-j#". Replace the "#" with the number of CPUs you have.
Ask me about it if you need help. That should be it! Let the build go and in a few minutes you should have a zImage file located at ~/evita-ics-..../arch/arm/boot. That is the actual kernel.
To test out the zImage (kernel), connect your device via fastboot mode and type:
Code:
fastboot boot /path/to/zImage
Combined with the ramdisk, thats what makes the boot.img file. Eventually if you want to distribute your kernel, you should use an installer that injects the zImage into the boot.img or combine the zImage with a ramdisk to make a boot.img. I can do a tutorial on that later on as well.
-----------------------------------------------------------------------------
The second option is also a bit better as it uses the 4.6 toolchain instead of GCC 4.4. HTC's source doesn't work with GCC 4.6 so it can't be used without changes that the second source has.
If you have any questions, feel free to post here, message me on twitter (@rohanXm), chat me on IRC (#HTC-One-XL) or PM me!
If this helped you, please consider hitting the donation link under my username on the left. Donations are never required but always appreciated.
Instead of downloading cm10 the readme inclided with the HTC source has directions for getting a tool chain which will compile the source.
Sent from my HTC One X using Tapatalk 2
Perfect. Now I just have to read.
Sent from my HTC One XL bumping it
rohan32 said:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jb
Click to expand...
Click to collapse
FYI, It looks like the branch name has changed. When I changed "jb" to "jellybean" the repo init command worked.
Rohan. You are one bad MF'er
Sent from my twin turbo'ed OneXL rocking rezound beats
rohan32 said:
2. You can either try to find a standalone package of the precompiled toolchain, or you are going to need to download a ROMs source. I'd recommend downloading a ROMs source since I've never found a good toolchain that worked for me. If you find one that works, post below
For now we will download CM10 since that seems like the defacto standard.
Click to expand...
Click to collapse
I downloaded the 2.20.502.7 kernel source and when I extracted it there was a file named evita_readme.txt which gave another, possibly more "official", location for downloading a toolchain:
--Please follow below command to download the official android toolchain: (arm-eabi-4.4.3)
git clone https://android.googlesource.com/platform/prebuilt
Click to expand...
Click to collapse
I just performed a build with this toolchain but got this error when I attempted to load zImage via fastboot:
c:\>fastboot flash boot zImage
sending 'boot' (5140 KB)...
OKAY [ 1.044s]
writing 'boot'...
FAILED (remote: image error! (BootMagic check fail))
finished. total time: 1.077s
Click to expand...
Click to collapse
I'm not sure if this is caused by the toolchain or if I screwed something up. Have you ever seen this error before?
EDIT: Ok I see what I did incorrectly. The zImage needs to be "Combined with the ramdisk". You wouldn't know how to perform this operation... would you?
denversc said:
I downloaded the 2.20.502.7 kernel source and when I extracted it there was a file named evita_readme.txt which gave another, possibly more "official", location for downloading a toolchain:
I just performed a build with this toolchain but got this error when I attempted to load zImage via fastboot:
I'm not sure if this is caused by the toolchain or if I screwed something up. Have you ever seen this error before?
EDIT: Ok I see what I did incorrectly. The zImage needs to be "Combined with the ramdisk". You wouldn't know how to perform this operation... would you?
Click to expand...
Click to collapse
You are trying to flash a zImage
To my knowledge, only booting zImages work on this device. For the time being just boot the zImage (use fastboot boot zImage)
I will make a tutorial on how to combine the zImage created with a ramdisk to make a boot.img when I get the chance
denversc said:
FYI, It looks like the branch name has changed. When I changed "jb" to "jellybean" the repo init command worked.
Click to expand...
Click to collapse
Oops, my bad! That was a mistake. AOKP uses -jb and CM uses -jellybean so I got them switched fixed now
Out of any device I've seen more people actually interested in helping and learning to help then any other community. I've watched noobs become less noobish.. I've watched skizz learn how to make themes. Hell I've learned 10 fold what I knew before this phone myself.
That is beautiful, and now such an informed, helpful post such as this.
Have great Sunday you guys! I think I might give this a shot!
Sent from my One X
I'll streamline this process in a bit, so that you don't need to download CM10
Edit: cleaned up post, now I'm uploading just the toolchains. Its a tar.gz archive, around 150mb. Much better than downloading the entire CM10 source
rohan32 said:
You are trying to flash a zImage. To my knowledge, only booting zImages work on this device. For the time being just boot the zImage (use fastboot boot zImage)
Click to expand...
Click to collapse
Thanks for your response, rohan. You are absolutely right: I was incorrectly attempting to flash zImage straight to the boot partition, and the error produced by flashboot was justified. I have since successfully "tested out" my compiled zImage by flashing it via "fastboot boot zImage" and it worked like a charm! I ported the modifications from sbryan's Blackout BeastMode kernel and I am now able to OC to 2106 MHz and UC to 192 MHz. It's been running solid for the past few hours at least
Of course, the kernel reverts back to the one stored in the boot partition after a reboot, and I want my shiny new kernel to "stick". I've done a bit of research on this topic and found some information about combining my zImage with a ramdisk into a "real" boot.img but have not yet been successful in creating a boot.img which does not bootloop after flashing it.
For example, I found an article on xda called Basic Kernel Kitchen for Minor Kernel Tweaking which points to a "kitchen sink" tool for creating a boot.img from a zImage and a ramdisk. My problem is that I don't know where to get or how to make a ramdisk. So I tried using the ramdisk from the boot.img of the ROM that I am currently running (CleanROM 4.5 DE) but just got into a bootloop. I've since been doing some yard work today so haven't gotten back to investigating further.
I also found another program named abootimg which can also produce a boot.img from a zImage abd a ramdisk, but when I tried it an error message about my zImage being "too big" was produced.
If it's not obvious yet, I am kind of fumbling around in the dark as compiling and deploying custom kernels is completely new to me! But this post was the most valuable resource I've come across in getting to this point. Thanks so much for writing it! I eagerly await your next article about creating the boot.img
---------- Post added at 06:05 PM ---------- Previous post was at 05:50 PM ----------
rohan32 said:
cleaned up post
Click to expand...
Click to collapse
Thanks for cleaning up the post rohan. I have a few follow-up questions/comments:
missing toolchains link -- the post says "Download the toolchains:" but there is no link to download anything... did you forget to paste the link?
official toolchain -- That's great that you uploaded the toolschains to save tonnes of bandwidth. The CM10 source was taking a VERY long time for me to grab. However, I imagine some people (like me) would prefer to get the toolchain from an "official" source. In the "evita_readme.txt" file of the kernel sources downloaded from HTC dev it instructs one to use the official sources from "git clone https://android.googlesource.com/platform/prebuilt". This is the toolchain that I used and it successfully built the zImage.
ko files -- I noticed in the ZIP file for Blackout BeastMode, in additional to installing the zImage it also puts a bunch of "ko" (kernel modules I believe) into the /system partition (eg. qce40.ko). Should I also be deploying .ko files from my build to the device?
Thanks!
denversc said:
Thanks for your response, rohan. You are absolutely right: I was incorrectly attempting to flash zImage straight to the boot partition, and the error produced by flashboot was justified. I have since successfully "tested out" my compiled zImage by flashing it via "fastboot boot zImage" and it worked like a charm! I ported the modifications from sbryan's Blackout BeastMode kernel and I am now able to OC to 2106 MHz and UC to 192 MHz. It's been running solid for the past few hours at least
Of course, the kernel reverts back to the one stored in the boot partition after a reboot, and I want my shiny new kernel to "stick". I've done a bit of research on this topic and found some information about combining my zImage with a ramdisk into a "real" boot.img but have not yet been successful in creating a boot.img which does not bootloop after flashing it.
For example, I found an article on xda called Basic Kernel Kitchen for Minor Kernel Tweaking which points to a "kitchen sink" tool for creating a boot.img from a zImage and a ramdisk. My problem is that I don't know where to get or how to make a ramdisk. So I tried using the ramdisk from the boot.img of the ROM that I am currently running (CleanROM 4.5 DE) but just got into a bootloop. I've since been doing some yard work today so haven't gotten back to investigating further.
I also found another program named abootimg which can also produce a boot.img from a zImage abd a ramdisk, but when I tried it an error message about my zImage being "too big" was produced.
If it's not obvious yet, I am kind of fumbling around in the dark as compiling and deploying custom kernels is completely new to me! But this post was the most valuable resource I've come across in getting to this point. Thanks so much for writing it! I eagerly await your next article about creating the boot.img
---------- Post added at 06:05 PM ---------- Previous post was at 05:50 PM ----------
Thanks for cleaning up the post rohan. I have a few follow-up questions/comments:
missing toolchains link -- the post says "Download the toolchains:" but there is no link to download anything... did you forget to paste the link?
official toolchain -- That's great that you uploaded the toolschains to save tonnes of bandwidth. The CM10 source was taking a VERY long time for me to grab. However, I imagine some people (like me) would prefer to get the toolchain from an "official" source. In the "evita_readme.txt" file of the kernel sources downloaded from HTC dev it instructs one to use the official sources from "git clone https://android.googlesource.com/platform/prebuilt". This is the toolchain that I used and it successfully built the zImage.
ko files -- I noticed in the ZIP file for Blackout BeastMode, in additional to installing the zImage it also puts a bunch of "ko" (kernel modules I believe) into the /system partition (eg. qce40.ko). Should I also be deploying .ko files from my build to the device?
Thanks!
Click to expand...
Click to collapse
Hey!
Sorry, set it to upload then got distracted Link posted
The reason why your boot.imgs bootloop is because there is a special ramdisk address that needs to be set when combining the ramdisk with the zImage, and most kitchens don't support this. You also need to set the address after setting the base value.
I will post a guide on how to make it a real boot.img whenever I get the chance.
I'm telling you people, Rohan is a BOSS. Most helpful dev I know.
Sent from my HTC One XL using xda app-developers app
rohan32 said:
Hey!
Sorry, set it to upload then got distracted Link posted
The reason why your boot.imgs bootloop is because there is a special ramdisk address that needs to be set when combining the ramdisk with the zImage, and most kitchens don't support this. You also need to set the address after setting the base value.
I will post a guide on how to make it a real boot.img whenever I get the chance.
Click to expand...
Click to collapse
I have the zImage thanks to your tutorial, but I want to know how to create the kernel zip, whenever you have time will be amazing if you can post a guide, I'm really looking forward to that guide, because i haven't been able to locate a guide that works
Sent from my HTC One XL using xda premium
rohan32 said:
Hi guys!
Second command is saying what type of architecture we want (we are compiling for ARM processors, so we want ARM)
Third command is saying to make the default config for our device (whose hardware is codenamed "elite")
Then to build the actual kernel:
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-linux-androideabi-4.6/bin/arm-eabi-
Click to expand...
Click to collapse
This is the correct make for "other source" kernel.
Code:
make -j# ARCH=arm CROSS_COMPILE=~/toolchain/arm-linux-androideabi-4.6/bin/[COLOR="Red"]arm-linux-androideabi-[/COLOR]
Can you make a tutorial on how to insert governors into a kernel?
Compiling problem
Hey man,
Please help me I followed your article but when I try copile with:
make -j2 ARCH=arm CROSS_COMPILE=~/toolchain/arm-eabi-4.4.3/bin/arm-eabi
I got something like this:
/home/martin/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/as: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
Thanks
UPDATE:
now its work
I went deeper and install lib32z1 with "sudo apt-get install lib32z1"... now its work
My device repositories are not available on github, But I got device tree and vendor blobs by making changes in similar device repo. That reference device's kernel's lineageos_defconfig is situated in htc msm8974 kernel repo. So how can I get lineageos_defconfig for my device, and which other my device related kernel files(.dtsi or any other) I have to push in htc msm8974 repo and get those files to make things ready for build?
Please help......

Kernels!

Hi all,
I so wish I knew how to develop because I hate to ask, I would much rather do and share. But man Asus has posted the Kernel for JB and I would love for a good tweaked OC'ed Kernel. Sooooo, please!
Sadly there are no kernel developers for the 300t at the moment. Asus had all the kernel sources on the Asus website and i guess nobody tried to build their own.
Sent from my ASUS Transformer Pad TF300T using xda app-developers app
ASUS has removed the proprietary code from the kernel, you can download it
but it wont build until you remove references to the missing code then some
of the tablet hardware does not work. so you are left to reverse engineer the
missing code from the chip spec's and manual probing of the hardware.
EDIT: NVM finely got it to build, time to see what's not working.
untermensch said:
ASUS has removed the proprietary code from the kernel, you can download it
but it wont build until you remove references to the missing code then some
of the tablet hardware does not work. so you are left to reverse engineer the
missing code from the chip spec's and manual probing of the hardware.
Click to expand...
Click to collapse
Really ?
As far as I can tell the V10.4.2.9 kernel source from Asus website builds just fine (with one minor correction).
But perhaps I'm missing your point, sorry in that case.
My biggest problem so far is to successfully flash a custom kernel on JB custom ROM (ASU-JellyBean-Hydro 1.4.6).
This leads me to my actual question:
Anyone managed to successfully flash seanzscreams' modded kernel (Asu-JellyBean-HYDROKernel.zip)
on his excellent ROM ASU-JellyBean-Hydro 1.4.6 ?
As far as I can tell the entire kernel flash process seems to finish successfully (using TWRP 2.2.2.0)
but when checking kernel version in Settings it seems to be the same (stock) version as previously,
3.1.10-00003-g6293ea6 [email protected] #1 SMP PREEMPT Thu Aug 9 15:59:38 CST 2012
Looking forward for any ideas/tips.
(I know question better belongs in the Dev forum, but as I just registered at XDA I'm not allowed to post there.)
I got it to build using, tegra3_android_defconfig was trying the cardhu_defconfig before.
builds but does not boot :-<
untermensch said:
I got it to build using, tegra3_android_defconfig was trying the cardhu_defconfig before.
builds but does not boot :-<
Click to expand...
Click to collapse
OK, this indicates at least you have managed to get your custom kernel to run/load, very interesting.
Do you flash an update.zip using CWM/TWRP or using fastboot method sending blob to boot partition (LNX) ?
Care to share more details how you get from resulting zImage from build to something flashable ?
Something like this...
1. cp arch/arm/boot/zImage kernel.gz
2. repack-bootimg.pl kernel.gz ramdisk boot.blob.lnx
3. blobpack boot.blob LNX boot.blob.lnx
?
I am using the same scripts that I use to build the CWM-Touch.blob, I just replace
the stock kernel with the on I have built, then use fastboot to install the new recovery
it just stalls.
untermensch said:
I am using the same scripts that I use to build the CWM-Touch.blob, I just replace
the stock kernel with the on I have built, then use fastboot to install the new recovery
it just stalls.
Click to expand...
Click to collapse
Thanks, but I'm a bit confused...
How does kernel and recovery (CWM-Touch.blob) relate ?
I was of the impression that a recovery image is to be flashed to the recovery partition (SOS), e.g.,
fastboot.exe -i 0x0B05 flash recovery <blob>
...while kernel+ramdisk to boot partition (LNX), e.g.,
fastboot.exe -i 0x0B05 flash boot <blob>
Are the build scripts you mention publicly available and directions of where to look if that's the case ?
a recovery is just a kernel and ramdisk with the recovery executable.
the stock LNX and SOS kernel have the same md5 sum so it does not matter
which partition I test the kernel on, it was just convenient for me to test it on
the SOS partition.
I got most of the tools to pack a SOS blob here
https://github.com/skirata/android-utils
I had to build a newer version of the blob tools
https://github.com/AndroidRoot/BlobTools
gaze57 said:
Thanks, but I'm a bit confused...
How does kernel and recovery (CWM-Touch.blob) relate ?
I was of the impression that a recovery image is to be flashed to the recovery partition (SOS), e.g.,
fastboot.exe -i 0x0B05 flash recovery <blob>
...while kernel+ramdisk to boot partition (LNX), e.g.,
fastboot.exe -i 0x0B05 flash boot <blob>
Are the build scripts you mention publicly available and directions of where to look if that's the case ?
Click to expand...
Click to collapse
Probably I can answer some of my questions myself...
Obviously both recovery and boot partition each contain a kernel+ramdisk of their own.
The difference is probably that,
- in the recovery partition the ramdisk actually contains the complete filesystem, including
the recovery application (e.g. TWRP) and everything is just meant to run from RAM.
while,
-in the boot partition there is only a minimal ramdisk enabling proper loading of the
system partition (called APP if not mistaken).
Perhaps my problem is just that kernel command line is not correct or simething similar.
Also I just discovered that fastboot.exe has a command called "boot" which actually might
be a much faster way to test custom kernels. Have to try it out...
I tried the fastboot boot commands wont even boot the stock kernel, it kinda seems like ASUS does not
want custom kernels to be run on the tablet.
Has ASUS ever wanted custom kernels running on there stuff? Anyway, the did give us a unlock for the boot loader, so looks to me like they are taking the, can't beat make sure they can return'em approach.
untermensch said:
I tried the fastboot boot commands wont even boot the stock kernel, it kinda seems like ASUS does not
want custom kernels to be run on the tablet.
Click to expand...
Click to collapse
gaze57 said:
Really ?
As far as I can tell the V10.4.2.9 kernel source from Asus website builds just fine (with one minor correction).
But perhaps I'm missing your point, sorry in that case.
My biggest problem so far is to successfully flash a custom kernel on JB custom ROM (ASU-JellyBean-Hydro 1.4.6).
This leads me to my actual question:
Anyone managed to successfully flash seanzscreams' modded kernel (Asu-JellyBean-HYDROKernel.zip)
on his excellent ROM ASU-JellyBean-Hydro 1.4.6 ?
As far as I can tell the entire kernel flash process seems to finish successfully (using TWRP 2.2.2.0)
but when checking kernel version in Settings it seems to be the same (stock) version as previously,
3.1.10-00003-g6293ea6 [email protected] #1 SMP PREEMPT Thu Aug 9 15:59:38 CST 2012
Looking forward for any ideas/tips.
(I know question better belongs in the Dev forum, but as I just registered at XDA I'm not allowed to post there.)
Click to expand...
Click to collapse
I unpacked the Asu-JellyBean-HYDROKernel.zip kernel looks like the stock kernel, any changes
have probably been made to the initrd so the kernel version would not change.
Code:
43538fd617c95623ce71fa39897f4a94 zImage
43538fd617c95623ce71fa39897f4a94 ../boot.blob.lnx-kernel.gz
zImage is the stock kernel I use for the touch recovery and boot.blob.lnx-kernel.gz is
the unpacked Asu-JellyBean-HYDROKernel.zip kernel the md5 sums are the same.
Just for ****s and giggles, I unpacked the stock kernel zImage found the string
Code:
[email protected]
and changed it to
Code:
[email protected]
repacked to a zImage with a md5 sum of
Code:
727525cb198a130dfd532cfbde713d29
made a recovery and flashed via fastboot, and it booted fine. This proves that
the new bootloader is not checking the signature of the kernel against a stored
value so custom kernels are possible and I'm just not smart enough to build
a working kernel form the ASUS source.
That's funny, someone out there is, Man just an OC'ed Kernel would be awesome. Since EzOverclock doesn't work with JB you I can really tell the difference in speed on JB.
untermensch said:
Just for ****s and giggles, I unpacked the stock kernel zImage found the string
Code:
[email protected]
and changed it to
Code:
[email protected]
repacked to a zImage with a md5 sum of
Code:
727525cb198a130dfd532cfbde713d29
made a recovery and flashed via fastboot, and it booted fine. This proves that
the new bootloader is not checking the signature of the kernel against a stored
value so custom kernels are possible and I'm just not smart enough to build
a working kernel form the ASUS source.
Click to expand...
Click to collapse
I pulled the config from my tf300 and and managed to build the zImage
I get warning notices about the one of the mpu sensors
if you get it to flash that might be something that may not work
as for myself, I'll be looking into some UMS features, we'll see how far I get
it appears all the needed code is already included in the kernel download from asus,
just need to configure it
Seems I finally managed to build and flash my own JB kernel for the TF300T ! :good:
This will just be a quick and dirty wrap-up of what I did as my spare time is somewhat limited.
Hope to be able to make it more structured and with proper credits in the near future.
Anyone feel free to compile a better structured how-to with correct references and credits.
Quick credits/thanks:
seanzscreams
untermensch
Stuff needed:
- Asus kernel source (10_4_2_9_kernel.zip)
- Android NDK R8B (I'm using Linux version, android-ndk-r8b-linux-x86.tar.bz2)
- Asu-JellyBean-HYDROKernel.zip (to get a proper update package structure with update binary/script and META-INF directory)
- signing-tools.zip, BlobTools and re/unpack-bootimg.pl (can't remember where I found these will have to update post later...)
Preparations:
- Unpack kernel source, e.g. to $HOME/TF300/stock_kernel
- Unpack Android NDK, e.g. to $HOME/android-ndk-r8b
- Unzip Asu-JellyBean-HYDROKernel.zip, e.g. to $HOME/my_kernel
- Setup/install BlobTools and the other scripts
Step-by-step instructions:
1. Build kernel (zImage)
a) Fix minor issue in kernel source
> cd $HOME/TF300/stock_kernel
Change line 11 in file drivers/ril/ril.c
from,
#include <../../arch/arm/mach-tegra/include/mach/board-cardhu-misc.h>
to,
#include "../../arch/arm/mach-tegra/include/mach/board-cardhu-misc.h"
b) Setup build environment for cross compilation
> export PATH=$HOME/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin:$PATH
> export ARCH=arm
> export CROSS_COMPILE=arm-linux-androideabi-
c) Fetch /proc/config.gz from your TF300 and copy/gunzip to $HOME/TF300/stock_kernel/.config
d) Build
> make
If everything went fine you should have a new kernel under,
$HOME/TF300/stock_kernel/arch/arm/boot/zImage
2. Repack kernel
> cd $HOME/my_kernel
a) Create a 28 byte file using a hex editor for the signblob header (I named the file signblob_magic)
It should have the following contents when checked with hexdump:
> hexdump -C signblob_magic
00000000 2d 53 49 47 4e 45 44 2d 42 59 2d 53 49 47 4e 42 |-SIGNED-BY-SIGNB|
00000010 4c 4f 42 2d 00 00 00 00 00 00 00 00 |LOB-........|
0000001c
b) Unpack the boot.blob from Asu-JellyBean-HYDROKernel.zip (unzipped earlier under Preparations)
This step is just to get a proper blob directory structure and the initramfs.
> blobunpack boot.blob
> unpack-bootimg.pl boot.blob.lnx
c) Pack new kernel
Might as well post the script I made to perform this task, check comments.
#!/bin/sh
SRC_HOME=$HOME/TF300/stock_kernel
KERNEL_NAME=my_kernel
# replace kernel
cp ${SRC_HOME}/arch/arm/boot/zImage boot.blob.lnx-kernel.gz
# repack
repack-bootimg.pl boot.blob.lnx-kernel.gz boot.blob.lnx-ramdisk out.blob.lnx
blobpack out.blob LNX out.blob.lnx
# add signblob header
cat signblob_magic out.blob > boot.blob
# create zip package
zip -9 -r ${KERNEL_NAME}.zip boot.blob META-INF/
# Sign zip package using SignApk
java -Xmx1024m -jar signapk.jar -w testkey.x509.pem testkey.pk8 ${KERNEL_NAME}.zip ${KERNEL_NAME}-signed.zip
3. Flash kernel
From previous steps you should now have a signed kernel called,
my_kernel-signed.zip
Flash it using TWRP and reboot.
If flash was OK a blue status bar should appear during boot and then your TF300 will reboot again.
Confirm you have a custom kernel by checking Kernel-version under Settings once system has completed the bootup.
Confirmed! I have built a working kernel from ASUS source not sure if it was the
NDK or pulling the config from the device.
good work gaze57!
Code:
~ # uname -a
Linux localhost 3.1.10 #2 SMP PREEMPT Sat Sep 15 16:49:52 PDT 2012 armv7l GNU/Linux
link to my recovery build setup with source built kernel
http://www.mediafire.com/?hnstxi9so5970y0
EDIT:
it was the config that was causing my previous attempts to fail, I have an Android build setup
with this as the path
Code:
/home/untermensch/Android/android-4.1.1_r4/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/
then these exports
Code:
export ARCH=arm
export SUBARCH=armv7-a-neon
export CROSS_COMPILE=arm-eabi-
then pull the config from the tablet and got a working kernel.
EDIT:
I opened a source repository with the fix to ril.c and the device config saved to arch/arm/configs/tf300t_defconfig
https://github.com/untermensch/tf300t_kernel
Linux kernel
Congratulations guys!
Thanks for sharing your work.
Since you've been keeping your hands busy with the kernel for some time now, I was wondering if you have ever tried to build a Linux system (kernel + working environment) for the TF300, and whether you know it's possible or not.
I've downloaded the kernel from Asus and trying to get tegra3_defconfig to build (currently having problems with "make[1]: *** [arch/arm/mach-tegra/board-cardhu-sensors.o] Error 1". Am I using the right defconfig? Is it possible to build an Android kernel but have it boot a GNU/Linux environment.
I appreciate your help
EDIT: Regarding the error message, it was a bad reference. The file was expected to be in another folder. I fixed the reference and it went on building.
Congratulations Could you try to enable to overclock?

[TOOL][Linux] Split kernel with appended dtb into standalone kernel and dtbs

What's the tool for:
Almost all Qualcomm device is using linux device tree, and there're 2 ways to handle to kernel:
Use a "dt.img" to pack dtbs and attached it to boot.img. When booting, lk will unpack it and handle dtbs to kernel.(Most devices in this way)
Directly append dtbs on kernel image. When booting, lk will split them off and handle to kernel.(Nexus devices in this way since Nexus 5. Qualcomm switched to this way in every M branch, so generally you won't see a dt.img after unpacking a boot.img from official M release)
This tool is implemented to split a kernel image with appended dtbs into separated kernel and dtb files.
How it works:
Every dtb is started with 0xd00dfeed(defined in scripts/dtc/libfdt/fdt.h in kernel source), and a kernel image with appended dtbs is generated with command similar to the following one:
Code:
echo Image a.dtb b.dtb > Image-dtb
My program will search 0xd00dfeed in the provided kernel image, and dump "Image", "a.dtb", "b.dtb" in "Image-dtb" into sepreated files. After that, you're free to use dtc to decompile the .dtb into .dts
Download & Source:
https://github.com/dianlujitao/split-appended-dtb
XDA:DevDB Information
split-appended-dtb, Tool/Utility for all devices (see above for details)
Contributors
dianlujitao
Source Code: https://github.com/dianlujitao/split-appended-dtb
Version Information
Status: Stable
Created 2016-03-22
Last Updated 2016-03-22
@dianlujitao how to add dtb files back to zImage? Thank you
I have 13 dtb files.. converted them to dts, edited and converted back to dtb...
ingbrzy said:
@dianlujitao how to add dtb files back to zImage? Thank you
I have 13 dtb files.. converted them to dts, edited and converted back to dtb...
Click to expand...
Click to collapse
cat xxx.dtb >> zImage
dianlujitao said:
cat xxx.dtb >> zImage
Click to expand...
Click to collapse
Thanks it works!
dianlujitao said:
cat xxx.dtb >> zImage
Click to expand...
Click to collapse
By using this command, I added a new dtb to my zimage.
There is some way to replace it that already exists in the zimage and not to add a new dtb file inside the zimage.
Thank you very much
kenet said:
By using this command, I added a new dtb to my zimage.
There is some way to replace it that already exists in the zimage and not to add a new dtb file inside the zimage.
Thank you very much
Click to expand...
Click to collapse
this is the files' layout
| ++++++++++++ Image-dtb ++++++++++++++ |
| ______ zImage ______ | _ a.dtb _ | _ b.dtb _ |
Image-dtb contains zImage followed by dtbs
zImage itself doesn't contain device tree blobs, and that command will append the latter to it.

[v1.2] Linux for Samsung Galaxy J120F

This thread is about Linux port for J120F. Test build is currently in beta state. But if you're a Linux user you can try it.
Status:
Display and touchscreen work
Hardware and software keyboards work
Wi-Fi works (and Firefox onboard )
USB works as OTG or serial gadget with a console (115200n8). UART JIG also works
Bluetooth. You can run hciattach (@115200) to get BT device but most tools don't see it
Known issues:
Touchscreen won't work if phone was started by attaching USB or charger. That's because Android can't start this way (phone shows battery status and goes off).
For same time after boot you can't click anything but cursor moves. Just wait ~30 sec.
This will be fixed in v1.3. Or you can execute:
Code:
rpm -ev --nodeps xinput-calibrator
Fixed:
Onscreen keyboard doesn't work. Sad but true
"Connect to Wi-Fi" button is out of screen. It's next to "DHCP" combobox in TAB order.
Display goes to sleep and can't be turned back on. You can restart X from SSH or USB console to turn it on again. (No timeout - no bug )
How to install:
Create 3 partitions on SD card. 1st is FAT for your Android data. 2nd for Link2SD (make it tiny if not needed). 3rd is ext2 for Linux (500 MB should be enough for now).
Extract rootfs.tar.xz contents to 3rd partition. It should be done as root and from terminal. GUI tools aren't good for this.
Flash kernel (boot.img) with heimdall. It can work as recovery too. In this case you will get dualboot.
Milestones:
1.0 Make it boot
1.1 Bring up major hardware
1.2 Make ROM easier for testing and building
1.3 Organize included software
My next major tasks:
Improve BSP. Make image recipe.
Make toggle screen on/off feature by power button.
Improve onscreen keyboard layout. Make keys bigger.
Done tasks:
Sort out all the patches I've made to FS. Make a BSP (OpenEmbedded machine layer).
Find a problem with USB serial gadget and make it work as console. For now I use UART JIG but only few people have such hardware.
Get Wi-Fi to work. Smartphone is not a smartphone without internet connectivity.
Make connman-gnome window usable with such small display. Currently you need to do blind TAB to connect to Wi-Fi.
Find a problem with on screen keyboard. The only way to input text now is USB keyboard over OTG.
Improve BSP. Integrate FS patches into it. Fix kernel so it can be built inside OE.
Fix screen timeout bug. (Timeout disabled so far)
Photos:
{
"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"
}
Link to my ROMs folder on MEGA.
Kernel source on GitHub.
OpenEmbedded Layer (BSP) source on GitHub.
Wi-Fi works!
dmesg from Android helped me to start Wi-Fi. To finish initialization you need to run
Code:
cat /proc/deferred_initcalls
Seriously!
Good news!
SSH is working over Wi-Fi.
USB gadget works after all!
To activate it do:
Code:
echo connect > /sys/class/udc/13580000.usb/soft_connect
Now I will try to make a build with all those things activated on boot
Version 1.1 released. It's MUCH more user-friendly but you still need some skills to install and use it.
It's possible to do this on Galaxy J120H?
jlfedmmc456 said:
It's possible to do this on Galaxy J120H?
Click to expand...
Click to collapse
OS image should start on J120H but you need a special kernel. So there are two answers on two kinds of questions:
1) No. This is impossible to [just] install kernel and OS from J120F to J120H because of different hardware.
2) Yes. This is possible to port this project to J120H. It's easy if you're ROM maker.
Good job. Thank you for this ROM.
Set up both keyboards.
To activate software one:
/etc/X11/Xsession.d/80matchboxkeyboard.sh
Code:
#!/bin/sh
. /etc/formfactor/config
CMD="matchbox-keyboard -d"
if [ "$CMD" ]; then
# Delay to make sure the window manager is active
# by waiting for the desktop to say its finished loading
dbus-wait org.matchbox_project.desktop Loaded && $CMD &
fi
To activate hardware one you need new kernel. It is on MEGA already (linux_1_2_boot.img).
Buttons:
RECENT -> Context menu
HOME -> My Computer
BACK -> Esc
Power and Vol keys are Power and Vol keys
To make HOME work as "show desktop" button add:
Code:
XF86MyComputer=desktop
to kbdconfig file.
That's all for now
Fixed Samsung kernel. Now it builds inside OE.
IIRC bitbake should be able now to build OS image without any "tricks".
BSP v1.2
Made proto BSP in a form of diffs. Changes are listed in fs_files.diff file. New files are in files folder. Patches are in diffs folder. New packages are in rpms folder.
Hey really great work; I have created 2 forks of your project for J120A here in the states... I haven't used bitbake before. I went and installed it, but not sure how to use it with the 2 projects you've uploaded. I tried "bitbake J120A" and "bitbake world" but that doesn't seem to be the thing to do. Can't seem to build the kernel manually with "make" either. Could you tell me what commands/config I need to do with bitbake to get this working? Thanks again for your hard work!
puargs said:
Hey really great work; I have created 2 forks of your project for J120A here in the states... I haven't used bitbake before. I went and installed it, but not sure how to use it with the 2 projects you've uploaded. I tried "bitbake J120A" and "bitbake world" but that doesn't seem to be the thing to do. Can't seem to build the kernel manually with "make" either. Could you tell me what commands/config I need to do with bitbake to get this working? Thanks again for your hard work!
Click to expand...
Click to collapse
You don't need bitbake. You need OpenEmbedded.
https://www.openembedded.org/wiki/Getting_started
https://www.openembedded.org/wiki/OE-Core_Standalone_Setup
Then add some layers. I have:
meta (oe-core)
meta-oe
meta-multimedia
meta-networking
meta-filesystems
meta-gnome
meta-initramfs
meta-perl
meta-python
meta-webserver
meta-xfce
meta-browser
meta-j120f
Setup a MACHINE to build for.
Code:
MACHINE ?= "j120f"
And allow non-free licenses
Code:
LICENSE_FLAGS_WHITELIST += "commercial"
Now you can try to build "core-image-sato". OE needs huge amount of free space and time to build! (~100GB)
You can also build packages: bitbake firefox
I doubt that F kernel will run on A version. So you need to port all my patches to the Samsung kernel source for J120A. It shouldn't be hard.
Then diff my linux defconfig with original one (for j120f) and add those changes to your (j120a) defconfig.
After that unpack stock boot.img for your device. And pack your zImage with original DT file.
This is how I do this:
Code:
android_img_repack_tools/mkbootimg --kernel zImage --ramdisk NONE --dt boot.img-dt --base 10000000 --pagesize 2048 --board SRPOI21A000RU -o new_boot.img
Now you can flash new_boot.img with heimdall
Code:
heimdall flash --BOOT new_boot.img
I think you should start with kernel. Patch, build, pack img and flash it. (Don't forget to unlock bootloader first!) Then you can install my OS build on SD card (replace /etc/wifi and /lib/firmware with your files). I hope v1.2 will be released already. And if it works you can start to build your own OS image
This is really great information, thank you so much for the assistance! I have gone through and started work on what you mention, but I realized I'm not sure which Kernel you originally downloaded for your device. There are a lot available for the J120F:
https://imgur.com/a/OeI9u
Do you remember which one you started with? It will make filtering down the diff a lot easier.
-W_O_L_F- said:
You don't need bitbake. You need OpenEmbedded.
https://www.openembedded.org/wiki/Getting_started
https://www.openembedded.org/wiki/OE-Core_Standalone_Setup
Then add some layers. I have:
meta (oe-core)
meta-oe
meta-multimedia
meta-networking
meta-filesystems
meta-gnome
meta-initramfs
meta-perl
meta-python
meta-webserver
meta-xfce
meta-browser
meta-j120f
Setup a MACHINE to build for.
Code:
MACHINE ?= "j120f"
And allow non-free licenses
Code:
LICENSE_FLAGS_WHITELIST += "commercial"
Now you can try to build "core-image-sato". OE needs huge amount of free space and time to build! (~100GB)
You can also build packages: bitbake firefox
I doubt that F kernel will run on A version. So you need to port all my patches to the Samsung kernel source for J120A. It shouldn't be hard.
Then diff my linux defconfig with original one (for j120f) and add those changes to your (j120a) defconfig.
After that unpack stock boot.img for your device. And pack your zImage with original DT file.
This is how I do this:
Code:
android_img_repack_tools/mkbootimg --kernel zImage --ramdisk NONE --dt boot.img-dt --base 10000000 --pagesize 2048 --board SRPOI21A000RU -o new_boot.img
Now you can flash new_boot.img with heimdall
Code:
heimdall flash --BOOT new_boot.img
I think you should start with kernel. Patch, build, pack img and flash it. (Don't forget to unlock bootloader first!) Then you can install my OS build on SD card (replace /etc/wifi and /lib/firmware with your files). I hope v1.2 will be released already. And if it works you can start to build your own OS image
Click to expand...
Click to collapse
puargs said:
This is really great information, thank you so much for the assistance! I have gone through and started work on what you mention, but I realized I'm not sure which Kernel you originally downloaded for your device. There are a lot available for the J120F:
https://imgur.com/a/OeI9u
Do you remember which one you started with? It will make filtering down the diff a lot easier.
Click to expand...
Click to collapse
You don't need to know it. Just take a look at commits: https://github.com/LONELY-WOLF/kernel-j120f/commits/master
Version 1.2 ready
ROM made more user friendly. Most patches are integrated in BSP. It's far more easier to test and build ROM now.
Fixes not included in 1.2:
xinput-calibrator should be removed as it's useless for modern touchscreens
keyboard layout was reworked but I still need to make keys bigger
removed "Ethernet" option from connman-gnome. This fix is available in proto_BSP_1.2 archive
Version 1.3 will be about included packages.
I want to delete and install some packages. Busybox will be replaced first!
BSP will get image recipe.
BSP builds without errors! My Ryzen 1700 (OC to 3800MHz) builds OS image in ~1 hour.
-W_O_L_F- thanks for leading work on a custom kernel and Linux userspace on SM-J120x. Great to see the improvements you've made on top of the vendor kernel to make it easier for developers to test (e.g. packaged boot.img, and userspace).
puargs: I'd also like to see a version for SM-J120A, however I expect we will be blocked running custom RECOVERY as the SM-J120A ships with a locked bootloader. So far I've been unable to find any bootloader unlock methods for SM-J120A.
Tried flashing linux_1_2_boot.img to RECOVERY with heimdall in "download mode" as a test, with no success.
The download mode recognizes an unexpected RECOVERY image, and reports "SECURE CHECK FAIL : (RECOVERY)" on the device.
Have you had any success? Perhaps you found a method that works?
Wow, this is some serious development going on for the SM-J120F! I'm surprised to see such projects for the Exynos platform.
Keep up the good work and may your project become successful!
Project moved to new hardware: Galaxy Note9.
https://forum.xda-developers.com/ga...linux-porting-native-linux-to-galaxy-t3936077

[GUIDE] How to Build OrangeFox Recovery on a fox_6.0 (android-6.0) Build System [RECOVERY][MANIFEST]

OrangeFox Recovery Project
{
"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"
}
​So, You Want to Build the Best Recovery for an Old Device? Well, It's Possible Now!
So, Let's Get Started! :
Pre Requisites:​
Atlest Basic Knowledge of Linux Commands.
An android-6.0 based TWRP (Or OrangeFox, PBRP on any Recovery's) Device Tree.
A Debian Based Linux Distro. ( Others may work too, But they have a different Build Environment Setup Steps)
Notes:​
This is not an official Manifest.
This Manifest uses the Official twrp-6.0 source, with a Patched Build System for OrangeFox, and the OFFICIAL OrangeFox bootable/recovery and vendor/recovery trees.
The Build Environment Setup Guide Below, is the same till Step Number 4 (except for apt). For Other Linux Distros, Read This.
How to Build​
Set Up the Build Environment:​
Bash:
cd ~
sudo apt install git rsync aria2 -y
git clone https://github.com/akhilnarang/scripts.git ~/scripts
cd ~/scripts
sudo bash setup/android_build_env.sh
Sync the fox_6.0 Source:​
Bash:
mkdir ~/OrangeFox_6
cd ~/OrangeFox_6
repo init -u https://github.com/OrangeFoxRecovery/fox-6.0_manifest.git -b fox_6.0
repo sync -j$(nproc --all) --force-sync
Tip: Use repo init --depth=1 -u https://github.com/OrangeFoxRecovery/fox-6.0_manifest.git -b fox_6.0 to initialize a Shallow Clone to save Disk Space.
Place trees (required) and kernel ( if required ):​ For Example: (Yours may be Different)
Bash:
cd ~/OrangeFox_6
git clone https://github.com/OrangeFoxRecovery/device_samsung_fortuna3g.git device/samsung/fortuna3g
Add Configs (Build Vars):​See https://wiki.orangefox.tech/en/dev/building#configs Information About this.
Available Build Vars For fox_6.0: https://gitlab.com/OrangeFox/vendor/recovery/-/blob/master/orangefox_build_vars.txt
Build It!​
Bash:
cd ~/OrangeFox_6
. build/envsetup.sh
export ALLOW_MISSING_DEPENDENCIES=true
export FOX_USE_TWRP_RECOVERY_IMAGE_BUILDER=1
export LC_ALL="C"
export OF_LEGACY_SHAR512=1
lunch omni_<device>-eng
mka recoveryimage
Notes:​
If you are getting errors like "Keymaster2" during Compilation, run export OF_DISABLE_KEYMASTER2=1 and then Build Again.
Take Your OrangeFox Build:​ Find your Build:
Bash:
cd ~/OrangeFox_6
ls out/target/product/*/
Enjoy!​Now enjoy the Latest OrangeFox Recovery on an old device too!
​Credits:​
TeamWin - for the TWRP Manifest
The OrangeFox Team - for the Amazing Recovery!
@DarthJabba9 - For the fox_6.0 Build System Patch File.
@Sushrut1101 - For this fox_6.0 Manifest.
Useful Links:​
Manifest URL:https://github.com/OrangeFoxRecovery/fox-6.0_manifest.git
Patched Build System URL:
GitHub - OrangeFoxRecovery/fox-6.0_build
Contribute to OrangeFoxRecovery/fox-6.0_build development by creating an account on GitHub.
github.com
Our GitHub Url:https://github.com/OrangeFoxRecovery
Building Support Groups: Official: https://t.me/OrangeFoxBuilding or Unofficial: https://t.me/AOSPBuilding
Reserved
Reserved
nice job built it now for old device with still get latest LineageOS 14.1 patches
seluce_ said:
nice job built it now for old device with still get latest LineageOS 14.1 patches
Click to expand...
Click to collapse
Enjoy!
Was not able to start the mka recoveryimage because it went into an error. Switched to default phtyton 2 with this guide: https://linuxconfig.org/ubuntu-20-04-python-version-switch-manager
actually im not sure if i need to use phyton 2
but now i get the error after i start it with "mka recoveryimage"
bootable/recovery/crypto/fde/cryptfs.cpp:79:33: fatal error: hardware/keymaster2.h: No such file or directory
#include <hardware/keymaster2.h>
(latest twrp build works without issues)
seluce_ said:
Was not able to start the mka recoveryimage because it went into an error. Switched to default phtyton 2 with this guide: https://linuxconfig.org/ubuntu-20-04-python-version-switch-manager
actually im not sure if i need to use phyton 2
but now i get the error after i start it with "mka recoveryimage"
bootable/recovery/crypto/fde/cryptfs.cpp:79:33: fatal error: hardware/keymaster2.h: No such file or directory
#include <hardware/keymaster2.h>
(latest twrp build works without issues)
Click to expand...
Click to collapse
You Need python2 for OrangeFox.
seluce_ said:
Was not able to start the mka recoveryimage because it went into an error. Switched to default phtyton 2 with this guide: https://linuxconfig.org/ubuntu-20-04-python-version-switch-manager
actually im not sure if i need to use phyton 2
but now i get the error after i start it with "mka recoveryimage"
bootable/recovery/crypto/fde/cryptfs.cpp:79:33: fatal error: hardware/keymaster2.h: No such file or directory
#include <hardware/keymaster2.h>
(latest twrp build works without issues)
Click to expand...
Click to collapse
Read this Fix:
Sushrut1101 said:
If you are getting errors like "Keymaster2" during Compilation, run export OF_DISABLE_KEYMASTER2=1 and then Build Again.
Click to expand...
Click to collapse
I already wrote the fix in the guide!
worked now without issues after: export OF_DISABLE_KEYMASTER2=1
Maybe i have to read carefully next time Thanks for your help!
Edit: added some screenshots. works fine with Cubot Note S (MT6580, based on Kernel 3.18.19)
seluce_ said:
worked now without issues after export OF_DISABLE_KEYMASTER2=1
Maybe i have to read carefully next time Thanks for your help!
Click to expand...
Click to collapse
Np!
Just Enjoy it!
stuck at splash screen | R11
Device : grandpplte + 3.18.53
SHRP 3.1 works, but orangefox R11 not
Do you have any solution for this problem?, i cant take logcat
Long266 said:
stuck at splash screen | R11
Device : grandpplte + 3.18.53
SHRP 3.1 works, but orangefox R11 not
Do you have any solution for this problem?, i cant take logcat
Click to expand...
Click to collapse
Encrypted ?
Sushrut1101 said:
Encrypted ?
Click to expand...
Click to collapse
unencrypted
Long266 said:
unencrypted
Click to expand...
Click to collapse
That's Really Weird.
Did you Disable Keymaster2 ?
Long266 said:
unencrypted
Click to expand...
Click to collapse
Also, Send your device tree
Sushrut1101 said:
That's Really Weird.
Did you Disable Keymaster2 ?
Click to expand...
Click to collapse
yes, i disabled it and got compiled, but it doesnt boot
Sushrut1101 said:
Also, Send your device tree
Click to expand...
Click to collapse
here it is
GitHub - almondnguyen/twrp_device_samsung_grandpplte: TWRP Tree for Galaxy J2 Prime/Grand Prime+
TWRP Tree for Galaxy J2 Prime/Grand Prime+. Contribute to almondnguyen/twrp_device_samsung_grandpplte development by creating an account on GitHub.
github.com
I got it from one of my friends
TWRP 3.5.2 | PBRP 3.1.0 | SHRP 3.1 all are work, except OFox R11
Long266 said:
here it is
GitHub - almondnguyen/twrp_device_samsung_grandpplte: TWRP Tree for Galaxy J2 Prime/Grand Prime+
TWRP Tree for Galaxy J2 Prime/Grand Prime+. Contribute to almondnguyen/twrp_device_samsung_grandpplte development by creating an account on GitHub.
github.com
I got it from one of my friends
TWRP 3.5.2 | PBRP 3.1.0 | SHRP 3.1 all are work, except OFox R11
Click to expand...
Click to collapse
If Possible, Can you Please Contact me in Telegram ?
Sushrut1101 said:
If Possible, Can you Please Contact me in Telegram ?
Click to expand...
Click to collapse
Yes, thanks
My username : @LongN266
error when building for a3xelte:
Code:
target C++: recovery <= bootable/recovery/twrp-functions.cpp
In file included from bootable/recovery/twrp-functions.cpp:49:
bootable/recovery/abx-functions.hpp:229:17: error: use of undeclared identifier 'EVP_EncodeBlock'
auto got = EVP_EncodeBlock(
^
target C++: recovery <= bootable/recovery/twrpDigestDriver.cpp
1 error generated.
make: *** [/home/runner/work/Action-Recovery-Builder/Action-Recovery-Builder/workspace/out/target/product/a3xelte/obj/EXECUTABLES/recovery_intermediates/twrp-functions.o] Error 1
build/core/binary.mk:706: recipe for target '/home/runner/work/Action-Recovery-Builder/Action-Recovery-Builder/workspace/out/target/product/a3xelte/obj/EXECUTABLES/recovery_intermediates/twrp-functions.o' failed
make: *** Waiting for unfinished jobs....

Categories

Resources