ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] How to check linux header files availability before compiling


From: Stuart Hughes
Subject: Re: [Ltib] How to check linux header files availability before compiling ?
Date: Mon, 14 Jun 2010 21:24:12 +0100
User-agent: Thunderbird 2.0.0.16 (X11/20080707)

Hi Frank,

Maybe there was an error during rpm install that prevented the copy of
that header (can/did you check the build log)?

Carefully check that the source that is being copied from is the right
place.  If the kernel is built out-of-tree, this location should be the
copy source directory.  Presumably this is a Freescale BSP? maybe they
changed/broke something in that copy (it may be worth checking
kernel-common.tmpl).

Regarrds, Stuart


Franz TRIERWEILER wrote:
> Hi Stuart,
> 
> $ rpm --root `pwd`/rootfs -qf /usr/src/linux/include/linux/
> acct.h
> 
> returned kernel-2.6.31-imx_09.12.00
> 
> My kernel is: 2.6.31-203-gee1fdae, as returned by uname -r on the
> Freescale board.
> 
> I also forced a kernel rebuild but autoconf.h is still missing.
> 
> Regards,
> Franz
> 
> 
> 2010/6/11 Stuart Hughes <address@hidden <mailto:address@hidden>>
> 
>     Hi Frank,
> 
>     That's odd.  I now recall that in the old days the check was for
>     config.h and it changed to autoconf.h
>     http://www.mail-archive.com/address@hidden/msg09210.html
> 
>     I just took a look at mpc8349itx BSP building a kernel.org
>     <http://kernel.org> 2.6.34-rc3
>     kernel, with install kernel headers and I see:
> 
>     $ find rootfs/usr/src/linux/ -name autoconf.h
>     rootfs/usr/src/linux/include/linux/autoconf.h
> 
>     Can you verify your headers are coming from the kernel.  I just ran
>     this:
> 
>     $ rpm --root `pwd`/rootfs -qf /usr/src/linux/include/linux/autoconf.h
>     kernel-local-1
> 
>     You can try:
>     $ rpm --root `pwd`/rootfs -qf /usr/src/linux/include/linux/acct.h
> 
>     Unless someone else knows otherwise, I think autoconf.h should still get
>     installed.  It may be worth forcing a kernel re-build and logging it.
>     Maybe an error in the install script (or other) is causing the copy of
>     this file to be bypassed for your kernel sources (BTW what kernel
>     version/sources is this?)
> 
>     Regards, Stuart
> 
> 
>     Franz TRIERWEILER wrote:
>     > Hi Stuart,
>     >
>     > I confirm that I do have the interfaces on my rootfs:
>     >
>     > :~/ltib/rootfs/usr/src/linux/include/linux$ ls
>     > acct.h             dccp.h                if_bridge.h
>     > llc.h                param.h            som.h
>     > adb.h              dlmconstants.h        if_cablemodem.h
>     > loop.h               parport.h          sonet.h
>     > adfs_fs.h          dlm_device.h          if_ec.h
>     > lp.h                 patchkey.h         sonypi.h
>     > affs_hardblocks.h  dlm.h                 if_eql.h
>     > magic.h              pci.h              soundcard.h
>     > .....
>     > .....
>     > .....
>     >
>     > :~/ltib/rootfs/usr/src/linux/include/linux$ ls auto*
>     > auto_fs4.h  auto_fs.h
>     >
>     > But no autoconf.h !
>     >
>     > Indeed, the following options are checked in LTIB:
>     >
>     >   │ │                                 [*] Always rebuild the
>     > kernel
>     > │ │
>     >   │ │                                 [ ] Produce cscope
>     > index
>     > │ │
>     >   │ │                                 [*] Include kernel
>     > headers
>     > │ │
>     >   │ │                                 [ ] Configure the
>     > kernel
>     > │ │
>     >   │ │                                 --- Leave the sources after
>     > building
>     > │ │
>     >
>     > Maybe should not we just check the availability of
>     > rootfs/usr/src/linux/include/linux directory instead of a single
>     file in
>     > order to know if kernel headers are available ?
>     >
>     > regards,
>     > Franz
>     >
>     > 2010/6/11 Stuart Hughes <address@hidden <mailto:address@hidden>
>     <mailto:address@hidden <mailto:address@hidden>>>
>     >
>     >     Hi Franz,
>     >
>     >     This file will always be in
>     rpm/BUILD/linux-xxxxxx/include/linux if left
>     >     unpacked.  However the interface should be through
>     rootfs/usr/src/linux
>     >     (DEV_IMAGE...).  This is the public interface for kernel headers.
>     >     Confirm that you have these installed on your rootfs (there is
>     an option
>     >     in LTIB to install kernel headers).
>     >
>     >     If you do have kernel headers installed, It's possible that later
>     >     kernels do not install this file any more?  maybe a kernel
>     expert on the
>     >     list knows (I vaguely remember something like this).
>     >
>     >     Unfortunately today's best practice is tomorrows
>     >     _rug_pulled_from_under_your_feet.
>     >
>     >     Regards, Stuart
>     >
>     >
>     >     Franz TRIERWEILER wrote:
>     >     > Hi Stuart,
>     >     >
>     >     > I included and tested this. What's weird with my LTIB is
>     that the
>     >     > autoconf.h file is never copied to KHDR_DIR/linux/autoconf.h
>     even
>     >     when I
>     >     > select 'Include kernel headers' in LTIB.
>     >     >
>     >     > Instead, this file is with the kernel sources in
>     >     > rpm/BUILD/linux-xxxxxx/include/linux
>     >     >
>     >     > Thus: why ?
>     >     >
>     >     > Of course, I could check the availability of another file but I
>     >     want to
>     >     > comply with the best practice.
>     >     >
>     >     > Franz
>     >     >
>     >     > 2010/6/9 Stuart Hughes <address@hidden <mailto:address@hidden>
>     <mailto:address@hidden <mailto:address@hidden>>
>     >     <mailto:address@hidden <mailto:address@hidden>
>     <mailto:address@hidden <mailto:address@hidden>>>>
>     >     >
>     >     >     Hi Franz,
>     >     >
>     >     >     I normally use this in the .spec file %build section:
>     >     >
>     >     >
>     >     >     %Build
>     >     >     KHDR_DIR=$DEV_IMAGE/usr/src/linux/include
>     >     >     if [ ! -f $KHDR_DIR/linux/autoconf.h ]
>     >     >     then
>     >     >        cat <<TXT
>     >     >
>     >     >     No file: $KHDR_DIR/linux/autoconf.h
>     >     >
>     >     >     You need to build the kernel and have 'Include kernel
>     headers' set
>     >     >     to build this package
>     >     >
>     >     >     TXT
>     >     >        exit 1
>     >     >     fi
>     >     >
>     >     >     Regards, Stuart
>     >     >
>     >     >
>     >     >     Franz TRIERWEILER wrote:
>     >     >     > Hi,
>     >     >     >
>     >     >     > My package Makefile needs to set gcc include path to
>     the kernel
>     >     >     headers
>     >     >     > (rootfs/usr/src/linux/include). I would like the
>     >     availability of these
>     >     >     > files to be checked before gcc prints a cryptic error.
>     >     >     >
>     >     >     > Is there a way of checking linux header availability
>     before
>     >     compiling?
>     >     >     > (my makefile is not generated by ./configure).
>     >     >     >
>     >     >     > Must I specify this in the package dependencies?
>     >     >     >
>     >     >     > Is there a LTIB parameter I can catch from the Makefile to
>     >     set the
>     >     >     path
>     >     >     > automatically ?
>     >     >     >
>     >     >     > Thanks,
>     >     >     > Franz
>     >     >     >
>     >     >     >
>     >     >
>     >     >
>     >
>     >
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]