custom kernel failed - Xperia Z5 Premium Q&A, Help & Troubleshooting

I try to build kernel on my device E6883, and i was failed.
I followed the sony developer world guide:<<How to build and flash a Linux kernel from Sony copyleft archives>> All steps was OK. I got the boot.img and I flash onto my E6883, but it can’t boot, black screen.
my rom version is: 32.0.A.6.209
Can anyone help me?
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
2017-02-17
Hi @zacharias.maladroit,I update my e6883’s rom to 32.2.A.5.11 ,and flash the kernel that you released “Z5Prem-DSDS_SK_Perm_v5.11_III.2_6_ctl_X_sats_dual.zip”, it can work good.
So I decided to use your kernel . git clone from your github, I successfully compiled and got Image.gz-dtb. But when i flash to the device, it can’t boot.
I tried use my mkqcdbootimg to make the boot.img and I tried to use the lazyflasher, neither of the two way work.
My build command is:
```
export USE_CCACHE=1
export CACHE_DIR=~/.ccache
export ARCH=arm64
export PATH=/home/ubuntu/aarch64-linux-android-4.9/bin/:$PATH
export CROSS_COMPILE=aarch64-linux-android-
export KBUILD_DIFFCONFIG=satsuki_dsds_diffconfig
#export KBUILD_DIFFCONFIG=sumire_diffconfig I tried this config too.
make msm8994-perf_defconfig
make -j8
```
Can you give me some help?

seems like you have used wrong kernel or something went wrong.
your device is bricked or atleast stuck in bootloop withing kernel!
PRESS and HOLD volumeup and power button for 15 seconds,
you will feel 1........2..........3 vibrations! ........ just after 2nd vibration! RELEASE both BUTTON IMMEDIATELY!
the device will shutdown
now connect it as FLASHMODE and re flash the ORIGINAL STOCK in order to fix the device!

Code:
export ARCH=arm64
export PATH=~/android/z5_build-environment/mdalexca-aarch64-linux-android-4.9-kernel-linaro-09c6758022e7/bin/:$PATH
export CROSS_COMPILE=aarch64-linux-android-
export KBUILD_DIFFCONFIG=sumire_diffconfig
make msm8994-perf_defconfig
make -j8
https://github.com/zachariasmaladro....5.11_corona_III.2_ctl_X/build_it4_sumire#L31

Related

[HOWTO][KERNEL][G800F][exynos] Custom kernel tutorial

