Recompile just The Kernel and make boot.img (CM-x86-14.1)

682 views
Skip to first unread message

Din Assegaf

unread,
May 16, 2019, 9:51:40 AM5/16/19
to andro...@googlegroups.com
Hi,

I am interested in modifying kernel on Android X86 in specific version LineageOS CM X86 14.1 
(cm-x86-14.1-r2.iso) so its 32 bit 

I checked its inside the iso kernel version 4.9.95 


But source repo in android-x86 show kernel 
make kernelversion
4.9.152

I compile the kernel, using this
make android-x86_defconfig
make


I force it and make boot.img ... only change the bzImage inside boot.img,
repacked it, it wont boot, only show android, stuck, ... and wont boot in lineage animation as normally.

I checked maybe it repacking make some mistake, I repacked with default bzImage it boot normally, so bzImage new compiled result maybe cause this,

I dont know if different kernel version cause this, I search anywhere didnot found  4.9.95  version,
please enlighten me, I want to modify some kernel source code.

Deen

DDS Central

unread,
May 16, 2019, 10:15:06 AM5/16/19
to Android-x86
You can run "make kernel" to rebuild just the kernel. If you have a compiled build (iso_img or efi_img), do "make iso_img" or "make efi_img" to update your build.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/CAGe49COmmB%2BpD1F%3DJCWJ1LNV7pzu2ODWUf%3DixLp7FBg5nrBR4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Chih-Wei Huang

unread,
May 16, 2019, 10:35:16 PM5/16/19
to Android-x86
Din Assegaf <asseg...@gmail.com> 於 2019年5月16日 週四 下午9:51寫道:
>
> Hi,
>
> I am interested in modifying kernel on Android X86 in specific version LineageOS CM X86 14.1
> (cm-x86-14.1-r2.iso) so its 32 bit
>
> I checked its inside the iso kernel version 4.9.95
>
>
> But source repo in android-x86 show kernel
> make kernelversion
> 4.9.152
>
> I compile the kernel, using this
> make android-x86_defconfig
> make
>
>
> I force it and make boot.img ... only change the bzImage inside boot.img,
> repacked it, it wont boot, only show android, stuck, ... and wont boot in lineage animation as normally.
>
> I checked maybe it repacking make some mistake, I repacked with default bzImage it boot normally, so bzImage new compiled result maybe cause this,

Except bzImage, you need to update /system/lib/modules
to the corresponding kernel as well.
Otherwise all modules won't be loaded.

> I dont know if different kernel version cause this, I search anywhere didnot found 4.9.95 version,
> please enlighten me, I want to modify some kernel source code.

See the release note about how to get the source:

https://www.android-x86.org/releases/releasenote-cm-x86-14-1-r2.html



--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Din Assegaf

unread,
May 19, 2019, 4:55:16 AM5/19/19
to andro...@googlegroups.com
Hi, Thank you for the answer,

is there make command to specifically just make the boot.img (not only the bzImage and modules) so I can transfer it directly to the installed system or via twrp. I asked this command because too many changes on kernel, so testing is needed to go faster.


Deen


On Fri, May 17, 2019 at 9:35 AM Chih-Wei Huang <cwh...@android-x86.org> wrote:
Din Assegaf <asseg...@gmail.com> 於 2019年5月16日 週四 下午9:51寫道:
>
> Hi,
>
> I am interested in modifying kernel on Android X86 in specific version LineageOS CM X86 14.1
> (cm-x86-14.1-r2.iso) so its 32 bit
>

DDS Central

unread,
May 19, 2019, 7:13:03 AM5/19/19
to Android-x86
Android x86 does not use boot.img, but separate kernel and initrd files, like a regular Linux distro.
Also, unlike "native" Android installations, Android x86 is by default configured to build most Linux drivers as modules instead of built-ins.
To update the kernel, you'll need to update the modules in system.img as well, like mentioned before. Otherwise the system either won't boot at all or may have stability issues due to kernel/module mismatch.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.

Din Assegaf

unread,
May 19, 2019, 7:56:13 AM5/19/19
to andro...@googlegroups.com

My mistake, I tought before that lineage built both for arm and x86 is the same, it seem different. I am trying based on my knowledge on built lineage for arm 32 bit, which I just know that it dont use CONFIG_MODULES, so thats why.

Thanks for all the help, 

Deen

Din Assegaf

unread,
May 27, 2019, 7:42:52 PM5/27/19
to andro...@googlegroups.com

Hi,

I made 1 changes on kernel/net/ipv4/ ... 1 file. 


1. When i tried to do "make kernel"  it seem dont detect changes on that file and skip building new bzImage 
============================================
ninja: no work to do.
ninja: no work to do.
No need to regenerate ninja file
ninja: no work to do.

2. when I tried to "make iso_img" it seem also only repackage new iso img file, no information about compiling new kernel, 

3. when I "make clean" and redo recompile from start ...
source build/envsetup.sh
lunch android_x86_64-userdebug
m -j1 iso_img

its working fine the iso img created with changes I have done, but I cannot wait 1 day build just to make 1 file edit, is there anything I can do to force the kernel to be rebuild first before doing repackage iso_img ?

Deen

DDS Central

unread,
May 27, 2019, 8:01:52 PM5/27/19
to Android-x86
Delete the compiled kernel from the build directory and run make kernel.
Out of curiosity, what are you trying to modify ?

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-x86.

Din Assegaf

unread,
May 27, 2019, 8:31:48 PM5/27/19
to andro...@googlegroups.com

Thank you ,
got the file  ls -l out/target/product/x86_64/obj/kernel/arch/x86/boot/bzImage
.... out/target/product/x86_64/obj/kernel/arch/x86/boot/bzImage

seem recompiled well, just need to find out the easy way to send this file as new boot kernel in grub. 

I tried to dump some info to kernel alert, just it. already working on arm64 kernel, 

Deen 

Reply all
Reply to author
Forward
0 new messages