mainline linux kernel - RAZR i Android Development

I found out that recent versions of the mainline linux kernel can boot on our motorola razr-i without any additional patches. Most of the hardware doesn't work. Only usb and emmc drivers are working. Maybe I or someone else can try if I get some more hardware working. To this post, I attached the kernel config file I used in my builds and the initramfs init script which I used for debugging. So if somebody wants to see the 4.18 kernel running he can use this files.

Related

why hasnt anyone compiled modules for new ics kernel.

This is the edit to make modules work in the new kernel you must make the edit in the config.gz, tgen recompile the kernel with the new config
ACTIVATING MODULE LOADING SUPPORT IN THE KERNEL
Module loading support is previously disabled in the kernel, if we want to load modules in the kernel we have to enable it:
edit .config file and set: CONFIG_MODULES=y
We have the new ics, but no overclock or webtop without dock, and some other issues that tge older roms have. And its not because the new leaksare locked. Someone is just lazy or ignorant. So here it goes
You will need alot of free space 100GB or more of free space NO JOKE.
First go here: http://source.android.com/source/initializing.html
You may want androids kernel or cyanogens
androids kernel: http://android.git.kernel.org/
$git clone git://android.git.kernel.org/kernel/common
We check which branch we have downloaded: $git branch it shows * android-2.6.27, not the one we are searching for:
To list all remote available branches: $git branch -r
This is only refernce the kernel number for the bionic is up to 3.0 so when you git branch-r choose one for the bionic
$git checkout --track -b android-goldfish-2.6.29 origin/android-goldfish-2.6.29 $git branch
Cyanogens Follow all steps and restart computer then go here: http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
After you have installed everything you are ready to create a complete distro from scratch.
Now go to adb and pull your working config.
adb pull /proc/config.gz
$gunzip config.gz # uncompressit. $cp config .config # renameitinto.config
Now you can edit .config file the way it suits you the most.
But really all we want is the modules for overclock and symsearch to be compiled for our new kernel
CROSS_COMPILE environment variable stores the path to the arm cross compiling toolchain. I use the one which comes with android source code.
$ARCH=arm CROSS_COMPILE=/path/to/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
Executing make will build the kernel.
Last lines will show:
Kernel: arch/arm/boot/Image is ready Kernel: arch/arm/boot/zImage is ready
So we have obtained Image and zImage kernel binary files.
ACTIVATING MODULE LOADING SUPPORT IN THE KERNEL
Module loading support is previously disabled in the kernel, if we want to load modules in the kernel we have to enable it:
edit .config file and set: CONFIG_MODULES=y
$ ARCH=arm CROSS_COMPILE=/path/to/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
I am asked about some options when executing make. I ask yes for module related options.
After compiling I see several modules have been built.
MODPOST 6 modules CC drivers/video/fb_sys_fops.mod.o LD [M] drivers/video/fb_sys_fops.ko CC drivers/video/syscopyarea.mod.o LD [M] drivers/video/syscopyarea.ko CC drivers/video/sysfillrect.mod.o LD [M] drivers/video/sysfillrect.ko CC drivers/video/sysimgblt.mod.o L drivers/video/sysimgblt.ko CC drivers/video/vfb.mod.o LD [M] drivers/video/vfb.ko
Ok so now we have a kernel that supports modules, but we still need the overclock.so or opptimizer.so compiled for this kernel. This is wete I stop because I dont have any of those modules and this was merely for information really. To get someone to compile our kernel for modular support.
I'm not even sure how Motorola phone devs even get the option to recompile the kernels seeing as how the locked bootloader doesn't let us modify the stock kernel in any way.
If/when we get Kexec, I could see this being an option, however.
It is easy to compile the kernel and edit it and even put it to the motorola droid.
There is actualy 2 ways not just 1.
1. first use follow steps compile kernel and apply it to a boot.img using an android-kitchen.( google android-kitchen) Once you allpy it to a boot.img we can flash in recovery or use an rsd lite and flash using the .xml just replace the boot.img with the modified kernel boot.img. The boot.img for the .875 is 8.3 megs as is the .902 boot.img.
2. use any kernel updater from kuash in recovery wich will replace the current zImage with the new kernel compiled in the steps you just followed.(google android any kernel updater)
So Like I said why hasnt anyone compiled a new kernel.
The Motorola Droid has an unlocked bootloader. The Droid Bionic does not. That is why kernel development barely ever happens on Moto devices.
Feel free to try to flash unsigned images to your Bionic. Let us know how that goes.

