2

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?

2
  • 1
    Try System.getProperty("os.name") Commented Jan 10, 2014 at 3:34
  • An android kernel is a linux kernel, just a special one. Something fairly indicative of Android would be the existence of the Binder driver in the kernel, but that does not necessarily mean there will be a /dev/binder node as that is a file system property, not a kernel one. As there is no specific "ubuntu file system" the possibility of mounting any given one would depend if the kernel has compiled in or available as a module a driver for the particular filesystem of interest. Commented Mar 21, 2014 at 16:44

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

This is unlikely to be reliable. The gadget framework has been both used, and not used, as the basis for Android's device-side USB implementation, at various points in history.
·@ChrisStratton I guess that means if the file is there it is an Android kernel. If the file is missing, no conclusion can be drawn.
0
  1. Look for AndroidKernel.mk in the kernel source root, if it's an Android kernel, it should be there.
  2. 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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.