This is a short tutorial on how to compile and flash a (customized) Linux kernel on your G800F.
Note that this tutorial is only for the G800F as G800H/M/Y/... have a totally different architecture (SoC,...).
Toolchain
First of all get a decent toolchain (gcc,...). There are some prebuilt ones at android.googlesource.com.
If you have git installed fetch the arm-eabi-4.6 toolchain with:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
Other toolchains might work but I had no luck with a Linaro toolchain optimized for the Cortex-A7 (ARM-architecture of the Exynos 3470) - the kernel did not boot at all.
Also the arm-eabi-4.8 toolchain from android.googlesource.com aborted with a compile error, so use the 4.6 version.
Fetch the Linux Kernel sources
Now you have to fetch the kernel sources. At the moment there are only the official sources from Samsung's open source server.
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-G800F
Select a source package:
The source packages at this server contain the kernel sources (Kernel.tar.gz), some part of the Android system (Platform.tar.gz) and some build instructions (README_*). There are multiple versions of the source packages. You can find an explanation of the versioning scheme here: samsung-firmware-version-number.html
For example the version part of a source package G800FXXU1ANG1 is NG1 which stands for N=2014, G=July, 1=1st release.
G800FXXU1ANJ2 is N=2014, J=October, 2nd release.
In addition Samsung adds country code post-fixes like "_MEA" which might contain regional adaptions. See http://forum.xda-developers.com/showpost.php?p=57410625&postcount=5 for an explanation and list of country codes. For example MEA probably stands for "MIDDLE EAST ASIA".
So the newest source packages are G800FXXU1ANG1 and G800FXXU1ANG4 (MEA). I compared the kernel sources of both packages and found no difference. Seems as if only the Android part was changed. Both are from July so not very up-to-date. At least they are based on a 3.4.39 kernel which matches the kernel version of G800FXXU1ANL1.
Mirror:
Note that downloading a source package from Samsung's Open Source server takes a lot of time as the download speed is very poor. It took 12-24 hours for me.
You can also download the sources from my github repository:
https://github.com/tobigun/samsung-kernel-smg800f
At the moment the master contains the G800FXXU1ANG1 kernel sources but might be updated as soon as a newer kernel source is released.
Compile the Kernel
Prepare the build by applying the S5 Mini kernel config:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make kminilte_00_defconfig
If you want to change the config now, you can do this with:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make menuconfig
After you have done some changes to the kernel sources you can build it with:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make -j4
If you do not want to build with multiple CPUs you can remove the "-j4" from the command line (which also is handy if an error occurred).
In either case the resulting kernel image will be in "arch/arm/boot/zImage".
Note that kernel module support is disabled in the S5 mini config so everything you need (all drivers, ...) is in the zImage. There is no need to copy additional kernel modules to the filesystem.
Flashing the Kernel
Almost done. It is not possible to flash the kernel image directly. Instead you have to put the kernel image and a ramdisk together into a flasable boot.img. The easiest way to get such a boot.img is to use an existing boot.img and replace just the kernel image.
1. Get a decent boot.img
There are at least two ways:
a) Download the current firmware image from SamMobile (http://www.sammobile.com/firmwares/database/SM-G800F/) and extract the boot.img. With 7-zip there will be an error message if you extract the .tar.md5 inside the zip - just ignore the message and extract the boot.img file.
b) Extract the current boot.img from the device's flash with (root required):
Connect to the device (with "adb shell" or ssh).
Then copy the contents of the boot-partition to a file:
Code:
dd if=/dev/block/mmcblk0p9 of=boot.img
2. Replace kernel image
For this step AIK (Android Image Kitchen) is required.
Download it at http://forum.xda-developers.com/showthread.php?t=2073775. Probably you want AIK-Linux-v1.7-ALL.tar.gz (or newer).
Extract the files.
Now unpack the boot image, replace the kernel image and repack it (with the original ramdisk) to a new boot.img:
Code:
./unpackimg.sh boot.img
cp <KERNEL_BUILD_DIR>/arch/arm/boot/zImage split_img/boot.img-zImage
./repackimg.sh --original
Note that the zImage name inside split_img might differ from boot.img-zImage.
The new boot.img is "image-new.img". Rename it to boot.img and flash it.
3. Flash new boot.img
Important notice:
- You flash this image at your own responsibility. I am not responsible for any damage that might be caused by flashing this image (bricked device, lost data, ...)
- Flashing this kernel image will trigger the KNOX counter, so your warranty will be void.
- The image is only for S5 Mini SM-G800F (Exynos)
- The kernel might be instable, crash your device, drain your battery, or even might damage your smartphone
- Backup your data before flashing
- Make sure you have the current firmware of your device (e.g. from SamMobile) so you can flash it back in case something goes wrong.
There are multiple ways to flash the boot.img to your device:
a) From recovery with an update.zip
b) Using Odin
c) Directly with dd
a) From recovery with an update.zip
TODO
b) Using Odin
Create tar.md5:
At least some versions of Odin3 (e.g. v3.07) need a tar.md5 instead of a "simple" tar file. Although a simple tar-file can be selected in Odin, the image will not be flashed correctly.
Download tar-Tool_Odin3-v3.07_by_mkh.mourad.zip
Extract it.
On windows copy the boot.img file into the tar-Tool folder first and then drag and drop the boot.img on ImgToTar.MD5.bat. Alternatively you can also pass the filename as a command line parameter to ImgToTar.MD5.bat.
Now you should have a boot.tar.md5.
Flash tar.md5:
Download Odin (for example Odin3-v3.07 contained in CF-Auto-Root)
Reboot your device into Odin mode: turn off your device, then press Volume-Down + Home + Power button at the same time and release them. Confirm the following message with the Volume-Up button.
Connect your device to your PC via USB
Make sure the device driver's are installed on your PC
Start Odin
Select PDA and select the kernel image (boot.tar.md5)
Check that only "Auto Reboot" and "F. Reset Time" is set
Click on "Start": the kernel image should be flashed now and the device should reboot afterwards
c) Directly with dd
Connect to the device (with "adb shell" or ssh).
Then copy the contents of the boot.img file to the boot-partition:
Code:
dd if=boot.img of=/dev/block/mmcblk0p9
Reboot
Done
You can now check in "Settings - Device Info - Kernel-Version" if your kernel is used.
Reserved

[HOWTO][KERNEL][G800H][msm8228] Custom kernel tutorial

This is a short tutorial on how to compile and flash a (customized) Linux kernel on your G800H.
Note that this tutorial is only for the G800H as G800F/M/Y/... have a totally different architecture (SoC,...).
Toolchain
First of all get a decent toolchain (gcc,...). There are some prebuilt ones at android.googlesource.com.
If you have git installed fetch the arm-eabi-4.6 toolchain with:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
Fetch the Linux Kernel sources
Now you have to fetch the kernel sources. At the moment there are only the official sources from Samsung's open source server.
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-G800H
Select a source package:
The source packages at this server contain the kernel sources (Kernel.tar.gz), some part of the Android system (Platform.tar.gz) and some build instructions (README_*). There are multiple versions of the source packages. You can find an explanation of the versioning scheme here: samsung-firmware-version-number.html
For example the version part of a source package G800HXXU1ANGG is NGG which stands for N=2014, G=July, G=release G.
In addition Samsung adds country code post-fixes like "_LA" which might contain regional adaptions. See http://forum.xda-developers.com/showpost.php?p=57410625&postcount=5 for an explanation and list of country codes
SER: RUSSIA
SWA: SOUTH WEST ASIA
MEA: unknown (maybe MIDDLE EAST ASIA?)
LA: unknown (could be ATLANTIC, as kernel config for G800H LA is named: msm8228-sec_atlantic3geur_defconfig)
SKZ = KAZAKHSTAN
As every source package for the G800H has a different country code it is hard to determine which one to use. Probably the regional differences only concern the Android system but not the kernel. According to the versioning scheme the last release should be G800HXXU1ANGG (LA).
Mirror:
Note that downloading a source package from Samsung's Open Source server takes a lot of time as the download speed is very poor. It took 12-24 hours for me.
You can also download the sources from my github repository:
https://github.com/tobigun/samsung-kernel-smg800h
At the moment the master contains the G800HXXU1ANGG kernel sources but might be updated as soon as a newer kernel source is released.
Compile the Kernel
Prepare the build by applying the S5 Mini kernel config:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make msm8226-sec_defconfig VARIANT_DEFCONFIG=msm8228-sec_atlantic3geur_defconfig
If you want to change the config now, you can do this with:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make menuconfig
After you have done some changes to the kernel sources you can build it with:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make -j4
If you do not want to build with multiple CPUs you can remove the "-j4" from the command line (which also is handy if an error occurred).
In either case the resulting kernel image will be in "arch/arm/boot/zImage".
Flashing the Kernel
Almost done. It is not possible to flash the kernel image directly. Instead you have to put the kernel image and a ramdisk together into a flasable boot.img. The easiest way to get such a boot.img is to use an existing boot.img and replace just the kernel image.
1. Get a decent boot.img
Download the current firmware image from SamMobile (http://www.sammobile.com/firmwares/database/SM-G800H/) and extract the boot.img. With 7-zip there will be an error message if you extract the .tar.md5 inside the zip - just ignore the message and extract the boot.img file.
2. Replace kernel image
For this step AIK (Android Image Kitchen) is required.
Download it at http://forum.xda-developers.com/showthread.php?t=2073775. Probably you want AIK-Linux-v1.7-ALL.tar.gz (or newer).
Extract the files.
Now unpack the boot image, replace the kernel image and repack it (with the original ramdisk) to a new boot.img:
Code:
./unpackimg.sh boot.img
cp <KERNEL_BUILD_DIR>/arch/arm/boot/zImage split_img/boot.img-zImage
./repackimg.sh --original
Note that the zImage name inside split_img might differ from boot.img-zImage.
The new boot.img is "image-new.img". Rename it to boot.img and flash it.
3. Flash new boot.img
Important notice:
- You flash this image at your own responsibility. I am not responsible for any damage that might be caused by flashing this image (bricked device, lost data, ...)
- Flashing this kernel image will trigger the KNOX counter, so your warranty will be void.
- The image is only for S5 Mini SM-G800H (msm8228)
- The kernel might be instable, crash your device, drain your battery, or even might damage your smartphone
- Backup your data before flashing
- Make sure you have the current firmware of your device (e.g. from SamMobile) so you can flash it back in case something goes wrong.
There are multiple ways to flash the boot.img to your device:
a) From recovery with an update.zip
b) Using Odin
a) From recovery with an update.zip
TODO
b) Using Odin
Create tar.md5:
At least some versions of Odin3 (e.g. v3.07) need a tar.md5 instead of a "simple" tar file. Although a simple tar-file can be selected in Odin, the image will not be flashed correctly.
Download tar-Tool_Odin3-v3.07_by_mkh.mourad.zip
Extract it.
On windows copy the boot.img file into the tar-Tool folder first and then drag and drop the boot.img on ImgToTar.MD5.bat. Alternatively you can also pass the filename as a command line parameter to ImgToTar.MD5.bat.
Now you should have a boot.tar.md5.
Flash tar.md5:
Download Odin (for example Odin3-v3.07 contained in CF-Auto-Root)
Reboot your device into Odin mode: turn off your device, then press Volume-Down + Home + Power button at the same time and release them. Confirm the following message with the Volume-Up button.
Connect your device to your PC via USB
Make sure the device driver's are installed on your PC
Start Odin
Select PDA and select the kernel image (boot.tar.md5)
Check that only "Auto Reboot" and "F. Reset Time" is set
Click on "Start": the kernel image should be flashed now and the device should reboot afterwards
Done
You can now check in "Settings - Device Info - Kernel-Version" if your kernel is used.
The topic is wrong: the G800H does not have an exynos SoC but a msm8228. Unfortunately I cannot change the topic name.
Reserved
hennymcc said:
This is a short tutorial on how to compile and flash a (customized) Linux kernel on your G800H.
Note that this tutorial is only for the G800H as G800F/M/Y/... have a totally different architecture (SoC,...).
Toolchain
First of all get a decent toolchain (gcc,...). There are some prebuilt ones at android.googlesource.com.
If you have git installed fetch the arm-eabi-4.6 toolchain with:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
Fetch the Linux Kernel sources
Now you have to fetch the kernel sources. At the moment there are only the official sources from Samsung's open source server.
http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=SM-G800H
Select a source package:
The source packages at this server contain the kernel sources (Kernel.tar.gz), some part of the Android system (Platform.tar.gz) and some build instructions (README_*). There are multiple versions of the source packages. You can find an explanation of the versioning scheme here: samsung-firmware-version-number.html
For example the version part of a source package G800HXXU1ANGG is NGG which stands for N=2014, G=July, G=release G.
In addition Samsung adds country code post-fixes like "_LA" which might contain regional adaptions. See http://forum.xda-developers.com/showpost.php?p=57410625&postcount=5 for an explanation and list of country codes
SER: RUSSIA
SWA: SOUTH WEST ASIA
MEA: unknown (maybe MIDDLE EAST ASIA?)
LA: unknown (could be ATLANTIC, as kernel config for G800H LA is named: msm8228-sec_atlantic3geur_defconfig)
SKZ = KAZAKHSTAN
As every source package for the G800H has a different country code it is hard to determine which one to use. Probably the regional differences only concern the Android system but not the kernel. According to the versioning scheme the last release should be G800HXXU1ANGG (LA).
Mirror:
Note that downloading a source package from Samsung's Open Source server takes a lot of time as the download speed is very poor. It took 12-24 hours for me.
You can also download the sources from my github repository:
https://github.com/tobigun/samsung-kernel-smg800h
At the moment the master contains the G800HXXU1ANGG kernel sources but might be updated as soon as a newer kernel source is released.
Compile the Kernel
Prepare the build by applying the S5 Mini kernel config:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make msm8226-sec_defconfig VARIANT_DEFCONFIG=msm8228-sec_atlantic3geur_defconfig
If you want to change the config now, you can do this with:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make menuconfig
After you have done some changes to the kernel sources you can build it with:
Code:
ARCH=arm CROSS_COMPILE=<PATH_TO_TOOLCHAIN>/bin/arm-eabi- make -j4
If you do not want to build with multiple CPUs you can remove the "-j4" from the command line (which also is handy if an error occurred).
In either case the resulting kernel image will be in "arch/arm/boot/zImage".
Flashing the Kernel
Almost done. It is not possible to flash the kernel image directly. Instead you have to put the kernel image and a ramdisk together into a flasable boot.img. The easiest way to get such a boot.img is to use an existing boot.img and replace just the kernel image.
1. Get a decent boot.img
Download the current firmware image from SamMobile (http://www.sammobile.com/firmwares/database/SM-G800H/) and extract the boot.img. With 7-zip there will be an error message if you extract the .tar.md5 inside the zip - just ignore the message and extract the boot.img file.
2. Replace kernel image
For this step AIK (Android Image Kitchen) is required.
Download it at http://forum.xda-developers.com/showthread.php?t=2073775. Probably you want AIK-Linux-v1.7-ALL.tar.gz (or newer).
Extract the files.
Now unpack the boot image, replace the kernel image and repack it (with the original ramdisk) to a new boot.img:
Code:
./unpackimg.sh boot.img
cp <KERNEL_BUILD_DIR>/arch/arm/boot/zImage split_img/boot.img-zImage
./repackimg.sh --original
Note that the zImage name inside split_img might differ from boot.img-zImage.
The new boot.img is "image-new.img". Rename it to boot.img and flash it.
3. Flash new boot.img
Important notice:
- You flash this image at your own responsibility. I am not responsible for any damage that might be caused by flashing this image (bricked device, lost data, ...)
- Flashing this kernel image will trigger the KNOX counter, so your warranty will be void.
- The image is only for S5 Mini SM-G800H (msm8228)
- The kernel might be instable, crash your device, drain your battery, or even might damage your smartphone
- Backup your data before flashing
- Make sure you have the current firmware of your device (e.g. from SamMobile) so you can flash it back in case something goes wrong.
There are multiple ways to flash the boot.img to your device:
a) From recovery with an update.zip
b) Using Odin
a) From recovery with an update.zip
TODO
b) Using Odin
Create tar.md5:
At least some versions of Odin3 (e.g. v3.07) need a tar.md5 instead of a "simple" tar file. Although a simple tar-file can be selected in Odin, the image will not be flashed correctly.
Download tar-Tool_Odin3-v3.07_by_mkh.mourad.zip
Extract it.
On windows copy the boot.img file into the tar-Tool folder first and then drag and drop the boot.img on ImgToTar.MD5.bat. Alternatively you can also pass the filename as a command line parameter to ImgToTar.MD5.bat.
Now you should have a boot.tar.md5.
Flash tar.md5:
Download Odin (for example Odin3-v3.07 contained in CF-Auto-Root)
Reboot your device into Odin mode: turn off your device, then press Volume-Down + Home + Power button at the same time and release them. Confirm the following message with the Volume-Up button.
Connect your device to your PC via USB
Make sure the device driver's are installed on your PC
Start Odin
Select PDA and select the kernel image (boot.tar.md5)
Check that only "Auto Reboot" and "F. Reset Time" is set
Click on "Start": the kernel image should be flashed now and the device should reboot afterwards
Done
You can now check in "Settings - Device Info - Kernel-Version" if your kernel is used.
Click to expand...
Click to collapse
====================================
Hi.. Im from Venezuela.. And i need help.. I have a S5 mini SM-G800H in QHSUSB-DLOAD.. I need the debrick.img for AOS 6.0 please.. Thank you so much for your help..
Please tell u, how I can build a custom kernel for the build LineageOS-14 for S5 mini SM-G800H?

