[REFERENCE] How to compile an Android kernel

Sid127

Senior Member
Nov 12, 2016
141
94
28
Hyderabad
I've been trying to compile my kernel in-line with Paranoid Android Ruby, and have constantly running into this error. I've tried using different versions of clang, adding the ld path to $PATH, among many other attempts.

I'm building on Ubuntu 20.04 LTS, if that makes a difference, and here's my kernel sources

Absolutely any help is appreciated <3
 

tohtorin

Senior Member
Jun 22, 2016
148
118
53
Lammi
www.drg.fi
I thought I got it to work until next error appeared:


make[3]: *** No rule to make target 'arch/arm64/boot/dts/qcom/apq8016-sbc.dtb', needed by '__build'. Stop.
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [../scripts/Makefile.build:642: arch/arm64/boot/dts/qcom] Error 2
make[1]: *** [arch/arm64/Makefile:172: dtbs] Error 2
make[1]: *** Waiting for unfinished jobs....
 

newbit

Senior Member
Nov 16, 2008
116
56
58
ebrahimwaleed said:
update 2
after following all you steps now when i compile the kernel with FIRMWARE_sdm660_64_defconfig there are 2 missing drivers i will dump the kernel.img from the phone and try to unpack it and provide it in a link idk but i think it might help
Yeah as I said, the drivers didn't compile. So I didn't commit them in the source. If you found the right ones, I am happy to commit them in the source
and fix other issues as long they are in my capabilities.

ebrahimwaleed said:
after doing some researches about the CFI from what i have found the cfi stands for Control flow integrity please can you have a look here...
This is pretty much the same I've already posted at last. Unfortunately none of them is mentioning the cfi.so or how to use it in the GCC Toolchain way. So I guess this must be some "old" way to integrate it, and nowadays this happens within CLANG or so. I don't know. I could need someone
explain it to me in detail.

@tohtorin and @Sid127,
I would take a close look into the build.config files. Especially the build.config.common and build.config.aarch64
On my experience, and I am pretty new to this, 95% of the information you need is within the kernel source itself.
I.e.
Code:
BRANCH=android-4.19-q
KERNEL_DIR=common
CC=clang
CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-r365631c/bin
EXTRA_CMDS=''
STOP_SHIP_TRACEPRINTK=1
LD=ld.lld
Code:
ARCH=arm64
CLANG_TRIPLE=aarch64-linux-gnu-
CROSS_COMPILE=aarch64-linux-androidkernel-
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin
FILES="arch/arm64/boot/Image.gz vmlinux System.map"
Lets assume the Kernel is supposed to run on Android 11, I would choose the branch android-11.0.0_r28 for the CLANG Toolchain.
At the end i think it just matters, to get the closest version that matches the one your kernel was build with. More details later.
Code:
mkdir workdir && cd workdir
git clone https://github.com/OnePlusOSS/android_kernel_oneplus_sm8250.git kernelsource
CLANGVER=clang-r365631c
ANDROIDBRANCH=android-11.0.0_r28

mkdir $CLANGVER && cd $CLANGVER
wget https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/$ANDROIDBRANCH/$CLANGVER.tar.gz
tar -xzf $CLANGVER.tar.gz && cd ..

git clone \
    -b $ANDROIDBRANCH \
    --single-branch https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9

cd kernelsource
export ARCH=arm64
export CLANG_TRIPLE=aarch64-linux-gnu-
export CROSS_COMPILE=aarch64-linux-androidkernel-
export LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=$(pwd)/../aarch64-linux-android-4.9/bin
export CLANG_PREBUILT_BIN=$(pwd)/../$CLANGVER/bin
BUILDPARAMS="CC=clang LD=ld.lld EXTRA_CMDS='' STOP_SHIP_TRACEPRINTK=1"
export PATH=$PATH:$LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN:$CLANG_PREBUILT_BIN

