This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Android build sometimes rebuilds kernel on its own

We're using the TI GingerBread 2.3.4 distribution for our Android builds. Typically, we build each of the three layers (u-boot, kernel, android) separately.

But, sometimes when we build the android layer (using 'make TARGET_PRODUCT=am3517evm OMAPES=3.x -j8'), that android build, seemingly on its own, invokes a rebuild of the kernel.  I had never seen this happen until a couple of weeks ago.  When it does happen, Android appears to then use that kernel to resolve certain library needs by kernel dependencies within Android.

The problem is, that kernel that Android builds appears to be wrong, resulting in error messages, and a generated Android rootfs is not correct.

So, why is it that Android sometimes rebuilds the kernel?  While it has the appearance of randomness, there's obviously something about our setup that now causes this to happen sometimes, but not always.

Thanks,
Ron

  • Please have a look at the top-level makefile to understand this.

    Basically, the top-level build triggers android filesystem build, then kernel build and then SGX installation.

    The thing to note is that the kernel is quite independent of the android filesystem, but the SGX modules need to be compiled against the kernel before being installed into the android filesystem.

    We recommend to build the kernel using the top-level build command instead of doing this manually.

    Also, the build system is not yet smart enough to check if the kernel config file is correct or not. It will simply use a existing .config file if it exists.

  • Vishveshwar,

    Thank you for your reply.  I believe our problem is now understood.

    We originally saw the instruction in the TI Gingerbread user guide, which outlines the procedure for building the kernel separately.  We used that procedure, thinking that was the only way the kernel was built.  Your reply pointed out that additionally, the kernel is rebuilt as part of the Android layer rebuild, and we see where that is documented in the manual.

    That wouldn't have mattered, except that we use a single build folder for various kernel builds, sometimes for a different hardware platform, and sometimes for building the kernel for a straight Linux (i.e. non-Android) target.  So, without insuring the kernel source was in sync with our Android build, we were getting that unexpected kernel build, but for the wrong target.  A little rework of our build flow solved the issue.

    Regards,
    Ron