Build D710 CM-12.0 Lollipop boot.img

Follow the build guide. After breakfast d710 , enter mka bootimage ( from croot directory ) the build will stop after a while stating an error with the system.te. gedit the system.te file specified I deleted all the ( ; ) and added a ( # ) to the beginning of each line. Save and exit the editor. Enter mka bootimage again. The build will stop after a while stating an error with the wimax.te file. Gedit the file specified I deleted the ( ; ) and added the ( # ) to the beginning of each line . Save and exit the editor. Enter mka bootimage again. The build will complete. cd to your out directory and the boot.img will be there . Do what you do . I flashed the .img to test the recovery and flashed cm11 nightly ,UpdateSuperSU.zip,4.4 GAPPS. And rebooted . it works I am currently writing this post on the same phone. That has to be helpful?...
SyriousJoker said:
Follow the build guide. After breakfast d710 , enter mka bootimage ( from croot directory ) the build will stop after a while stating an error with the system.te. gedit the system.te file specified I deleted all the ( ; ) and added a ( # ) to the beginning of each line. Save and exit the editor. Enter mka bootimage again. The build will stop after a while stating an error with the wimax.te file. Gedit the file specified I deleted the ( ; ) and added the ( # ) to the beginning of each line . Save and exit the editor. Enter mka bootimage again. The build will complete. cd to your out directory and the boot.img will be there . Do what you do . I flashed the .img to test the recovery and flashed cm11 nightly ,UpdateSuperSU.zip,4.4 GAPPS. And rebooted . it works I am currently writing this post on the same phone. That has to be helpful?...
Click to expand...
Click to collapse
I copied the boot.img to my phone and used an app to flash the boot.img ( de.mkrtchyan.recoverytools_2.3.7.apk) I always flash it twice through that app
Fresh back from flashing the kernel with a ported ROM. It works. The WiFi does not work and the mobile data does not either. When the screen dims or the power button is pressed the system ui resets. And it seems to not have cache memory.(i had to keep telling it to use trebuchet always after everytime it soft rebooted. I took some screenshots. Needed something to do while this builds from source. Its a nightmare. The build I am doing now has been going three days stopping every 30 or so minutes stating it can't either make a folder or a file. I am writing all my steps down and I am on step 130 and counting. Its not at all as easy as that damn guide says at all. But I'm grateful to xda and its members for their help and the materials to learn. Somebody hit the thanks button.
Failed to mention I used my boot.img with a 12.1 ROM . hopefully I can help bring lollipop to the d710 or help someone else. I am building on windows 10 64 virtual machine xubuntu 14.04 trusty with adb functionality and (well obviously usb functionality as well as WiFi

Cannot compile kernel

I am planning to compile my own kernel for my device, I have seen relative guides and such but I am unable to compile even the stock one by xiaomi.
1)Has anyone got any success compiling such kernel.
2)Can you describe step by step your set-up the install.
What I have tried by now
1) Download and unpack Kernel source by xiaomi
2) Getting the 4.9 toolchain
3) Now my commands
export CROSS_COMPILE= (toolchain path (this is correct as no error has popped up))
export ARCH=arm64
export SUBARCH=arm64
Make clean
Make mrproper
Make ranchu64_defconfig (probably wrong)
Make -j4
About the error: Since trying for over two weeks of no success I abandoned it, but I do remember that make was saying error 2 if that somehow helps.
-Thank you for your time my fellow developers!
MimoPakou said:
I am planning to compile my own kernel for my device, I have seen relative guides and such but I am unable to compile even the stock one by xiaomi.
1)Has anyone got any success compiling such kernel.
2)Can you describe step by step your set-up the install.
What I have tried by now
1) Download and unpack Kernel source by xiaomi
2) Getting the 4.9 toolchain
3) Now my commands
export CROSS_COMPILE= (toolchain path (this is correct as no error has popped up))
export ARCH=arm64
export SUBARCH=arm64
Make clean
Make mrproper
Make ranchu64_defconfig(it's probably wrong)
Make -j4
About the error: Since trying for over two weeks of no success I abandoned it, but I do remember that make was saying error 2 if that somehow helps.
-Thank you for your time my fellow developers!
Click to expand...
Click to collapse
UPDATE: After some time, I figured out 2 things
1)The defconfig I was using is wrong, but I
have searched the folders and no other file
works (So how do I find my defconfig?)
2)Turns out that for my particular device the
exported files need to be outside of the
kernel, as doing that continued the
compiling process only to be stopped by a
file that wasn't found:
(built-in.o located in /arch/arm64/kernel/ )
(and this makes me suspicious about my defconfig)

