[Letux-kernel] How to build LetuxOS Android Kernel for LetuxOS Replicant 4.2?
H. Nikolaus Schaller
hns at goldelico.com
Sat Jun 29 19:49:30 CEST 2019
Hi Andreas,
> Am 29.06.2019 um 09:37 schrieb Andreas Kemnade <andreas at kemnade.info>:
>
> On Sat, 29 Jun 2019 09:20:16 +0200
> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
>
>>> 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
>
> fixed in commit
> commit 7831c02e7ec2a40e6b15065441234509cc49a8c3
> Author: Andreas Kemnade <andreas at kemnade.info>
> Date: Thu Apr 27 21:37:48 2017 +0200
>
> load_modules.sh: add parameter allow_usb=1
>
> usb current was limited to 100mA, fix that
>
>
> but not in the image... I guess I really should try to rebuild it.
Fine! I can cherry-pick that into a new letux-4.10.5-replicant tree.
And the patch for the firmware load path.
But the cmdline looks like:
CONFIG_CMDLINE="console=ttyO2,115200n8 vram=12M omapfb.vram=0:8M,1:4M omapfb.rotate_type=0 omapdss.def_disp=lcd rootwait twl4030_charger.allow_usb=1 musb_hdrc.preserve_vbus=1 log_buf_len=8M ignore_loglevel earlyprintk"
|root at android:/ # cat /proc/cmdline
console=ttyO2,115200n8 mtdoops.mtddev=omap2.nand ubi.mtd=4 root=/dev/mmcblk0p1 rw rootfstype=ext4,ext3 rootwait console=ttyO2,115200n8 vram=12M omapfb.vram=0:8M,1:4M omapfb.rotate_type=0 omapdss.def_disp=lcd rootwait twl4030_charger.allow_usb=1 musb_hdrc.preserve_vbus=1 log_buf_len=8M ignore_loglevel earlyprintkroot at android:/ # fgrep twl4030_charger /system/load_modules.sh
modprobe twl4030_charger
root at android:/ #
Is this ignored for manual/script modprobe?
BR,
Nikolaus
More information about the Letux-kernel
mailing list