make $BUILDPARAMS mrproper
I can't say if you have to use these exports or not. Don't know what they mean and couldn't find them in the kernel so far,
but please point me where to look.
Code:
export SUBARCH=arm64
export DTC_EXT=dtc
Using the /proc/config.gz would be definitely my absolute first choice to take as a defconfig.
Inside the workdir with a running adb connection you can go with:
Code:
adb pull /proc/config.gz
gunzip -k config.gz
## copy it after mrproper ##
cp ../config .config
If you want to create a defconfig file for the future use this:
Code:
make savedefconfig
mv defconfig arch/x86/configs/adb_pulled_oneplus_sm8250_defconfig
rm .config
make $BUILDPARAMS adb_pulled_oneplus_sm8250_defconfig
If you have an extracted kernel from your boot.img or extracted firmware image,
unpacked with Android Image Kitchen from @osm0sis,
you can get straight to the defconfig with:
Code:
scripts/extract-ikconfig boot.img-zImage > FIRMWARE_oneplus_sm8250_defconfig
I expect that you have to make some minor changes to the defconfig, like changing the certs or so.
Finally let it run with time make $BUILDPARAMS -j$(nproc)
(I like the time command, so I know how long it took to build it)

If they are popping up questions, I am just guessing, with the less possibility to impact anything bad.

Regarding the kernel details from your phone itself. You can try to get the actually Kernel Boot Messages after a reboot of your phone.
Code:
adb shell
su
cat /proc/kmsg  > /data/data/com.android.shell/logfile.txt
### after 60sec or less cancel the cat command ###
exit
exit
adb pull /data/data/com.android.shell/logfile.txt
All the really important stuff is written right after [ 0.000000] i.e.
Code:
[    0.000000] Linux version 5.4.61-android11-2-00064-g4271ad6e8ade-ab6991359 ([email protected]) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Mon Nov 23 17:45:44 UTC 2020
Sorry about your Errors, can't tell you anything about to fix it.
Cheers
NewBit
 
Last edited:

tohtorin

Senior Member
Jun 22, 2016
148
118
53
Lammi
www.drg.fi
I managed to get it compiled (needed few commits from another great op8 devs around the github) and it boots now. But now I am facing a new issue. It would not load default modules and my wifi wont work and probably lots of other stuff as well.

Even this commit did not help:


When running insmod / modprobe I get warning about Required key not available.

Here is my dmesg attached from that kernel.

EDIT:

I think this is related somehow to this:

Building the GKI modules
Android 11 introduced GKI, which separates the kernel into a Google-maintained kernel image and vendor-maintained modules, which are built separately.

From https://source.android.com/setup/build/building-kernels
 

Attachments

Last edited:

newbit

Senior Member
Nov 16, 2008
116
56
58
I managed to get it compiled (needed few commits from another great op8 devs around the github) and it boots now. But now I am facing a new issue. It would not load default modules and my wifi wont work and probably lots of other stuff as well.

Even this commit did not help:


Here is my dmesg attached from that kernel.
Yeah was wondering why you choose this kernel source, other people were already complaining about the broken wifi in the issues!
Screen Shot 2021-01-31 at 00.09.10.png

I was assuming you knew already about this and how to fix it.
sorry to hear that it doesn't work for you after all.

I don't think this is GKI related. There is no build.config.gki file in your kernel source.
Also, as far as I understood it, the GKI feature makes it even easier for us to build the kernel,
because we don't have to struggle anymore merging any vendor drivers into the kernel, this is all done by the vendor.
I did build a 5.4 Kernel from an AVD, which was built with GKI, and I totally left it out and it works very well. See my Signature.

Which defconfig file did you use?
Your log file doesn't start from [000000], there is no kernel info in it like I mentioned before.
On the AVD Kernel, it didn't wanted to boot, because the modules won't load. And they didn't load because of the missing localversion string.
After I added that string, it boots just fine.
 
Last edited:

tohtorin

Senior Member
Jun 22, 2016
148
118
53
Lammi
www.drg.fi
Yeah was wondering why you choose this kernel source, other people were already complaining about the broken wifi in the issues!
View attachment 5204145
I was assuming you knew already about this and how to fix it.
sorry to hear that it doesn't work for you after all.

I don't think this is GKI related. There is no build.config.gki file in your kernel source.
Also, as far as I understood it, the GKI feature makes it even easier for us to build the kernel,
because we don't have to struggle anymore merging any vendor drivers into the kernel, this is all done by the vendor.
I did build a 5.4 Kernel from an AVD, which was built with GKI, and I totally left it out and it works very well. See my Signature.

