简体   繁体   English

从官方未修改的源编译 android kernel 给出损坏的结果

[英]Compiling android kernel from official unmodified source gives corrupted result

I have downloaded the kernel source of my Samsung Galaxy Tab A 2018 (SM-T590) from Samsung Open Source website.我已经从三星开源网站下载了我的三星 Galaxy Tab A 2018 (SM-T590) 的 kernel 源代码。

I'm trying to compile the unmodified source code using the instructions given with the kernel inside the archive, however the resulting kernel file is ~28MB, while the one which can be extracted from the stock ROM's boot.img is ~13MB.我正在尝试使用存档中 kernel 给出的说明编译未修改的源代码,但是生成的 kernel 文件约为 28MB,而可以从库存 ROM 的 boot.img 中提取的文件约为 13MB。

Of course, the 28MB large compiled kernel won't boot the system up, when I select reboot to system in the recovery, it goes back to download mode.当然,28MB大编译的kernel不会启动系统,当我select在recovery中重启系统时,又回到下载模式。

Steps I have followed:我遵循的步骤:

1. How to Build
        - get Toolchain
                From android git serveru, codesourcery and etc ..
                - gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-

        - make output folder 
                EX) OUTPUT_DIR=out
                $ mkdir out

        - edit Makefile
                edit "CROSS_COMPILE" to right toolchain path(You downloaded).
                        EX)  CROSS_COMPILE=<android platform directory you download>/android/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
                        Ex)  CROSS_COMPILE=/usr/local/toolchain/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android- // check the location of toolchain
        - to Build
                $ export ARCH=arm64
                $ make -C $(pwd) O=$(pwd)/out KCFLAGS=-mno-android gta2xlwifi_eur_open_defconfig
                $ make -C $(pwd) O=$(pwd)/out KCFLAGS=-mno-android

2. Output files
        - Kernel : arch/arm64/boot/Image
        - module : drivers/*/*.ko

Log from the compiler: https://pastebin.com/Fv96iAmP来自编译器的日志: https://pastebin.com/Fv96iAmP

Solved.解决了。

Basically the stock kernel inside boot.img is a compressed archive containing the kernel itself, that's why it was a different size.基本上,boot.img 中的库存 kernel 是一个压缩档案,其中包含 kernel 本身,这就是它大小不同的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM