So I've been trying to compile a kernel for the 6P, with no luck making the device booting, so i'm looking for help here.
I've been looking for a guie specific for the Nexus 6P, but couldn't find any so i gathered what i could and knew from the past.
i'm using export ARCH=arm64 and export SUBARCH=arm64 along with the PATH and CROSS_COMPILE variables.
http://softwarebakery.com/building-the-android-kernel-on-linux
The link above is what i relied on for creating a boot.img
I have downloaded the kernel source, and the aarch64 toolchain 4.9 from google.
when the compilation is done i'll have Image, Image.gz & Image.gz-dtb in kernel_src/arch/arm64/boot/.
Then i'll use abootimg to create a boot.img using the guide posted above from the Image.gz-dtb & the stock mmb29m initrd.img & bootimg.cfg (with the bootsize= line deleted) and use fastboot boot testboot.img.
after the device downloads the boot.img it will boot in twrp instead.
Is there anything specific i'm missing or doing wrong?
Hi there! Did you resolve your problem? I had the same on HTC one m9 after compiling.
Related
Seems to up in the market now, just wondering if it's good for the DHD, there are now 2 HTC desires in the 'choose your phone'
nope this won't work, its only out for the g2. The desire hd shouldn't be too far behind though so just hold off.
teihoata said:
nope this won't work, its only out for the g2. The desire hd shouldn't be too far behind though so just hold off.
Click to expand...
Click to collapse
ill compile it+ the kernel when i get home
Feel free to have a go yourself: http://www.koushikdutta.com/2010/10/porting-clockwork-recovery-to-new.html
This guide will assume you have some familiarity with doing an Android Build.
First, let's check out the CyanogenMod tree. The CyanogenMod repository contains Clockwork Recovery, which is part of a full Android build.
repo init -u git://github.com/CyanogenMod/android.git -b froyo
repo sync
make -j4 otatools
Now, use dump_image or dd to dump your recovery or boot image from a running phone and copy it to your computer somewhere.
dump_image boot boot.img
Note that dump_image only works on phones using MTD. You will need to use dd to dump mmc partitions.
To build Android from source for a new device, you need to set up a board config and its makefiles. This is generally a long and tedious process. Luckily, if you are only building recovery, it is a lot easier. From the root of your Android source directory (assuming you've run envsetup.sh), run the following (substituting names appropriately):
build/tools/device/mkvendor.sh device_manufacturer_name device_name /your/path/to/the/boot.img
You will receive the confirmation "Done!" if everything worked.
The mkvendor.sh script will also have created the following directory in your Android source tree:
manufacturer_name/device_name
Now, type the following:
lunch generic_device_name-eng
This will set the build system up to build for your new device.
Open up the directory in a file explorer or IDE. You should have the following files: AndroidBoard.mk, AndroidProducts.mk, BoardConfig.mk, device_.mk, kernel, system.prop, and vendorsetup.sh.The two files you are interested in are BoardConfig.mk and kernel. The kernel in that directory is the stock one that was extracted from the boot.img that was provided earlier. BoardConfig.mk will need to be tweaked to support ext mounts and their mount points.
For example, if your /data mount is ext and the device is /dev/block/mmcblk0p2, you would need the following lines added in your BoardConfig.mk:
BOARD_DATA_DEVICE := /dev/block/mmcblk0p2
BOARD_DATA_FILESYSTEM := auto
Once the BoardConfig.mk has been properly setup, you can build the recovery using:
make -j4 recoveryimage
Your recovery can then be found at $OUT/recovery.img.
If you are in need of building a fakeflash recovery, you will need to run the following to create the update.zip that hot replaces the recovery:
. build/tools/device/mkrecoveryzip.sh
Once this is done, build, and tested, notify me, "koush", on Github and I can build official releases and add ROM Manager support!
Tip: Run "make clobber" between builds if you change the BoardConfig.mk, or the change will not get picked up.
Hi folks,
I'm trying to compile Android from source. I'm doing this just for learning purposes. I'm trying to compile Android 2.1. I read here and did whatever it said. Now my first question is:
When initializing Repo client, what I should enter:
repo init -u git://android.git.kernel.org/platform/manifest.git
or
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair​
After doing Repo sync, I need to extract LG drivers into the main directory. After that I compiled the Kernel and obtained the zImage file. Then when I started building the system, I got too many warnings. Anyhow the build was completed. But it wasn't working on the emulator itself.
I asked Joe.stone for help. He said that I need to create the device config files in the /device/lg/swift folder. Neither I found the device folder, nor I know how to create the device config files. I'm a damn noob when it comes to such complex things.
Please help me out. If I'm able to create a successful build, the I promise I'll write a tutorial for you all. Help needed!!
tejasdj12 said:
Hi folks,
I'm trying to compile Android from source. I'm doing this just for learning purposes. I'm trying to compile Android 2.1. I read here and did whatever it said. Now my first question is:
When initializing Repo client, what I should enter:
repo init -u git://android.git.kernel.org/platform/manifest.git
or
repo init -u git://android.git.kernel.org/platform/manifest.git -b eclair​
After doing Repo sync, I need to extract LG drivers into the main directory. After that I compiled the Kernel and obtained the zImage file. Then when I started building the system, I got too many warnings. Anyhow the build was completed. But it wasn't working on the emulator itself.
I asked Joe.stone for help. He said that I need to create the device config files in the /device/lg/swift folder. Neither I found the device folder, nor I know how to create the device config files. I'm a damn noob when it comes to such complex things.
Please help me out. If I'm able to create a successful build, the I promise I'll write a tutorial for you all. Help needed!!
Click to expand...
Click to collapse
I don't know how to create the files,but you can use the lg gt540 source uploaded by LG.
Well, "device" folder will not work with eclair source, it using "vendor" folder to make a device - specific build. Also, zImage from builded kernel is not the only thing you need, bcos you need also ramdisk image.
Thanks for your replies guys,
I compiled the system successfully (Eclair 2.1) and got it running perfectly on emulator. But, I have sent my phone to the LG Service coz my computer restarted during the KDZ process. I'll be uploading the system.img file tonight. I just need some guys to test it out with the Quarx Kernel.
@pebe94:
I would rather extract any prebuilt boot.img and replace the zImage file. Is that OK?
@up
Yes. If you using extractor from bt.zip, you have to move (or delete) boot.img-kernel from extracted boot, and paste zImage and rename to boot.img-kernel. After that you will able to build boot.img
Hi, I'm trying to compile the Nexus 4 kernel from the sources following the android.developers tutorial:
http://source.android.com/source/building-kernels.html
And also this guides:
[Tutorial] Building Your First Kernel: http://forum.xda-developers.com/showthread.php?t=1748297
Getting Started: Building a Kernel from source: http://xda-university.com/as-a-developer/getting-started-building-a-kernel-from-source
My goal is to learn to compile from AOSP, but I'm failing hard. After doing this step:
Code:
$ git clone https://android.googlesource.com/device/lge/mako-kernel
And after downloading the sources:
Code:
$ git clone https://android.googlesource.com/kernel/msm.git
All I get is a "kernel" file (without extension) and a folder .git folder. Inside that folder there aren't the files I assume I need, because I can't do "make mako_defconfig" as there isn't such file.
I don't know what I'm doing wrong as I'm not getting the files I need, althought download was nearly 1GB (I think they should be like this android tree):
https://android.googlesource.com/kernel/msm.git/+/android-msm-mako-3.4-jb-mr1.1
I'll appreciate your help, and sorry if this is the wrong section. Thanks in advance.
PS: I forgot, I already have the toolchain 4.6 and know how to call it, I tried it after clonning the trinity kernel git, I just wonder why I don't get similar files when clonning mako kernel from google source.
I solved it. I had to add the desired branch to the end of the command:
$ git clone https://android.googlesource.com/kernel/msm.git -b "brand"
Doubt is solved, thread can be closed.
Hello,
First of all, im new to android modding and linux. I tried to build a kernel from stock G935FXXU1BPH6 source based on their readme file. My problem is, I don't have a zImage file after build that I could put into a flashable zip. I only have Image and Image.gz (I guess thats normal for arm64 kernels?) and I don't know how to make them flashable. I found a youtube video where the dude placed the Image file in a directory called "tools" in his flashable zip, I tried it and TWRP said I installed it successfully but when I start up my phone and check kernel version its still the previous one not mine.
Used this toolchain: aarch64-linux-android-4.9/bin/aarch64-linux-android-
I've set up CROSS_COMPILE path, then I set up configuration:
make ARCH=arm64 exynos8890-hero2lte_defconfig
make menuconfig (to tweak it a little bit more, like custom kernel version string so I can see if it worked)
Then I started build:
make ARCH=arm64
Output when build finished:
>>>>> Time used for generated all hashes is 6 sec
OBJCOPY arch/arm64/boot/Image
GZIP arch/arm64/boot/Image.gz
DTC arch/arm64/boot/dts/exynos8890-smdk8890.dtb
DTC arch/arm64/boot/dts/exynos8890-universal8890.dtb
Anyone knows how could I make it flashable? Thanks.
keezay said:
Hello,
First of all, im new to android modding and linux. I tried to build a kernel from stock G935FXXU1BPH6 source based on their readme file. My problem is, I don't have a zImage file after build that I could put into a flashable zip. I only have Image and Image.gz (I guess thats normal for arm64 kernels?) and I don't know how to make them flashable. I found a youtube video where the dude placed the Image file in a directory called "tools" in his flashable zip, I tried it and TWRP said I installed it successfully but when I start up my phone and check kernel version its still the previous one not mine.
Used this toolchain: aarch64-linux-android-4.9/bin/aarch64-linux-android-
I've set up CROSS_COMPILE path, then I set up configuration:
make ARCH=arm64 exynos8890-hero2lte_defconfig
make menuconfig (to tweak it a little bit more, like custom kernel version string so I can see if it worked)
Then I started build:
make ARCH=arm64
Output when build finished:
>>>>> Time used for generated all hashes is 6 sec
OBJCOPY arch/arm64/boot/Image
GZIP arch/arm64/boot/Image.gz
DTC arch/arm64/boot/dts/exynos8890-smdk8890.dtb
DTC arch/arm64/boot/dts/exynos8890-universal8890.dtb
Anyone knows how could I make it flashable? Thanks.
Click to expand...
Click to collapse
This particular chipset (64-bit Exynos) uses the uncompressed Image and a separate dtb.img file made from combining all the dtb revisions of your device codename and region into a DTBH format.
You can flash them using my LazyFlasher project.
See: https://github.com/jcadduono/lazyflasher
You will want to use the kernel-flasher branch. The kernel-flasher-samsung branch isn't fully ready and adds additional patch files to remove TIMA/Knox. I've yet to find out everything that needs to be changed from stock state to allow a bootable custom kernel without disabling encryption, unfortunately.
You can simply git clone it, then place your Image and optionally dtb.img in the root folder of the repository, then type "make" to build a TWRP flashable zip. They will be dynamically replaced in the current boot image on the device when the zip is flashed. You can check out the README.md for more info.
If you want to generate your own dtb.img to include in the installer, you can use a script I made from my universal8890 kernel sources on GitHub:
https://github.com/jcadduono/android_kernel_samsung_universal8890/blob/stock-6.0/dtbgen.sh
(correct the toolchain location for your build in the script)
It also requires the scripts/dtbTool folder (from the same git linked above) to be present in your repository. It's not the same as the Qualcomm dtbTool, and the sources are included (and fairly clean!) if you're interested in learning the Exynos dtb.img (DTBH) format.
./dtbgen.sh hero2lte xx
Now, there's still quite a bit that needs to be done to make the device actually boot successfully and be stable with a custom kernel. While the kernel is perfectly stable, the Samsung customized Android OS will absolutely freak out. That's a bit beyond me, and the reason I haven't really worked on any custom kernels for it myself.
Have fun!
jcadduono said:
This particular chipset (64-bit Exynos) uses the uncompressed Image and a separate dtb.img file made from combining all the dtb revisions of your device codename and region into a DTBH format.
You can flash them using my LazyFlasher project.
See: https://github.com/jcadduono/lazyflasher
You will want to use the kernel-flasher branch. The kernel-flasher-samsung branch isn't fully ready and adds additional patch files to remove TIMA/Knox. I've yet to find out everything that needs to be changed from stock state to allow a bootable custom kernel without disabling encryption, unfortunately.
You can simply git clone it, then place your Image and optionally dtb.img in the root folder of the repository, then type "make" to build a TWRP flashable zip. They will be dynamically replaced in the current boot image on the device when the zip is flashed. You can check out the README.md for more info.
If you want to generate your own dtb.img to include in the installer, you can use a script I made from my universal8890 kernel sources on GitHub:
https://github.com/jcadduono/android_kernel_samsung_universal8890/blob/stock-6.0/dtbgen.sh
(correct the toolchain location for your build in the script)
It also requires the scripts/dtbTool folder (from the same git linked above) to be present in your repository. It's not the same as the Qualcomm dtbTool, and the sources are included (and fairly clean!) if you're interested in learning the Exynos dtb.img (DTBH) format.
./dtbgen.sh hero2lte xx
Now, there's still quite a bit that needs to be done to make the device actually boot successfully and be stable with a custom kernel. While the kernel is perfectly stable, the Samsung customized Android OS will absolutely freak out. That's a bit beyond me, and the reason I haven't really worked on any custom kernels for it myself.
Have fun!
Click to expand...
Click to collapse
Thank you very much!
@jcadduono couldn't make the kernel boot after packing it with lazyflasher. I built a completely stock kernel from the mentioned source, pasted the "Image" (not the Image.gz) file in lazyflasher root and then used make command. Tried including "exynos8890-smdk8890.dtb" file as well. Same story. Not sure if I need anything else in the package or I made user mistake. Do you have any ideas how could I debug what makes it stuck on that screen?
Thanks!
EDIT: Solved Problem.
keezay said:
@jcadduono couldn't make the kernel boot after packing it with lazyflasher. I built a completely stock kernel from the mentioned source, pasted the "Image" (not the Image.gz) file in lazyflasher root and then used make command. Tried including "exynos8890-smdk8890.dtb" file as well. Same story. Not sure if I need anything else in the package or I made user mistake. Do you have any ideas how could I debug what makes it stuck on that screen?
Thanks!
EDIT: Solved Problem.
Click to expand...
Click to collapse
Can you help me set up an environment to build a kernel, arm64, for s7? I'm on Ubuntu having a heel of a time..
Galaxy S7 Edge Kernel Flashing Issues
I am currently trying to flash a different kernel into a galaxy s7 edge (SM-G935S).
I have gone as far as building a kernel and extracting a Image file from it, but every time I try flashing a boot.img with a replaced kernel image file, it seems to never work.
A mkbootimg tool that I am currently using requires a dtb file, but I cannot find where to get it from.
I have tried using @jcadduono's git code, but the dtb file created from it doesn't seem to work as well.
Can anyone tell me what I should do to flash a kernel successfully?
kernel panic after flashing
Hi @ll,
with this guide I was able to compile my own kernel and also flashing it to my phone. Unfortunatelly I'm getting kernel panic after rebooting the phone. is there any possibility to get the reason for this? Or do you have any hint, what I may have done wrong?
Thanks for your help.
Kind regards
v0ti
Hey guys.
I need some help... I've downloaded the firmware images and the source files for building the kernel from the Asus.com support section for Zenfone 3 Zoom and I've built a new image going through the steps:
export CROSS_COMPILE=.../kernel/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
export ARCH=arm64
export SUBARCH=arm64
and fixing some include dependencies that couldn't be found (#include <> to include "" etc...). I then build the config with
make ZE553KL-Hades_defconfig then make menuconfig just to tick support to my wifi otg adapter model.
I was able to build Image, Image.gz and Image.gz-dtb from that. Afterwards I used a few of several free tools online to unpack the original boot.img that I downloaded from the support site and repack it with the ramdisk.cpio.gz and my kernel image (already tried using Image, Image.gz and Image.gz-dtb).
The problem is that when I either fastboot boot new.img or fastboot flash boot new.img the phone won't boot at all. It keeps going back to the bootloader selection screen.
If I use the downloaded boot.img instead it works fine so I don't know what I'm missing here.
Any help would be appreciated...