Which defconfig file did you use?
Your log file doesn't start from [000000], there is no kernel info in it like I mentioned before.
On the AVD Kernel, it didn't wanted to boot, because the modules won't load. And they didn't load because of the missing localversion string.
After I added that string, it boots just fine.
I did not notice those issues on github yet.

Seems that it wont load any module on boot. And I think LTE modem is compiled inline and wifi as module and thats why wifi wont work.

When manually trying to load modules it complains something about keys. Should I turn off module signatures?

What other trees I could compile against because this tree is for my device .. ?
 

ebrahimwaleed

Member
Jun 18, 2016
31
3
8
Yeah as I said, the drivers didn't compile. So I didn't commit them in the source. If you found the right ones, I am happy to commit them in the source
and fix other issues as long they are in my capabilities.



This is pretty much the same I've already posted at last. Unfortunately none of them is mentioning the cfi.so or how to use it in the GCC Toolchain way. So I guess this must be some "old" way to integrate it, and nowadays this happens within CLANG or so. I don't know. I could need someone
explain it to me in detail.

@tohtorin and @Sid127,
I would take a close look into the build.config files. Especially the build.config.common and build.config.aarch64
On my experience, and I am pretty new to this, 95% of the information you need is within the kernel source itself.
I.e.
Code:
BRANCH=android-4.19-q
KERNEL_DIR=common
CC=clang
CLANG_PREBUILT_BIN=prebuilts-master/clang/host/linux-x86/clang-r365631c/bin
EXTRA_CMDS=''
STOP_SHIP_TRACEPRINTK=1
LD=ld.lld
Code:
ARCH=arm64
CLANG_TRIPLE=aarch64-linux-gnu-
CROSS_COMPILE=aarch64-linux-androidkernel-
LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin
FILES="arch/arm64/boot/Image.gz vmlinux System.map"
Lets assume the Kernel is supposed to run on Android 11, I would choose the branch android-11.0.0_r28 for the CLANG Toolchain.
At the end i think it just matters, to get the closest version that matches the one your kernel was build with. More details later.
Code:
mkdir workdir && cd workdir
git clone https://github.com/OnePlusOSS/android_kernel_oneplus_sm8250.git kernelsource
CLANGVER=clang-r365631c
ANDROIDBRANCH=android-11.0.0_r28

mkdir $CLANGVER && cd $CLANGVER
wget https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86/+archive/$ANDROIDBRANCH/$CLANGVER.tar.gz
tar -xzf $CLANGVER.tar.gz && cd ..

git clone \
    -b $ANDROIDBRANCH \
    --single-branch https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9

cd kernelsource
export ARCH=arm64
export CLANG_TRIPLE=aarch64-linux-gnu-
export CROSS_COMPILE=aarch64-linux-androidkernel-
export LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN=$(pwd)/../aarch64-linux-android-4.9/bin
export CLANG_PREBUILT_BIN=$(pwd)/../$CLANGVER/bin
BUILDPARAMS="CC=clang LD=ld.lld EXTRA_CMDS='' STOP_SHIP_TRACEPRINTK=1"
export PATH=$PATH:$LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN:$CLANG_PREBUILT_BIN

make $BUILDPARAMS mrproper
I can't say if you have to use these exports or not. Don't know what they mean and couldn't find them in the kernel so far,
but please point me where to look.
Code:
export SUBARCH=arm64
export DTC_EXT=dtc
Using the /proc/config.gz would be definitely my absolute first choice to take as a defconfig.
Inside the workdir with a running adb connection you can go with:
Code:
adb pull /proc/config.gz
gunzip -k config.gz
## copy it after mrproper ##
cp ../config .config
If you want to create a defconfig file for the future use this:
Code:
make savedefconfig
mv defconfig arch/x86/configs/adb_pulled_oneplus_sm8250_defconfig
rm .config
make $BUILDPARAMS adb_pulled_oneplus_sm8250_defconfig
If you have an extracted kernel from your boot.img or extracted firmware image,
unpacked with Android Image Kitchen from @osm0sis,
you can get straight to the defconfig with:
Code:
scripts/extract-ikconfig boot.img-zImage > FIRMWARE_oneplus_sm8250_defconfig
I expect that you have to make some minor changes to the defconfig, like changing the certs or so.
Finally let it run with time make $BUILDPARAMS -j$(nproc)
(I like the time command, so I know how long it took to build it)

