[Top][All Lists]
[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: |
Tue, 15 Jun 2010 20:32:29 +0100 |
User-agent: |
Thunderbird 2.0.0.16 (X11/20080707) |
My apologies Franz,
To get a log:
$ ./ltib -p kernel 2>&1 | tee logfile
The .spec.in should copy that file (it does on other kernels). Looking
at it it should be done here:
> for i in asm-${LINTARCH} asm-generic config linux math-emu media
> mtd net pcmcia rxrpc scsi sound video
> do
> if [ -d include/$i ]
> then
> cp -a include/$i ${KERNEL_HDR_PATH}/include
> fi
> done
When i is linux and it has a sub-dir include, then it should be copied
(IIRC).
Regards, Stuart
Franz TRIERWEILER wrote:
> Hi Stuart,
>
> (Note I am FranZ, not FranK :-) )
>
> Yes, it is a Freescale BSP. I can see autoconf.h in the kernel sources
> (in the rpm/BUILD/linux-2.6.31/include/linux).
>
> I tried to find a log for the rpm package install but did not find it.
> Which log corresponds to the kernel header package? I only know the host
> config but it is for LTIb first install, thus it is no use.
>
> I checked the kernel-common.tmpl and I believe everything happens here:
>
> if [ -n "$PKG_KERNEL_WANT_HEADERS" ]
> then
> KERNEL_HDR_PATH=$RPM_BUILD_ROOT/%{pfx}/usr/src/linux
> install -d ${KERNEL_HDR_PATH}/include
> if ! make ARCH=$LINTARCH CROSS_COMPILE= HOSTCC="$BUILDCC"
> INSTALL_HDR_PATH=${KERNEL_HDR_PATH} headers_install
> then
> for i in asm-${LINTARCH} asm-generic config linux math-emu media
> mtd net pcmcia rxrpc scsi sound video
> do
> if [ -d include/$i ]
> then
> cp -a include/$i ${KERNEL_HDR_PATH}/include
> fi
> done
>
> for i in asm config linux
> do
> if [ -d $KBOUT/include/$i ]
> then
> cp -a $KBOUT/include/$i ${KERNEL_HDR_PATH}/include
> fi
> done
> fi
> fi
>
> In my opinion, the subdir ./linux should be copied (this is where
> autoconf.h is), but is not entirely copied...
>
> Do you have a kernel-common.tmpl file I could check as a reference?
>
> Regards,
> Franz
>
>
> 2010/6/14 Stuart Hughes <address@hidden <mailto:address@hidden>>
>
> 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>
> <mailto: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>
> > <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>>
> > <mailto: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>>>
> > > <mailto: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
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>