I've been using customs ROMs and Kernels on my GS5 for a while now, but I want to get a clear explanation about how it works. Here are a few questions:

  1. What is 'building' in Android? I heard that the build system is different from other Linux systems.
  2. What's the difference between a ROM and a Kernel?
  3. Is the 'ROM part' and 'Kernel part' separated? So, can I build them separately and install them separately?
  4. How do I add device drivers(such as WiFi dongles) to my Kernel?
  5. Inside a custom ROM zip file, is the Kernel included alongside with the ROM?
  6. Are kernels compatible with different ROMs? (E.g. Using a Kernel built from the official stock sources on CyanogenMod)

These may be very newbie-ish questions but I'm really, really curious.

1 Answer 1


1) Building in Android could mean: - building a deliverable in the android build tree - building a deliverable on an android platform having build tools installed - building the AOSP (Android OpenSource Project) A little bit more context may help. According to the following question 'the build system is different from other Linux systems' it could be the AOSP one. Actually Android is a distro for phone. Then building an android firmware for a mobile platform is equivalent to building a linux distribution for a desktop computer. You build the bootloader, the kernel, the root filesystem and some extra deliverables (ex. recovery filesystem that is a special android system, vendor filesystem image, SDK, NDK, Android CTS, etc...). The way to build all this is different from any other existing build system. All this is very well documented in source Android web site Android Source web site. Have a look at it :)

2) A ROM is not a very precise term. It could mean several things. Generally ROM designates the SYSTEM part of the android complete firmware for a mobile platform, the kernel being another part of this firmware. But sometimes, a ROM contains the whole: the SYSTEM, the DATA, the BOOTLOADER, the BOOTLOADER Params, the RECOVERY and the KERNEL part.

3) If ROM designates the complete firmware, Kernel is part of it, then kernel is included in ROM and build of ROM => build of kernel. If ROM designates the SYSTEM part of android, then both are separate and they can be built and installed separately.

4) Android is a mobile platform and as such runs on phones. Installing device drivers is possible but is a little bit complicated as it greatly depends on the hardware platform design. For reference boards (development platforms), these procedures are well documented by manufacturers, allowing developers to do this by themselves. For a closed platform (as a HTC or SAMSUNG phone), the documentation is far more difficult to obtain (most often it requires at least a NDA, and sometimes no documentation at all is available as it remains company confidential informations).

5) I assume that, by ROM zip file, you mean the OTA update package. This package may contain anything the platform need to update and this includes (but is not limited to) kernel, bootloader, radio firmware, TEE firmware etc. These packages are based on a scripting language (named edify) that allow to do some very complex operations for updating.

6) Kernel is linked to the hardware platform (a phone <=> a kernel). However some SYSTEM may requires some specific features to be enabled at kernel level. Then generally yes, kernels are compatibles with any SYSTEM partitions (assuming term ROM is used here with the meaning of the android SYSTEM partition).

Hope this helped ;-)

  • Objection to 6): kernels are usually not cross-compatible, even if they're built for the same device but for different ROMs. The rest are alright as I see it. +1 just for the effort of writing such a long answer.
    – Andy Yan
    Dec 26, 2016 at 13:34
  • At the restriction I mentionned (some vendor features may be dependent on kernel features), kernels are perfectly cross compatible. A kernel is a kernel and there is no cyanogen kernel or AOSP kernel. Actually all android kernels are hikey linux based. Refer to source.android.com/source/devices.html#hikey-boards if you need to be convinced. Dec 26, 2016 at 13:50
  • I have to moderate what I said. Actually binder and other android specific linux modifications introduce some adherences between android version and linux version. Then kernel and not compatible from one version to another but in the same version, whatever is the 'distro' (ROM as U call it), kernel are interchageanble (I think we could verify but they should use the same kernel for the same platform). Dec 26, 2016 at 13:58
  • Pretty much, since stock ROMs are usually way head of custom ROMs in kernel version nowadays.
    – Andy Yan
    Dec 26, 2016 at 14:06
  • 1
    Yes. Actually several linux kernel versions are available for every API level. A v2.x, a v3.x and a v4.x could be available. It is only a matter of porting the android specific changes. Here are some good descriptions of these changes: quora.com/… elinux.org/Android_Kernel_Features Dec 26, 2016 at 15:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .