custom kernel for msm8909 - android

Need help. I have a ZTE blade a460 phone with broken screen and i want to make it something usefull like a nfs server. I want a custom compiled kernel so, i extract the config from the original kernel using the extract-ikconfig script. I compile kernel using this config and the original dtbs from ramdisk but the kernel dont bootup. After much trials i think something special is needed. Knows someone what specific is needed for this machine? compiling Modules for the original kernel needs the extra flag -fno-pic. Is needed for the new kernel too? The phone has 3.10.49 kernel and android 5.1.1 Lollipop. I use arm-linux-androideabi-4.8 (the same as they use to compile the original kernel). Adb boot to boot the new image.

Related

Android: Insmod disagrees about version of symbol module_layout

I am attempting to use NFS on my Xiaomi Redmi Note 9S, it uses a custom ROM called Resurrection Remix OS. I am replacing my old kernel with a newly compiled one, with NFS built-in.
I am using the kernel source found here, the official kernel for the phone made by Xiaomi. I couldn't find the exact kernel source for my custom ROM, but the phone boots regardless.
At first, I only compiled the modules for NFS, however using insmod on sunrpc.ko requires __audit_inode_child, so a new kernel with CONFIG_AUDIT_SYSCALL=y is necessary. I also decided to make all the NFS modules built-in.
I made the changes to my .config, and compiled the entire kernel
(besides the device tree: CONFIG_BUILD_ARM64_DT_OVERLAY=n because of compilation errors).
With the new kernel from arch/arm64/boot/Image, I unpacked the boot.img from my device and swapped out the kernels and it boots, with NFS support listed in /proc/filesystems.
However, now none of the modules from /vendor/lib/modules work. Which is to be expected, they weren't built against this new kernel's source.
Trying to remedy this issue by inserting the newly compiled modules with insmod say disagrees about version of symbol module_layout.
How is this possible? These modules were compiled alongside the running kernel (same source code)
Something must have went wrong when creating the boot image, most likely the wrong kernel was copied (I have multiple kernel sources downloaded and compiled).
I repacked boot.img with a newly compiled kernel image and no module loading needed, every module in /vendor/lib/modules was loaded on boot.

Android Zimage Kernel Can Be Unpacked?

Hy Guys ..
I'm making a custom kernel project for my device, the project is almost done, but I'm having constraints about the camera, and in the kernel source there are no suitable drivers for my phone,
my last choice is just to unpack zimage stock .. can it be unpacked or not?
My Devices:
Smartfren Andromax Ec C46B2H
Qualcomm Snapdragon 410 Msm8916
Yes, but not much.
Similar to what Chris pointed out, the zImage is a binary blob which is self extracting when run by the cpu on system bootup.
So you can manually look into the initial uncompression code and do it yourself to get an uncompressed kernel binary also known as: uImage
Thats it. You cannot unpack it any further without counting disassembly.

how to check whether the kernel is for android or linux?

I have the source code of a kernel. but i don't know whether the kernel is android kernel or Linux kernel. I have searched about it on google but i haven't found any proper answer. As i know ,android kernel is Linux kernel and some patches applied on it. so i think we can identify the kernel is for Linux or android.
1.Can i know this by seeing the source code, or by running any command or by any other method?
2.if it is android kernel, whether will it able to mount the Ubuntu file system?
A simple method to check if a kernel is for android.
If there is a file named "android.c" in "drivers/usb/gadget" folder, the kernel seems to be a android kernel, otherwise, it is not for android.
Though not very accurate, but very simple
Look for AndroidKernel.mk in the kernel source root, if it's an Android kernel, it should be there.
The Ubuntu file system is ext4 by default. I'm pretty sure all default kernel configurations include support for this filesystem. What is the motivation behind this?
BTW the presence of binder does NOT mean it is an Android kernel. The binder exists in the staging directory for all Linux kernels

Is there a libnfc android loadable kernel module?

Does someone have the source for Android loadable kernel module for libnfc?
If not, can someone tell me how it can be done?
As final option, if you have it build already, can you share its download URL?
On a side lining question, i read that linux kernel 3.1 actually has NFC support in it. Does that mean if kernel 3.1 was ported to android then it would have inbuilt support? If so, do you know anyone who has a kernel 3.1 version for android?
Linux kernel 3.3 has merged the Android kernel features, and therefore now u have Android kernel 3.3 potentially to come out very soon. NFC supports is in the drivers/nfc (kernel source) directory, take a look at the files that. Another resource found is this: http://appelmelk.wordpress.com/2011/02/17/porting-libnfc-to-android/ and another document: https://docs.google.com/open?id=160clTJ-sSgHiNKd-IsFHGzZY8M9HQudYqHnp0mD09NBTPfZmm9mP_NEMV3E3 (not written by me).

Android Kernel modifying

I'm a Android application developer. For some reasons, I should change the Android kernel a bit. But I don't know anything about kernel. I will be appreciated if someone introduce me a website who explain android kernel modules and other info about it.
In the standard Android open source distribution the kernel is distributed as a pre-built binary in the mydroid/prebuilt/android-arm/kernel folder and the source code is not included. The kernel source was removed from the default manifest for two reasons as I take it. One is that it takes a lot of bandwith and diskspace for a platform component that most people will not work with much. The other reason is that since the kernel is built with the kernel build system and not as part of the aosp build system it makes sense to keep it separated. The common branch for the kernel is the one used by the emulator. There are also branches for experimental, msm (Qualcomm platforms) and Omap (TI platform) and maybe some more. If you want to use the Android kernel with hardware these may be more interesting to you.
Get the Android kernel either by adding it to your repo manifest or manually by running:
git clone git://android.git.kernel.org/kernel/common.git
The kernel built this way should end up in the arch/arm/boot folder of your kernel tree (where you put the code from git clone)
Note that I have used the default paths in the above description, you need to change them to what applies to your setup. It has been a some time since last time I tested this but I think it should work.
Go through the following sites which will also give u some ideas.
Android Porting, Android Platform, Android-Pdk,
Android porting in real target, Build-compile-linux-kernel-android
I guess that since you are talking about kernel programming you are also looking for ways to hook up new hardware with the platform and expose that functionality using your framework extensions to the applications. Hardware is basically added as a standard Linux driver so getting it to work under Linux is a good first step. How to hook it into the Android framework after that depends on what type of hardware it is. You could either use a native process to control it (compare the camera service or radio daemon in the current platform) or just spawn a thread in the application that uses your framework extension. For hardware that does not require that much attention plugging it in using an Android HAL library could also be an option

Categories

Resources