build kernel with ICS

1,855 views
Skip to first unread message

bigsupersquid

unread,
Nov 27, 2011, 2:25:34 PM11/27/11
to Android Building
Hi.
First post here, hopefully not too inept at searching to have missed
an obvious answer.

With gingerbread, I could compile the kernel as part of the product
build by adding this to AndroidBoard.mk:

#----------------------------------------------------------------------
# Compile Linux Kernel
#----------------------------------------------------------------------
ifeq ($(KERNEL_DEFCONFIG),)
KERNEL_DEFCONFIG := thunderc-sprint-perf_defconfig
endif

include kernel/AndroidKernel.mk

file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file) : $(TARGET_PREBUILT_KERNEL) | $(ACP)
$(transform-prebuilt-to-target)


but now with ICS I get this error from adding that code:

============================================
build/core/main.mk:536: *** Some files have been added to
ALL_PREBUILT.
build/core/main.mk:537: *
build/core/main.mk:538: * ALL_PREBUILT is a deprecated mechanism that
build/core/main.mk:539: * should not be used for new files.
build/core/main.mk:540: * As an alternative, use PRODUCT_COPY_FILES in
build/core/main.mk:541: * the appropriate product definition.
build/core/main.mk:542: * build/target/product/core.mk is the product
build/core/main.mk:543: * definition used in all products.
build/core/main.mk:544: *
build/core/main.mk:545: * unexpected oprofile.ko in ALL_PREBUILT
build/core/main.mk:546: *
build/core/main.mk:547: *** ALL_PREBUILT contains unexpected files.
Stop.

I've done my due diligence searching (I hope) but haven't found
mention of this.
Any suggestions?

Jean-Baptiste Queru

unread,
Nov 28, 2011, 12:58:13 PM11/28/11
to android-...@googlegroups.com
In a nutshell, ALL_PREBUILT is a private variable of the core build
system, and the core build system now defends itself when random
makefiles modify that specific variable, as that causes confusion down
the line.

Check how the kernel is installed with PRODUCT_COPY_FILES in device/samsung/tuna

JBQ

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>

--
Jean-Baptiste M. "JBQ" Queru
Software Engineer, Android Open-Source Project, Google.

Questions sent directly to me that have no reason for being private
will likely get ignored or forwarded to a public forum with no further
warning.

bigsupersquid

unread,
Nov 28, 2011, 4:48:51 PM11/28/11
to Android Building
So, in device.mk, I see:

ifeq ($(TARGET_PREBUILT_KERNEL),)
LOCAL_KERNEL := device/samsung/tuna/kernel
else
LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
endif

but there's no info on making the system build the kernel as part of
the product build in those makefiles. it uses a prebuilt kernel,
which I'm trying to avoid.
I'm guessing TARGET_PREBUILT_KERNEL needs to be set somehow, since if
that variable is null it copies the prebuilt kernel?
I'm kind of at sea here, because the only device makefiles I've found
which force a kernel build instead of copying a prebuilt kernel are
the qualcomm devices from CAF... and they haven't updated their device
makefiles to handle ICS yet.

Jean-Baptiste Queru

unread,
Nov 28, 2011, 5:45:38 PM11/28/11
to android-...@googlegroups.com
Ah, sorry I missed that part. There's no mechanism in the build system
to build the kernel "live" (it's not portable enough and not scalable
enough), and all Android work at Google has always been done with
prebuilt kernels (or at least as far as I can remember).

You might need to add support for what you're trying to do directly in
the core build system.

JBQ

Eric Finseth

unread,
Dec 2, 2011, 12:25:31 AM12/2/11
to android-...@googlegroups.com

jdkoreclipse

unread,
Dec 2, 2011, 5:19:05 PM12/2/11
to Android Building
If im not mistaken, couldnt you write a simple shell script to compile
the kernel, cp it to the device setup, and then have it build the rom.
I know it isnt being made with the system, but its less work for you.

On Dec 2, 12:25 am, Eric Finseth <eric.fins...@gmail.com> wrote:
> Looks like this is how the CAF folks did it.
>

> https://www.codeaurora.org/gitweb/quic/la/?p=platform/build.git;a=com...


>
>  -Eric
>
>
>
>
>
>
>
> On Mon, Nov 28, 2011 at 1:48 PM, bigsupersquid <0.urador...@gmail.com> wrote:
> > So, in device.mk, I see:
>
> > ifeq ($(TARGET_PREBUILT_KERNEL),)
> > LOCAL_KERNEL := device/samsung/tuna/kernel
> > else
> > LOCAL_KERNEL := $(TARGET_PREBUILT_KERNEL)
> > endif
>
> > but there's no info on making the systembuildthekernelas part of

> > the productbuildin those makefiles.  it uses a prebuiltkernel,


