[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ltib] config option use BSP kernel headers with >= linux-2.6.17
From: |
Aaron Wegner |
Subject: |
Re: [Ltib] config option use BSP kernel headers with >= linux-2.6.17 |
Date: |
Thu, 28 Mar 2013 11:26:16 -0400 |
User-agent: |
SquirrelMail/1.4.22 |
Thanks Peter.
That could be a good patch for the LTIB to accommodate more recent kernels
in the case of a target system built using the kernel headers. I've
attached my patch (almost the same as yours except you don't need the
mkdir for the make headers_install). I've also attached a patch for a
main.lkc file that wants to use this configuration option.
> On 03/19/2013 03:35 PM, Aaron Wegner wrote:
>> Going through the Git log of the Linux kernel it seems like there has
>> been
>> a basic implementation of 'make headers_install' since about 2.6.17. I
>> was trying to install the headers of a 3.8 kernel and running into some
>> problems. I seemed to be able to overcome these by editing
>> dist/lfs-5.1/kernel/kernel-common.tmpl and replacing the
>> PKG_KERNEL_WANT_HEADERS section with the following.
>>
>> if [ -n "$PKG_KERNEL_WANT_HEADERS" ]
>> then
>> make ARCH=$LINTARCH HOSTCC="$BUILDCC"
>> INSTALL_HDR_PATH=$RPM_BUILD_ROOT/%{pfx}/usr/src/linux headers_install
>> fi
>>
>> Maybe this could be a patch? Not exactly sure how to specify the
>> condition that the kernel version is greater than or equal to one in
>> which
>> the 'make headers_install' is working well, but for recent kernels the
>> current LTIB spec file fails since the includes are reordered from the
>> old
>> way.
> Some platforms use pre-2.6.17 kernels so you'll need code to switch
> between the headers_intall and the old method to install the kernel
> headers...
>
>
> You could add the following to your platform main.lkc
>
> config PKG_KERNEL_WANT_HEADERS_INSTALL
> bool "install kernel headers using headers_install"
> help
> Post 2.6.17 kernels use "make headers_install" to install kernel
> headers into sysroot; select
> 2.6.17 and newer kernels
>
> Then in dist/lfs-5.1/kernel/kernel-common.tmpl modify the header
> installation to use headers_install if PKG_KERNEL_WANT_HEADERS_INSTALLED
> is enabled, else fall back to the old method:
>
> diff --git a/dist/lfs-5.1/kernel/kernel-common.tmpl
> b/dist/lfs-5.1/kernel/kernel-common.tmpl
> index 3edda42..a1df62f 100644
> --- a/dist/lfs-5.1/kernel/kernel-common.tmpl
> +++ b/dist/lfs-5.1/kernel/kernel-common.tmpl
> @@ -296,31 +296,36 @@ fi
> if [ -n "$PKG_KERNEL_WANT_HEADERS" ]
> then
> mkdir -p $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include
> - 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 $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include
> - fi
> - done
> + if [ -n "$PKG_KERNEL_WANT_HEADERS_INSTALL" ]
> + then
> + make ARCH=${LINTARCH} HOSTCC="$BUILDCC" headers_install
> INSTALL_HDR_PATH=$RPM_BUILD_ROOT/%{pfx}/usr/src/linux
> + else
> + for i in asm-${LINTARCH} asm-generic config linux math-emu
> media mtd net pcmcia rxrpc scsi sound video generated
> + do
> + if [ -d include/$i ]
> + then
> + cp -a include/$i
> $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include
> + fi
> + done
>
> - for i in asm config linux
> - do
> - if [ -d $KBOUT/include/$i ]
> - then
> - cp -a $KBOUT/include/$i
> $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include
> - fi
> - done
> + for i in asm config linux
> + do
> + if [ -d $KBOUT/include/$i ]
> + then
> + cp -a $KBOUT/include/$i
> $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include
> + fi
> + done
>
> - if [ "${LINTARCH}" = "arm" ]
> - then
> - if [ -d "$KBOUT/include/asm/arch" ]
> - then
> - mkdir -p
> $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include/asm/arch
> - cp -a $KBOUT/include/asm/arch/*
> $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include/asm/arch
> - else
> - echo "Don't know how to copy asm headers for this kernel"
> - fi
> + if [ "${LINTARCH}" = "arm" ]
> + then
> + if [ -d "$KBOUT/include/asm/arch" ]
> + then
> + mkdir -p $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include/asm/arch
> + cp -a $KBOUT/include/asm/arch/*
> $RPM_BUILD_ROOT/%{pfx}/usr/src/linux/include/asm/arch
> + else
> + echo "Don't know how to copy asm headers for this kernel"
> + fi
> + fi
> fi
> fi
>
> Then if you "./ltib -c" and select the "install kernel headers using
> headers_install" to enable it, save/exit it should build/install your
> kernel, and then install the headers using the headers_install target.
>
> --
> Peter Barada
> address@hidden
>
>
> _______________________________________________
> LTIB home page: http://ltib.org
>
> Ltib mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/ltib
>
ltib-want-headers-install.patch
Description: Binary data
main.lkc-want-headers-install.patch
Description: Binary data