If they are popping up questions, I am just guessing, with the less possibility to impact anything bad.

Regarding the kernel details from your phone itself. You can try to get the actually Kernel Boot Messages after a reboot of your phone.
Code:
adb shell
su
cat /proc/kmsg  > /data/data/com.android.shell/logfile.txt
### after 60sec or less cancel the cat command ###
exit
exit
adb pull /data/data/com.android.shell/logfile.txt
All the really important stuff is written right after [ 0.000000] i.e.
Code:
[    0.000000] Linux version 5.4.61-android11-2-00064-g4271ad6e8ade-ab6991359 ([email protected]) (Android (6443078 based on r383902) clang version 11.0.1 (https://android.googlesource.com/toolchain/llvm-project b397f81060ce6d701042b782172ed13bee898b79), LLD 11.0.1 (/buildbot/tmp/tmp6_m7QH b397f81060ce6d701042b782172ed13bee898b79)) #1 SMP PREEMPT Mon Nov 23 17:45:44 UTC 2020
Sorry about your Errors, can't tell you anything about to fix it.
Cheers
NewBit
i guess there is no hope with my kernel , is there any other ways or something or what do you recommend
 
Last edited:

newbit

Senior Member
Nov 16, 2008
116
56
58
Seems that it wont load any module on boot.
This sounds a bit like that extraversion thing a mentioned. In den Kernel messages you could see the kernel itself was
booting, and them when init took over, the stock kernel just kept loading module after module the custom kernel did not.
So it could be worth a shot. Maybe you could perform an AB Compare. Comparing the boot log messages from the stock
kernel with custom kernel, especially when the moduls start. I am still interested in your Kernel [0000000] String and defconfig file
pulled from proc.

And I think LTE modem is compiled inline and wifi as module and thats why wifi wont work.
When manually trying to load modules it complains something about keys. Should I turn off module signatures?
Can't say much about inline and module and signatures. I didn't get this far yet of understanding the whole thing. Sorry

What other trees I could compile against because this tree is for my device .. ?
No Idea!

i guess there is no hope with my kernel , is there any other ways or something or what do you recommend
Well, this might be a bit philosophical, but nothing is really impossible, if you really want it and put the necessary effort to it
to accomplish it.

It turns out, that these missing qcacld-3.0 drivers are kind of common, so merging them into kernels is pretty often documented.
Even @nathanchance has some topics about it and in his telegram help/support group are little guides provided:
Code:
Initial merge:
git remote add qcacld-3.0 https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0
git fetch qcacld-3.0 <TAG>
git merge -s ours --no-commit --allow-unrelated-histories FETCH_HEAD
git read-tree --prefix=drivers/staging/qcacld-3.0 -u FETCH_HEAD
git commit
Updating to a newer tag:
git fetch qcacld-3.0 <TAG>
git merge -X subtree=drivers/staging/qcacld-3.0 FETCH_HEAD
Repeat the above for
qca-wifi-host-cmn  and fw-api as well.
qcacld-3.0 source: https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0
fw-api source: https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/fw-api
qca-wifi-host-cmn source: https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn
So I would recommend to dig deep into this topic on how you merge these drivers into your kernel and keep going.

Cheers
 

ebrahimwaleed

Member
Jun 18, 2016
31
3
8
This sounds a bit like that extraversion thing a mentioned. In den Kernel messages you could see the kernel itself was
booting, and them when init took over, the stock kernel just kept loading module after module the custom kernel did not.
So it could be worth a shot. Maybe you could perform an AB Compare. Comparing the boot log messages from the stock
kernel with custom kernel, especially when the moduls start. I am still interested in your Kernel [0000000] String and defconfig file
pulled from proc.


Can't say much about inline and module and signatures. I didn't get this far yet of understanding the whole thing. Sorry


No Idea!


Well, this might be a bit philosophical, but nothing is really impossible, if you really want it and put the necessary effort to it
to accomplish it.

It turns out, that these missing qcacld-3.0 drivers are kind of common, so merging them into kernels is pretty often documented.
Even @nathanchance has some topics about it and in his telegram help/support group are little guides provided:
Code:
Initial merge:
git remote add qcacld-3.0 https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0
git fetch qcacld-3.0 <TAG>
git merge -s ours --no-commit --allow-unrelated-histories FETCH_HEAD
git read-tree --prefix=drivers/staging/qcacld-3.0 -u FETCH_HEAD
git commit
Updating to a newer tag:
git fetch qcacld-3.0 <TAG>
git merge -X subtree=drivers/staging/qcacld-3.0 FETCH_HEAD
Repeat the above for
qca-wifi-host-cmn  and fw-api as well.
qcacld-3.0 source: https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qcacld-3.0
fw-api source: https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/fw-api
qca-wifi-host-cmn source: https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn
So I would recommend to dig deep into this topic on how you merge these drivers into your kernel and keep going.

Cheers
i cant be more thankful really thank you for all your support and efforts it means alot to me i will start studying it and learn more about kernel compiling and keep trying and if i reached something i will update you ❤
 

tohtorin

Senior Member
Jun 22, 2016
148
118
53
Lammi
www.drg.fi
It was LOCALVERSION issue. Fixed. Now it compiles and boots fine. Wifi working and modules gets loaded.

But I think its weird that you need 10 commits from other people to get stock tree to compile.
 
  • Like
Reactions: newbit

newbit

Senior Member
Nov 16, 2008
116
56
58
It was LOCALVERSION issue. Fixed. Now it compiles and boots fine. Wifi working and modules gets loaded.
But I think its weird that you need 10 commits from other people to get stock tree to compile.
Good Job! Thats very good news, congrats! You should commit this with your defconfig file and close the issues about it.
Not sure If the amount of commits is a meter to define the quality of a stock tree.
Cheers
 
  • Like
Reactions: tohtorin

newbit

Senior Member
Nov 16, 2008
116
56
58
@ebrahimwaleed

Any progress so far?

I ran into a very similar issue the other days on a different project. How ever, I thought I give it another try and I was able to
get the kernel build finished. So it is up to you now to test if its booting your phone and if the wifi is working correctly.

After cloning the repo, you can run the configure gcc toolchain script and source .exports, and then you should be good to go.
Code:
git clone https://github.com/newbit1/ARES_PIE_EMUI9.1.0_opensource.git source
cd source
./configure_gcc_toolchain
source .exports
make ARCH=arm64 distclean
make ARCH=arm64 merge_sdm660_64_defconfig
time make ARCH=arm64 -j$(nproc)
Long story short, I've disintegrated drivers/wlan_driver at all,
merged and integrated the qcom-opensource drivers at first without any Huawei relations.
Until it stoped with some errors only the Huawei stuff could solve.
-> drivers/wlan_driver/hw_qca_decoupled/core/hdd/inc/hdd_auto_config_ini.h
has a lot of headers incl. that are needed.

So I used the awesome tool Meld to upgrade just the Huawei related changes from wlan_driver
to the staging/qcacld-3.0. sudo apt install meld
Especially the folder drivers/wlan_driver/core had a lot of those Huawei related changes.
So If you run into some driver issues not working properly or so, this would be your first place to look at.

@IMM02
check out your file arch/arm64/boot/Makefile
In there should be something like this
Code:
install: $(obj)/Image
    $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
    $(obj)/Image System.map "$(INSTALL_PATH)"

zinstall: $(obj)/Image.gz
    $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
    $(obj)/Image.gz System.map "$(INSTALL_PATH)"

Cheers
NewBit
 
Last edited:

IMM02

Member
Jan 16, 2021
5
2
13
indonesia
like this?

#
# arch/arm64/boot/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies.
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 2012, ARM Ltd.
# Author: Will Deacon <[email protected]>
#
# Based on the ia64 boot/Makefile.
#

include $(srctree)/arch/arm64/boot/dts/Makefile

OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S

targets := Image Image.gz

DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE_NAMES))
ifneq ($(DTB_NAMES),)
DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
else
DTB_LIST := $(dtb-y) $(dtbo-y)
endif
DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST))

