[Letux-kernel] How to build LetuxOS Android Kernel for LetuxOS Replicant 4.2?

H. Nikolaus Schaller hns at goldelico.com
Sat Jun 29 09:20:16 CEST 2019


> Am 29.06.2019 um 08:37 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> 
> 
>> Am 28.06.2019 um 19:38 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
>> 
>> Hi,
>> 
>>>> 
>>>> find -name "*.ko" -exec mv \{\} /path/to/system/lib/modules \;
>>> 
>>> That is what I had tried first but it did not load any module...
>>> Maybe it needs a special depmod to be run.
>>> 
>>>> not worth searching for.
>> 
>> Looks as if I have found something:
>> 
>> https://android.googlesource.com/device/asus/fugu/+/b01b7fd/AndroidKernel.mk#102
>> 
>> This does the "find -exec cp" but then runs a depmod. KERNEL_FAKE_DEPMOD seems to be a (broken?) symlink to help to create proper file names.
>> 
>> And, we might have an AndroidKernel.mk as well.
> 
> I haven't found one but there is load_modules.sh:
> 
> 	http://git.goldelico.com/?p=letux-replicant-device.git;a=blob;f=rootdir/load_modules.sh;h=73c6c9255b655207ec422a3590646eb67cb769a6;hb=refs/heads/replicant-4.2-v2
> 
> This script seems to modprobe everything which is needed - at least in Letux-replicant-4.2-v2
> 
> I have done some more checks on the 4.6 kernel (Linux localhost 4.6.0-letux+ #1 SMP PREEMPT Sat Jun 18 21:04:58 CEST 2016 armv7l GNU/Linux) that works.
> 
> * the above mentioned script is installed in /system
> * kernel modules are loaded
> * there is no sd8686_v8_helper.bin at all and therefore, loading WiFi firmware must fail...
> * if I build work/lukas/android-4.10 and flatten the kernel modules and patch it over the replicant-kernel-4.6 rootfs I can boot!
> * there is only a handful of kernel modules automatically loaded
> * but if I manually run /system/load_modules.sh the panel starts working!
> * not fully. touch is not working, a Linux console cursor is blinking and the home button is missing
> * WiFi is still not working, but that is the missing firmware in the replicant-kernel-4.6 rootfs
> 
> So I may be able to create an SD card with replicant-kernel-4.10 and patch in a newly compiled kernel potentially with fixes.
> Hopefully the kernel panics will go away and WiFi come up...
> 
> Since I have uploaded the kernel to the downloads server makesd should now be able to create a new mixed system:
> 
> 	makesd replicant -r http://download.goldelico.com/letux-replicant/4.2/20170423-kernel-4.10-replicant.tbz -kboot http://download.goldelico.com/letux-kernel/work/lukas/android-4.10-replicant/uImage -dboot http://download.goldelico.com/letux-kernel/work/lukas/android-4.10-replicant/device-trees.tbz -m http://download.goldelico.com/letux-kernel/work/lukas/android-4.10-replicant/modules.tgz

First test:

* does boot
* modules are not properly loaded
* running /system/load_modules.sh loads some more modules
* modprobe omapdrm remports missing symbols
* running depmod (busybox) seems to fix something :)
* then, /system/load_modules.sh loads the missing modules and the display initializes!
* depmod -n takes quite some time to start printing the module lists and dependencies and finally segfaults
* there is no modules.dep anywhere except /system/lib/modules/modules.dep.bb
* ah well, we also have /system/xbin/depmod which should be used - but that one also segfaults :( Maybe too many or too big kernel modules?
* there is a blinking console cursor in the middle of the screen
* charging works fine - did report that battery is getting low (except not automatically activating screen backlight), played a sound
* plugging in the USB cable made the battery start charging - with 100mA only... I had to do echo 800000 >/sys/class/power_supply/twl4030_usb/input_current_limit to really get it charging
* there seems to be no battery widget (maybe because bq27000 module wasn't loaded *before* Replicant did start)
* trying to turn on WiFi still fails with missing sd8686_helper.bin although available in /system/vendor/firmware

So in summary we still have several severe bugs to fix:
* depmod segfaults and modules are not properly loaded
* console cursor is blinking...
* charging does not switch to higher current
* turning on WiFi does not find firmware

On the good side we have:
* mixing rootfs and kernels through makesd seems to work
* Android can run
* no kernel panics
* it now seems no longer impossible to upgrade LetuxOS-Replicant to maintained longterm kernel(s) v4.14 and v4.19.

BR,
Nikolaus



More information about the Letux-kernel mailing list