Wifi Driver doesn't work

I'm a developer of China, and my mobile type is XT1079(MOTO G 2014), I tyied to compile a linux kernel to replace the origin kernel, and I used the project provided by Motorala in github(https://github.com/MotorolaMobilityLLC/kernel-msm/tree/MMI-LXB22.46-28).And[/url] I edit the config file based on the "furnace" kernel config.
After I finishing compiling and replacing my kernel. I found the wifi doesn't work, there is a wifi.ko will be loaded, so I downloaded the opensource drvier(https://github.com/MotorolaMobilityLLC/vendor-qcom-opensource-wlan-prima/tree/MMI-LXB22.46-28[/url]), and compiled it.
But it doesn't work, I can get the same info from the kmsg log with the origin wlan.ko, but in wifi configure page it will be blocked and show no AP.
Also, the size of wlan.ko I compiled is 40MB, but the origin wlan.ko file is only 4MB
I don't know how to fix this problem, could you give me some advices?
I doubt that there are something wrong in my kernel config file

Hammerhead CM13 Kali Kexec, driver issues.

Hello XDA,
Im back again with another personal project I'm having some issues with. First, a bit of explanation as to why I've chosen to attempt this.
I was running a heavily modified stock rom with nethunter 5.1.0 that was incredibly unstable, and eventually crashed right out on me (modified using root based apps so the crash was my fault) .
So I grabbed the CM13 snapshot for hammerhead, and layered on nethunter 3.0 (big fan since BT3), only to find out my wifi card isn't supported. On 5.1.0 I also had this issue
(see here http://forum.xda-developers.com)/showpost.php?p=64400679
which I managed to fix with a simple source build with a few extra options checked in menuconfig.
Sadly it doesn't seem to be quite that easy with CM13 and marshmellow.
I'm using the DWA160-b2 wifi adapter, which from my research, uses the rt2800usb chipset, which supposedly points to the rt5572 driver. So, I enabled the corresponding options in menuconfig , although I cant remember the exact wording at this moment (using winblows to write this, and not my linux) and I still have no life in my wifi card.
So, after even more research, I found out I should be able to cross-compile the required drivers using the arm-eabi tools. However, after trying I've come to the conclusion that there is no arm based config for this driver. So then I tried backports, and recieved an error about incomplete linux headers (I assume because of the chroot, because my headers are all installed).
Now finally my question:
How do I go about compiling this driver for arm? Or is there a know working arm driver for this particular card? As I have not come across one in my searching. Also please dont say get a new wifi card lol I have a few different usb wifi cards, all with the same issue (albeit different chipsets).
Are u trying to port kali kexec to cm13 kernel?
Sent from my fx-82MS with CM-CAF

Android kernel for Raspberry pi 2

Can someone help me compile an android 9.0 kernel that will work on raspberry pi 2. I somehow managed to compile the system.img and ramdisk.img from the android source but i am unable to make the kernel run with it. Or may the the kernel is compiled correct and the system image has error.
When i booted up the system i cant get anything on the screen and also there is no activity led blinking.
then i tried a lollipop 5.1 kernel for raspberry pi 2 it atleast gave an activity led blink and the usual rainbow wallpaper that we get while booting the rpi. So i am assuming that the kernel is the problem. As there are not many who work on rpi2 and the last android support was marshmallow i assume because the sources are not updated for rpi2 it isn't booting.
I did the changes in device_brcm_rpi2 and hardware_rpi to work with android pie. After which i was able to compile the system image successfully.
but i didn't do any changes to kernel_rpi repo.
sources that i used:
https://github.com/peyo-hd/device_brcm_rpi2
https://github.com/peyo-hd/device_brcm_rpi3
https://github.com/peyo-hd/local_manifests
https://github.com/peyo-hd/hardware_rpi/tree/pie
https://github.com/peyo-hd/kernel_rpi/tree/arpi-4.19.y
https://github.com/peyo-hd/RpLauncher

Postmarketos for Amazon Fire 7 HD (2017) (Austin)

Working ebuild for installing postmarketos on the Amazon Fire 7 HD (2017) codename Austin
Amazon Fire 7 (2017) postmarketOS Armv7l Mediatek MT8127 Mali-450MP4 600x1024 display 1GB RAM Linux 3.10.54
What seems to work:
Boot Touch screen Battery percentage Usb internet OTG usb Wayland, Mate, Xfce4, Lxde, Sxmo, i3wm
Does NOT work:
Wifi & Bluetooth (no drivers) GPU acceleration (drivers do not work) Audio Sleep and fully turning off the display Screen rotation Wifi adapter does not work even with drivers and kernel support, mobo support issue(?) FDE Cameras You tell me
Special options: *Must be flashed to USERDATA partition as system partition is too small
msm-fb-refresher packaged is added to the depends to make the screen refresh. After flashing the device must be booted into recovery once. From the recovery it is to be powered off and booted and then as normal. This is because the device depends on the AMONET exploit which is applied by twrp after every flash.
Flashing Instructions
This assumes that you already have linux installed and the bootloader on the tablet is unlocked. Don't worry if it looks complicated. If you are unsure of something ask on the postmarketos matrix or leave a comment for help.
Install pmbootstrap as stated in the postmarketos wiki, does not matter which options or device you pick.
Once that is done download and drag the two folders in the git repo into "/home/YOURUSER/.local/var/pmbootstrap/cache_git/pmaports/device/testing/" also displayed as "~/.local/var/pmbootstrap/cache_git/pmaports/device/testing".
Run pmbootstrap init and select amazon as manufacture and austin as the device, mate, lxde, xfde, are confirmed working.
Run pmbootstrap install
Boot into twrp and wipe all partitions including data
Boot into the hacked bootloader from the twrp options
Run pmbootstrap pmbootstrap flasher flash_rootfs --partition userdata (system partion is too small to flash!) and once it is done flashing run pmbootstrap flasher flash_kernel
Unplug the device, wait 10 seconds and then hold the power button. Once it is powered on YOU MUST boot it into twrp at least once as it needs to restore the AMONET exploit, until you do that the device will not boot.
Issues
If something does not work such as the display rotated wrong or device not booting just comment or open an issue, I changed the rotation of the display in the kernel options to horizontal but i did not test the effects as I already have android with books on it.
Reinstall android/lineage
Simple as cake, just boot into twrp wipe all partions(some will fail), you may need to resize and fix until it starts working. You just need the system and data partitions to be reformated to ext4 even if they already are. Then just flash the lineageos zip file and reboot the device normally(amonet is fine)
GitHub - GjergjiFloychi/amazon-austin-pmaports: Working ebuild for installing postmarketos on the Amazon Fire 7 HD (2017) codename Austin
Working ebuild for installing postmarketos on the Amazon Fire 7 HD (2017) codename Austin - GitHub - GjergjiFloychi/amazon-austin-pmaports: Working ebuild for installing postmarketos on the Amazon ...
github.com
This looks promising, nice job. I will try installing it on my Austin during the next days.
Rortiz2 said:
This looks promising, nice job. I will try installing it on my Austin during the next days.
Click to expand...
Click to collapse
Good luck. Tell me if the display works if you do install it. Thanks
hexdump0815 cleaned up the config file, use his fork if you are going to install.​
Is it wifi working? It'll awesome
Baonks81 said:
Is it wifi working? It'll awesome
Click to expand...
Click to collapse
Unfortunately the drivers for this SOC are nonexistent so nothing works. WIfi and hdmi adapters don't work, but OTG does. Hexdump made a Debian and Ubuntu image for this tablet, it is great but the tablet is mostly useless without WiFi and GPU support. You can also flash the main image to the userdata partition instead of using an SD Card, but if I remember correctly the rootfs won't auto extend. It would have been great to use this as a linux tablet, however this SOC is uncommon and is not supported by any Linux maintainer. https://github.com/hexdump0815/imagebuilder/releases/tag/211101-02
Fandroid Tech said:
Unfortunately the drivers for this SOC are nonexistent so nothing works. WIfi and hdmi adapters don't work, but OTG does. Hexdump made a Debian and Ubuntu image for this tablet, it is great but the tablet is mostly useless without WiFi and GPU support. You can also flash the main image to the userdata partition instead of using an SD Card, but if I remember correctly the rootfs won't auto extend. It would have been great to use this as a linux tablet, however this SOC is uncommon and is not supported by any Linux maintainer. https://github.com/hexdump0815/imagebuilder/releases/tag/211101-02
Click to expand...
Click to collapse
Thanks for new information. I'll searching around
I think we can find firmware it out on /dev/mmcblk---
Baonks81 said:
Thanks for new information. I'll searching around
I think we can find firmware it out on /dev/mmcblk---
Click to expand...
Click to collapse
I looked at the firmware dump on github, it is all proprietary and seems to be compatible only on android. The closest I got to getting working wifi was moving the original libs and networkmanager bin to linux however it only showed wifi working for a few seconds without detecting anything.
I'm working on this device right now. I just downloaded the repository below, and I will make a pull/merge request upstream soon.
Fandroid Tech said:
GitHub - GjergjiFloychi/amazon-austin-pmaports: Working ebuild for installing postmarketos on the Amazon Fire 7 HD (2017) codename Austin
Working ebuild for installing postmarketos on the Amazon Fire 7 HD (2017) codename Austin - GitHub - GjergjiFloychi/amazon-austin-pmaports: Working ebuild for installing postmarketos on the Amazon ...
github.com
Click to expand...
Click to collapse
I have my own fork of the pmaports repository at https://gitlab.com/Worldblender/pmaports, where I will push your files (eventually with my changes) to. Maybe we can work together on getting this tablet supported upstream, if you still want to (anything else that isn't working, like the Wi-Fi/Bluetooth, will have to come later).
UPDATE: Well, I'm going to use https://github.com/hexdump0815/pmaports-amazon for the config now, didn't notice it the first time around. I also noticethat it's possible to get Wi-Fi working with https://github.com/hexdump0815/imagebuilder-firmware/blob/main/tablet_amazon_austin-firmware.tar.gz, that I will try out with my builds soon.
From https://github.com/hexdump0815/imagebuilder/tree/main/systems/tablet_amazon_austin:
wifi seems to work by using the android firmware and tools in a minimal android bionic chroot env
wifi can be stated via /scripts/start-wifi.sh
uncomment the start of this script in /etc/rc.local in case wifi should be enabled by default
wifi support was added in february 2022, so all images from before do not have it yet but it can be added easily afterwards
Click to expand...
Click to collapse
Worldblender said:
I'm working on this device right now. I just downloaded the repository below, and I will make a pull/merge request upstream soon.
I have my own fork of the pmaports repository at https://gitlab.com/Worldblender/pmaports, where I will push your files (eventually with my changes) to. Maybe we can work together on getting this tablet supported upstream, if you still want to (anything else that isn't working, like the Wi-Fi/Bluetooth, will have to come later).
UPDATE: Well, I'm going to use https://github.com/hexdump0815/pmaports-amazon for the config now, didn't notice it the first time around. I also noticethat it's possible to get Wi-Fi working with https://github.com/hexdump0815/imagebuilder-firmware/blob/main/tablet_amazon_austin-firmware.tar.gz, that I will try out with my builds soon.
From https://github.com/hexdump0815/imagebuilder/tree/main/systems/tablet_amazon_austin:
Click to expand...
Click to collapse
You could package the wifi hack into an Alpine Linux for firmware package if you want. Debian 11 runs really well, to bad we can't get everything working.
Fandroid Tech said:
You could package the wifi hack into an Alpine Linux for firmware package if you want. Debian 11 runs really well, to bad we can't get everything working.
Click to expand...
Click to collapse
Will work on that soon. I just got a build to boot today, and basic functionality seems to be working. I'm going to try a different distro for accessing more functionality (likely Ubuntu 20.04 or 22.04) I just opened up a merge request at https://gitlab.com/postmarketOS/pmaports/-/merge_requests/3251 for the progress on upstreaming.
I'm thinking about using the exact same kernel that the LineageOS image uses:
https://github.com/cm14-mt8127/device_amazon_mt8127-common
https://github.com/cm14-mt8127/kernel_amazon_mt8127-common
This kernel has been updated to 3.10.108, and it's the last one for the 3.10 branch. I'm going to try creating a new build using this kernel, and see how it goes.
Worldblender said:
I'm thinking about using the exact same kernel that the LineageOS image uses:
https://github.com/cm14-mt8127/device_amazon_mt8127-common
https://github.com/cm14-mt8127/kernel_amazon_mt8127-common
This kernel has been updated to 3.10.108, and it's the last one for the 3.10 branch. I'm going to try creating a new build using this kernel, and see how it goes.
UPDATE: Three patches would not apply successfully for this kernel:
fix-host-card-inserted.patch
silence-power-logspam.patch
silence-thermal-logspam.patch
After building without these patches, the kernel boots, but it stays stuck without being able to process further, with some kernel messages displayed. I wonder what I should do to get this kernel working, or if this one shouldn't be used.
Click to expand...
Click to collapse
Use any kernel you want. It literally does not matter as it cannot be mainliner in the future anyways. It makes no difference what you use.
Fandroid Tech said:
Use any kernel you want. It literally does not matter as it cannot be mainliner in the future anyways. It makes no difference what you use.
Click to expand...
Click to collapse
Here's my results after building and boot it:
There are some kernel messages that pop up, and the splash screen never appears. It doesn't matter whether there is a microSD card inserted or not; there seems to be too many changes made to it from 3.10.54 to 3.10.108, along with additional changes that are designed more for Android/LineageOS usage. Finding every one of them is too much work for me.
Three patches would not apply successfully for this kernel:
fix-host-card-inserted.patch (will apply successfully once the entry for line 271 is removed)
silence-power-logspam.patch
silence-thermal-logspam.patch
Again, after building without these patches, the kernel boots, but it stays stuck without being able to proceed further, with some kernel messages displayed. I tried building without any of the patches shipped, but the end result is still the same. I need some help as to what what I should do to get this kernel working, or else I will go back to the 3.10.54 kernel that I know is actually booting to the splash screen. Here, I don't care whether I use a mainline kernel here, since I know the SOC is not supported by mainline. I simply care that I can get a newer kernel version working (from 3.10.54 to 3.10.108), unless there's too many changes for me to go through.
Worldblender said:
Here's my results after building and boot it:
There are some kernel messages that pop up, and the splash screen never appears. It doesn't matter whether there is a microSD card inserted or not; there seems to be too many changes made to it from 3.10.54 to 3.10.108, along with additional changes that are designed more for Android/LineageOS usage. Finding every one of them is too much work for me.
Three patches would not apply successfully for this kernel:
fix-host-card-inserted.patch (will apply successfully once the entry for line 271 is removed)
silence-power-logspam.patch
silence-thermal-logspam.patch
Again, after building without these patches, the kernel boots, but it stays stuck without being able to proceed further, with some kernel messages displayed. I tried building without any of the patches shipped, but the end result is still the same. I need some help as to what what I should do to get this kernel working, or else I will go back to the 3.10.54 kernel that I know is actually booting to the splash screen. Here, I don't care whether I use a mainline kernel here, since I know the SOC is not supported by mainline. I simply care that I can get a newer kernel version working (from 3.10.54 to 3.10.108), unless there's too many changes for me to go through.
Click to expand...
Click to collapse
Just use the stock 3.10.54 kernel. Both versions have long since been EOL. It does not matter what is used as functionality will still the same, both now and any future development. I would not bother upgrading the kernel to 3.10.108. Hexdump told me a while back that somebody else maintaining a similar soc on the mainline branch told him that mainlining the device is almost impossible due to some proprietary components by Amazon. I am not entirely sure as to the validity of this claim but I think that it is not worth the effort of upgrading the kernel of this device. Check this page for more info, I found it to be very helpful to my port. https://wiki.postmarketos.org/wiki/Amazon_Fire_7_2015_(amazon-ford)
[waits eagerly nonetheless]
This is a solid old device in a lot of ways. I'd love to see it supported by PMOS.

Categories

Resources