OESF Portables Forum

Model Specific Forums => Cosmo Communicator => Cosmo Communicator - Android => Topic started by: Varti on August 03, 2020, 05:27:50 am

Title: List of Android kernel repositories and a guide on how to compile modules
Post by: Varti on August 03, 2020, 05:27:50 am
Here's the official repository of the Android kernel for the Cosmo:

https://github.com/dguidipc/cosmo-android-kernel

Though it seems to be not compilable since some files are missing from it. Here's an more updated repository which should be easier to compile:

https://github.com/deadman96385/android_kernel_planet_mt6771

The Cosmo Gemian Linux kernel has also an Android branch:

https://github.com/gemian/cosmo-linux-kernel-4.4
https://github.com/gemian/cosmo-linux-kernel-4.4/commits/android

And lastly, a guide on how to setup the compiler and to compile missing modules:

https://www.mygnu.de/2020/02/exfat-support-for-the-cosmo-communicator/

If anyone has more updated info on the matter feel free to share! Thanks to the guys on @GeminiPDA on Telegram for the above links.

Varti
Title: Re: How to compile the Android kernel
Post by: dst6se on August 04, 2020, 03:54:56 pm
Hi !

Im trying to compile ftdi_sio module for android kernel !

Im doing like this

git clone https://github.com/deadman96385/android_kernel_planet_mt6771.git KERNEL
make O=../KERNEL_OUT -C KERNEL ARCH=arm64 k71v1_64_bsp_defconfig
cd KERNEL
make O=../KERNEL_OUT ARCH=arm64  CC=clang  CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-gnu- menuconfig
make -j4 O=../KERNEL_OUT ARCH=arm64  CC=clang  CLANG_TRIPLE=aarch64-linux-gnu- CROSS_COMPILE=aarch64-linux-gnu- modules

but when trying to do a insmod on the .ko files I got Exec format error

here is the modinfo

root@homer:/opt/cosmo/KERNEL_OUT/drivers/usb/serial# modinfo ./usbserial.ko
filename:       /opt/cosmo/KERNEL_OUT/drivers/usb/serial/./usbserial.ko
author:         Greg Kroah-Hartman <gregkh@linuxfoundation.org>
description:    USB Serial Driver core
license:        GPL
vermagic:       4.4.146+ SMP preempt mod_unload modversions aarch64
intree:         Y
depends:
srcversion:     319AD7A689B7B86CC90F0E9
parm:           product:User specified USB idProduct (ushort)
parm:           vendor:User specified USB idVendor (ushort)

and

filename:       /opt/cosmo/KERNEL_OUT/drivers/usb/serial/./ftdi_sio.ko
author:         Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>, Andreas Mohr, Johan Hovold <jhovold@gmail.com>
description:    USB FTDI Serial Converters Driver
license:        GPL
vermagic:       4.4.146+ SMP preempt mod_unload modversions aarch64
intree:         Y
depends:        usbserial


Have i done something wrong ?

Title: Re: How to compile the Android kernel
Post by: cam1965 on August 04, 2020, 05:44:58 pm
Problem is that your android kernel was compiled from a different version of the kernel source you have downloaded. Try another branch of the kernel source. Or compile the full kernel from the kernel source you have downloaded and install it. This is a risk of course (to  install a compiled kernel in android ). In linux I had  success doing this. But in android I have never tried. Good luck.

Note : From my android

$ uname -a
Linux localhost 4.4.146 #2 SMP PREEMPT Mon Jul 6 19:51:17 CST 2020 aarch64 Android

So, you can see that is different from your compiled version.
Title: Re: How to compile the Android kernel
Post by: dst6se on August 05, 2020, 06:21:32 am
Oki , i see , thanks for the help !
Title: Re: List of Android kernel repositories and a guide on how to compile modules
Post by: drbytes on September 11, 2020, 04:38:20 am
https://www.oesf.org/forum/index.php?topic=36319.0

Also works for android, obviously :)
Title: Re: List of Android kernel repositories and a guide on how to compile modules
Post by: innerfrost on September 27, 2022, 09:52:38 am
Hello Guys,

I just want to add support of external Wi-Fi adaptors like tp-link or Alfa. Any advice how to do that?