$(obj)/Image: vmlinux FORCE
$(call if_changed,objcopy)

$(obj)/Image.bz2: $(obj)/Image FORCE
$(call if_changed,bzip2)

$(obj)/Image-dtb: $(obj)/Image $(DTB_OBJS) FORCE
$(call if_changed,cat)

$(obj)/Image.gz: $(obj)/Image FORCE
$(call if_changed,gzip)

$(obj)/Image.lz4: $(obj)/Image FORCE
$(call if_changed,lz4)

$(obj)/Image.lzma: $(obj)/Image FORCE
$(call if_changed,lzma)

$(obj)/Image.lzo: $(obj)/Image FORCE
$(call if_changed,lzo)

$(obj)/Image.gz-dtb: $(obj)/Image.gz $(DTB_OBJS) FORCE
$(call if_changed,cat)

install:
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image System.map "$(INSTALL_PATH)"

zinstall:
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image.gz System.map "$(INSTALL_PATH)"
 
  • Like
Reactions: newbit

newbit

Senior Member
Nov 16, 2008
116
56
58
install:
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image System.map "$(INSTALL_PATH)"

zinstall:
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image.gz System.map "$(INSTALL_PATH)"
So i double checked my build, and it also has just the image.gz file.
do you have a link to your repo with a build readme?
 

