[Question] Building a custom kernel for G980F (Exynos) - Samsung Galaxy S20 / S20+ / S20 Ultra Questions &

Heya,
So I downloaded the stock kernel for the S20 and made a few adjustments.
I compiled the kernel as instructed and got the kernel "Image" file.
I then used mkbootimg to create the proper complete kernel image with the appropriate configurations (I didn't supply anything for dtb file, dtb-offset and dt file.
It flashes just fine, but for a reason unknown to me, I can't get the kernel to boot.
I keep getting the phone to boot to download mode with the error - DTB LOAD FAILED, FDT_ERR_BADMAGIC
I took a working boot.img file, unpacked it and packed it again using the kernel I made, but still I keep getting the same error.
What am I doing wrong?
EDIT: Solved, did not reboot because I forgot to repack ramdisk.

Related

[Q] kernel packaging and boot.img creation

Okay, so I have created and modified my own kernel name BionicSheep and have done couple releases (check my signature for link). My main question is how do I create a flashable zip with a boot.img I have asked a few people and they told me to use the kernel kitchen or google, but this is the only problem I haven't been able to solve after googling daily for the past 4 days. I figured I would ask here.
The reason I would like a boot.img is because I know in order to modify the kernelsplash with my own logo, I need to be able to unpack the bootimage to get the ramdisk and modify an rle file. The problem is I have no idea how to first make this bootimage. I understand to make the bootimage you need a the zImage (kernel binary) and the ramdisk. I have the zImage but I don't know how to make/get a ramdisk.
Currently I have been using this described method of packing my kernel into a flashable zip. I am pretty sure it just packs my modules and zImage into koush's AnyKernel. Thanks for any help, I need it.
Also try my kernel out and leave feedback if you are so inclined! It really is appreciated

[Q] Problems on Building CM-12 (GT-I8160)

Hi there! I'm trying to build CM-12 for GT-I8160 based on TeamCanjica's CM-11. Actually, it has been compiled successfully with some hacks (I skipped imgdiff). But it bricked my phone after I flashed it via CWM. :crying:
I've unbricked my phone by flashing my backup of stock boot partition (mmcblk0p15) to "Kernel" partition via Heimdall. Then, my phone showed CM boot animation for a long time. (bootloop I think, maybe because of stock boot partition isn't compatible with it). And I use stock firmware for now.
I found that type of the boot partition (mmcblk0p15) of the stock differ with boot.img I've built.
Code:
$ file mmcblk0p15-boot (my backup of stock boot partition)
mmcblk0p15-boot: Linux kernel ARM boot executable zImage (little-endian)
$ file boot.img (boot.img I've extracted from cm-12-20141217-UNOFFICIAL-codina.zip)
boot.img: Android bootimg, kernel (0x40008000), ramdisk (0x41000000), page size: 4096
So, what are "Linux kernel ARM boot executable zImage" and "Android bootimg"? Where is the root partition (ramdisk) stored?
Is it okay to skip imgdiff? I think imgdiff is just for creation of OTA package. Am I correct?
I also found boot.img in out/target/product/codina (not in the zip file) which type is Linux kernel ARM boot executable zImage.
Is it the correct boot.img? I found that the content of that file is same with kernel file I found in the same folder. I'm afraid that the ramdisk is not included in it.
Sorry for my English n thank you very much.
Oh. All people wants to have cm12, but still 0 replies here.
I'm sorry, I can't help in this too... /
S.AMU said:
Oh. All people wants to have cm12, but still 0 replies here.
I'm sorry, I can't help in this too... /
Click to expand...
Click to collapse
Hi! It's okay, I've flashed out/target/product/codina/boot.img + gapps. It booted to CM-12 , freezed at the welcome screen n refused to boot again after I force-rebooted it :crying:. Unfortunately, ADB & recovery didn't work, so I didn't know much why it got freezed. Maybe I have to figure out how to compile a nice kernel with working ADB & recovery. Hahaha...

[PROBLEM] Compiling kernel generates 5 dtb files instead of one (motorola G5)

I've just finished compiling the stock kernel for Motorola G5, but upon finishing I have 5 dtb files instead of one in the output directory. These are named msm8937-cedric-pX.dtb and each has 220KB aproximately, unlike the 1MB image that is packed in the stock boot img. My zImage doesn't boot using any of them, what should I do?

Flashing a compiled kernel on S20

Hi,
I've downloaded the latest Android 10 image for the S20, which works great on my phone.
I've then extracted the boot.img from the AP tar, and used unpackbootimg & mkbootimg to pack it right back (without changing anything).
I've made sure all the parts were packed (Including the ramdisk), but after flashing the device always boot to Download Mode with :
dt table header check fail: FDT_ERR_BADMAGIC
DTB LOAD FAIL
I've seen the same error in:
https://forum.xda-developers.com/t/question-building-a-custom-kernel-for-g980f-exynos.4122853/
Where he claims to have solved it by supplying the ramdisk parameter, but I've already did.
Any idea how to solve this?
Thanks!

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