Unable to build kernel from source, what i'm missing?

Hello to all!
I'm an heavy oneplus user, currently with Nord, but i'm try to use my old but Gold Oneplus 3 to run Klipper+Moonraker+Fluidd.
Klipper side everything is perfect, still remains one big issue: there is no kernel compiled for OP3 which has USB_SERIAL_CH341 driver enabled.
I'm trying to build but without success. Here is what i've done under Linux Mint latest version.
First of all i've installed a lot of packages, i cant remember all because i used various guides since initially i was not able neither of finish compilation.
Then i've downloaded:
kernel source: https://github.com/lin16-microg/android_kernel_oneplus_msm8996/tree/lin-16.0-mse2
from this ROM thread, which is the rom im still using: https://forum.xda-developers.com/t/...ened-lineageos-16-0-for-oneplus-3-3t.4034869/
initially i've tried to use EVAgcc toolchain, but it was impossible to finish to build. Then i switched to AOSP toolchains:
32bit: https://android.googlesource.com/pl...inux-androideabi-4.9/+/refs/heads/pie-release
64bit: https://android.googlesource.com/pl...64-linux-android-4.9/+/refs/heads/pie-release
With Them i was able to compile from source, but before doing i modified the file called "lineageos_oneplus3_defconfig" by adding "USB_SERIAL_CH341=y" just under the "USB_SERIAL=y" in order to have the serial driver compiled and loader (if i have understood right?).
to build i've used from inside kernel source cloned directory:
>make clean
>make mrproper
>ARCH=arm64 SUBARCH=arm64 CROSS_COMPILE=googletoolpath/bin/aarch64-stuffs- CROSS_COMPILE_ARM32=googletoolpath/bin/arm-stuffs- make O=out lineageos_oneplus3_defconfig
>ARCH=arm64 SUBARCH=arm64 CROSS_COMPILE=googletoolpath/bin/aarch64-stuffs- CROSS_COMPILE_ARM32=googletoolpath/bin/arm-stuffs- make O=out Image -j2
in this way i've obtained an Image (not a zimage since with zimage returned error).
Then i unpacked the stock boot.img with Android Image Kitchen, substituted boot.img-kernel file (which is an archive..?) with the compiled image renamed.
Finally i repacked everything.
Tried to flash the repacked boot img but no boot, the phone returns to fastboot screen.
I've noticed that my newboot.img is around 25mb insted of around 12mb like the stock one present in the Rom.zip
Probably the error resides in how i've managed to unpack and repack the kernel image..
Do someone see some heavy error which can cause the problem? What can i try?
From a side, as automation engineer, i want to learn and try to do it by myself, but on the other side, if someone is able to compile it for me with serial CH341 driver enabled a beer is assured.
Thanks all to have read up to now and for any advice
not sure that's important but you forgot to gzip kernel before repacking. I recommend to compile with configuration of running kernel from device /proc/config.gz first.
alecxs said:
not sure that's important but you forgot to gzip kernel before repacking. I recommend to compile with configuration of running kernel from device /proc/config.gz first.
Click to expand...
Click to collapse
I've to try because it is not gzipped by default, the problem is that I don't found all in one scripts or config file as the one mentioned by you. I would never thought that rebuild a kernel were so tricky.

Categories

Resources