adeii

Senior Member
Nov 11, 2013
333
83
58
Sajlent Hil
Is there any easier way for upgrading msm8937 kernel 3.18.140 to 4.4 or 4.9. ???
Simple compiling LA.UM.8.6.2.r2-02100-89xx.0 with GCC7 or GCC10 with working 3.18.140 defconfig can not be done without a bunch of errors. And merging with 3.18.140 will do for few months.
 

adeii

Senior Member
Nov 11, 2013
333
83
58
Sajlent Hil
there are only files "image and image.gz"
Image.gz could be zImage you looking for.
I got arch/arm64/boot/Image.gz-dtb as compiled zImage.
For full kernel, I unpack stock kernel with mktools,
replace zImage,
edit kernel.img-cmdline to userdebug and permissive,
edit kernel.img-oslevel and -osversion according to current OS,
delete kernel.img-avb1 check and repack kernel.
 

newbit

Senior Member
Nov 16, 2008
116
56
58
Image.gz could be zImage you looking for.
I got arch/arm64/boot/Image.gz-dtb as compiled zImage.
Yeah I think so too. But I noticed the missing $(obj)/Image after install: though.
Not sure what difference it does. But without the kernel source, it is like magic 8 balling anyway.
For full kernel, I unpack stock kernel with mktools,
replace zImage,
edit kernel.img-cmdline to userdebug and permissive,
edit kernel.img-oslevel and -osversion according to current OS,
delete kernel.img-avb1 check and repack kernel.
For this I just use the Android Image Kitchen from @osm0sis.
It couldn't be more easy.
Why are you setting the userdebug ? I just replace the kernel file and repack it, done.
But would be nice to know what the benefits of these changings are.
adeii said:
Is there any easier way for upgrading msm8937 kernel 3.18.140 to 4.4 or 4.9. ???
Simple compiling LA.UM.8.6.2.r2-02100-89xx.0 with GCC7 or GCC10 with working 3.18.140 defconfig can not be done without a bunch of errors. And merging with 3.18.140 will do for few months.
I've never managed to upgrade even one sublevel, so can't say anything helpful.
But what Is your hoped benefit for your task? Fixing a bunch of errors seems nice to me in contrast of a month work!
Perhaps a single patch that fixes your actually problem will do it as well?
 
  • Like
Reactions: adeii and osm0sis

adeii

Senior Member
Nov 11, 2013
333
83
58
Sajlent Hil
@newbit
There are no special reason for "userdebug" or "eng" instead "user", I guess that has more freedom for advanced user.
Sublevel patches were successful from 3.18.66. But I would like to test custom roms (A10, A11) and I heard that many roms not work, because old kernel and/or old vendor (A8.0). And yes, I agree that fixing errors and adding features are much more nicer. Also using osm0sis' AIK on Windows, but never used on Linux yet.