> > which I'm trying to avoid.
> > I'm guessing TARGET_PREBUILT_KERNEL needs to be set somehow, since if
> > that variable is null it copies the prebuiltkernel?
> > I'm kind of at sea here, because the only device makefiles I've found
> > which force akernelbuildinstead of copying a prebuiltkernelare
> > the qualcomm devices from CAF... and they haven't updated their device
> > makefiles to handleICSyet.
>
> > On Nov 28, 11:58 am, Jean-Baptiste Queru <j...@android.com> wrote:
> >> In a nutshell, ALL_PREBUILT is a private variable of the corebuild

> >> system, and the corebuildsystem now defends itself when random


> >> makefiles modify that specific variable, as that causes confusion down
> >> the line.
>

> >> Check how thekernelis installed with PRODUCT_COPY_FILES in device/samsung/tuna


>
> >> JBQ
>
> >> On Sun, Nov 27, 2011 at 11:25 AM, bigsupersquid <0.urador...@gmail.com> wrote:
> >> > Hi.
> >> > First post here, hopefully not too inept at searching to have missed
> >> > an obvious answer.
>
> >> > With gingerbread, I could compile thekernelas part of the product

> >> >buildby adding this to AndroidBoard.mk:


>
> >> > #----------------------------------------------------------------------
> >> > # Compile LinuxKernel
> >> > #----------------------------------------------------------------------
> >> > ifeq ($(KERNEL_DEFCONFIG),)
> >> >    KERNEL_DEFCONFIG := thunderc-sprint-perf_defconfig
> >> > endif
>
> >> > includekernel/AndroidKernel.mk
>
> >> > file := $(INSTALLED_KERNEL_TARGET)
> >> > ALL_PREBUILT += $(file)
> >> > $(file) : $(TARGET_PREBUILT_KERNEL) | $(ACP)
> >> >        $(transform-prebuilt-to-target)
>

> >> > but now withICSI get this error from adding that code:


>
> >> > ============================================
> >> >build/core/main.mk:536: *** Some files have been added to
> >> > ALL_PREBUILT.
> >> >build/core/main.mk:537: *
> >> >build/core/main.mk:538: * ALL_PREBUILT is a deprecated mechanism that
> >> >build/core/main.mk:539: * should not be used for new files.
> >> >build/core/main.mk:540: * As an alternative, use PRODUCT_COPY_FILES in
> >> >build/core/main.mk:541: * the appropriate product definition.

> >> >build/core/main.mk:542: *build/target/product/core.mk is the product

Jean-Baptiste Queru

unread,
Dec 2, 2011, 8:10:51 PM12/2/11
to android-...@googlegroups.com
Well, I already have similar things, the question is really about
integrating into the build system so that a single make command can
re-do the world as necessary.

JBQ

Jean-Baptiste Queru

unread,
Dec 27, 2012, 10:26:24 AM12/27/12
to android-...@googlegroups.com
You can't modify ALL_PREBUILT in your makefiles, it's a private
variable that doesn't do what you think it does.

If you want to copy a file as-is and don't want to write a full
BUILD_PREBUILT rule, use PRODUCT_COPY_FILES in your product
definition.

JBQ

On Thu, Dec 27, 2012 at 1:08 AM, Venkat <venka...@gmail.com> wrote:
> Hi JBQ,
> I am also facing the similar problem while compiling circular char driver in
> ICS, I tried the same doing in GB and it got compiled. Below is the error I
> got
>
> build/core/main.mk:537: *** Some files have been added to ALL_PREBUILT.
> #build/core/main.mk:538: *
> #build/core/main.mk:539: * ALL_PREBUILT is a deprecated mechanism that
> #build/core/main.mk:540: * should not be used for new files.
> #build/core/main.mk:541: * As an alternative, use PRODUCT_COPY_FILES in
> #build/core/main.mk:542: * the appropriate product definition.
> #build/core/main.mk:543: * build/target/product/core.mk is the product
> #build/core/main.mk:544: * definition used in all products.
> #build/core/main.mk:545: *
> #build/core/main.mk:546: * unexpected circular-char.ko in ALL_PREBUILT
> #build/core/main.mk:547: *
> #build/core/main.mk:548: *** ALL_PREBUILT contains unexpected files. Stop.
>
>
> I tried the changes mentioned in
> and I getting same error
>
> Please provide any suggestion
>
> - Venkat
Technical Lead, Android Open Source Project, Google.

Ramsudharsan Madhavan

unread,
May 12, 2014, 7:04:08 AM5/12/14
to android-...@googlegroups.com
I guess its not the problem with the sources.

This may be a very late reply but it may be useful for the people who are looking for the answer.

So here's it:

The source is clean. It has nothing to do with the error.

The only thing is what you add to the sources, can contain the error.

That is, device tree, vendor tree, kernel sources, device-specific patches etc. and the problem is in with the *.mk file.

So you need to open all of the *.mk files that are present in the above specified addons and try to see if there is anything called:

GRANDFATHERED_ALL_PREBUILT

ALL_PREBUILT

If something is found, change it to PRODUCT_COPY_FILES

Also navigate to build/core/legacy_prebuilts.mk and change the value to the modified value that I have stated above!
Reply all
Reply to author
Forward
0 new messages