Patchwork eglibc-initial: Fix kernel headers symlink being wrong

login
register
mail settings
Submitter Matthew McClintock
Date Nov. 28, 2011, 10:57 p.m.
Message ID <1322521031-26849-1-git-send-email-msm@freescale.com>
Download mbox | patch
Permalink /patch/15485/
State New
Headers show

Comments

Matthew McClintock - Nov. 28, 2011, 10:57 p.m.
symlinks to the kernel headers were pointing at the wrong
location when being used from cache. Just copy the kernel
headers instead

Signed-off-by: Matthew McClintock <msm@freescale.com>
---
Do we need something to depend on the kernel version too since we
are copying instead of symlinking? Something like:

do_install[vardeps] += "virtual/kernel:do_populate_sysroot"

 meta/recipes-core/eglibc/eglibc-common.inc  |    2 +-
 meta/recipes-core/eglibc/eglibc-initial.inc |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
McClintock Matthew-B29882 - Nov. 28, 2011, 11:15 p.m.
On Mon, Nov 28, 2011 at 4:57 PM, Matthew McClintock <msm@freescale.com> wrote:
> symlinks to the kernel headers were pointing at the wrong
> location when being used from cache. Just copy the kernel
> headers instead
>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> Do we need something to depend on the kernel version too since we
> are copying instead of symlinking? Something like:
>
> do_install[vardeps] += "virtual/kernel:do_populate_sysroot"
>
>  meta/recipes-core/eglibc/eglibc-common.inc  |    2 +-
>  meta/recipes-core/eglibc/eglibc-initial.inc |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc
> index 4fa6488..6a93968 100644
> --- a/meta/recipes-core/eglibc/eglibc-common.inc
> +++ b/meta/recipes-core/eglibc/eglibc-common.inc
> @@ -3,7 +3,7 @@ DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
>  HOMEPAGE = "http://www.eglibc.org/home"
>  SECTION = "libs"
>  LICENSE = "GPLv2 & LGPLv2.1"
> -INC_PR = "r11"
> +INC_PR = "r12"
>  LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
>       file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
>       file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
> diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
> index 448f73a..f154d64 100644
> --- a/meta/recipes-core/eglibc/eglibc-initial.inc
> +++ b/meta/recipes-core/eglibc/eglibc-initial.inc
> @@ -48,7 +48,7 @@ do_install () {
>
>        # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
>        for t in linux asm asm-generic; do
> -               ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
> +               cp -ar ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/

For reference, it looked something like this when used from cache:

/home/mattsm/git/poky/build/tmp/sysroots/${MACHINE_A}-tcbootstrap/usr/include/linux:
broken symbolic link to
`../../../..//sysroots/${MACHINE_B}/usr/include/linux'

And ${MACHINE_B} did not exist...

-M
Khem Raj - Nov. 29, 2011, 1 a.m.
On Mon, Nov 28, 2011 at 2:57 PM, Matthew McClintock <msm@freescale.com> wrote:
> symlinks to the kernel headers were pointing at the wrong
> location when being used from cache. Just copy the kernel
> headers instead
>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> Do we need something to depend on the kernel version too since we
> are copying instead of symlinking? Something like:
>
> do_install[vardeps] += "virtual/kernel:do_populate_sysroot"
>
>  meta/recipes-core/eglibc/eglibc-common.inc  |    2 +-
>  meta/recipes-core/eglibc/eglibc-initial.inc |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc
> index 4fa6488..6a93968 100644
> --- a/meta/recipes-core/eglibc/eglibc-common.inc
> +++ b/meta/recipes-core/eglibc/eglibc-common.inc
> @@ -3,7 +3,7 @@ DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
>  HOMEPAGE = "http://www.eglibc.org/home"
>  SECTION = "libs"
>  LICENSE = "GPLv2 & LGPLv2.1"
> -INC_PR = "r11"
> +INC_PR = "r12"
>  LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
>       file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
>       file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
> diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
> index 448f73a..f154d64 100644
> --- a/meta/recipes-core/eglibc/eglibc-initial.inc
> +++ b/meta/recipes-core/eglibc/eglibc-initial.inc
> @@ -48,7 +48,7 @@ do_install () {
>
>        # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
>        for t in linux asm asm-generic; do
> -               ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
> +               cp -ar ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
>        done
>  }


these were cross sysroot symlinks. imo copying is
the safer think to do here.

Acked-by: Khem Raj <raj.khem@gmail.com>
Richard Purdie - Nov. 29, 2011, 12:25 p.m.
On Mon, 2011-11-28 at 23:15 +0000, McClintock Matthew-B29882 wrote:
> On Mon, Nov 28, 2011 at 4:57 PM, Matthew McClintock <msm@freescale.com> wrote:
> > symlinks to the kernel headers were pointing at the wrong
> > location when being used from cache. Just copy the kernel
> > headers instead
> >
> > Signed-off-by: Matthew McClintock <msm@freescale.com>
> > ---
> > Do we need something to depend on the kernel version too since we
> > are copying instead of symlinking? Something like:
> >
> > do_install[vardeps] += "virtual/kernel:do_populate_sysroot"
> >
> >  meta/recipes-core/eglibc/eglibc-common.inc  |    2 +-
> >  meta/recipes-core/eglibc/eglibc-initial.inc |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc
> > index 4fa6488..6a93968 100644
> > --- a/meta/recipes-core/eglibc/eglibc-common.inc
> > +++ b/meta/recipes-core/eglibc/eglibc-common.inc
> > @@ -3,7 +3,7 @@ DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
> >  HOMEPAGE = "http://www.eglibc.org/home"
> >  SECTION = "libs"
> >  LICENSE = "GPLv2 & LGPLv2.1"
> > -INC_PR = "r11"
> > +INC_PR = "r12"
> >  LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
> >       file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
> >       file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
> > diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
> > index 448f73a..f154d64 100644
> > --- a/meta/recipes-core/eglibc/eglibc-initial.inc
> > +++ b/meta/recipes-core/eglibc/eglibc-initial.inc
> > @@ -48,7 +48,7 @@ do_install () {
> >
> >        # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
> >        for t in linux asm asm-generic; do
> > -               ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
> > +               cp -ar ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
> 
> For reference, it looked something like this when used from cache:
> 
> /home/mattsm/git/poky/build/tmp/sysroots/${MACHINE_A}-tcbootstrap/usr/include/linux:
> broken symbolic link to
> `../../../..//sysroots/${MACHINE_B}/usr/include/linux'
> 
> And ${MACHINE_B} did not exist...

Yes, good catch. I'm going to propose a different fix though as the
builds take up a lot of disk space and I'd prefer not to continue to
grow the disk footprint unnecessarily.

Cheers,

Richard
Khem Raj - Nov. 29, 2011, 7:49 p.m.
On Mon, Nov 28, 2011 at 2:57 PM, Matthew McClintock <msm@freescale.com> wrote:
> symlinks to the kernel headers were pointing at the wrong
> location when being used from cache. Just copy the kernel
> headers instead
>
> Signed-off-by: Matthew McClintock <msm@freescale.com>
> ---
> Do we need something to depend on the kernel version too since we
> are copying instead of symlinking? Something like:
>
> do_install[vardeps] += "virtual/kernel:do_populate_sysroot"
>
>  meta/recipes-core/eglibc/eglibc-common.inc  |    2 +-
>  meta/recipes-core/eglibc/eglibc-initial.inc |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc
> index 4fa6488..6a93968 100644
> --- a/meta/recipes-core/eglibc/eglibc-common.inc
> +++ b/meta/recipes-core/eglibc/eglibc-common.inc
> @@ -3,7 +3,7 @@ DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
>  HOMEPAGE = "http://www.eglibc.org/home"
>  SECTION = "libs"
>  LICENSE = "GPLv2 & LGPLv2.1"
> -INC_PR = "r11"
> +INC_PR = "r12"
>  LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
>       file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
>       file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
> diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
> index 448f73a..f154d64 100644
> --- a/meta/recipes-core/eglibc/eglibc-initial.inc
> +++ b/meta/recipes-core/eglibc/eglibc-initial.inc
> @@ -48,7 +48,7 @@ do_install () {
>
>        # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
>        for t in linux asm asm-generic; do
> -               ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
> +               cp -ar ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/

thinking a bit more I think just doing ln -sf might be another option
instead of doing ln -s
will avoid copying.

>        done
>  }
>
> --
> 1.7.6.1
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
McClintock Matthew-B29882 - Nov. 29, 2011, 8:04 p.m.
On Tue, Nov 29, 2011 at 1:49 PM, Khem Raj <raj.khem@gmail.com> wrote:
>>        # add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
>>        for t in linux asm asm-generic; do
>> -               ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
>> +               cp -ar ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
>
> thinking a bit more I think just doing ln -sf might be another option
> instead of doing ln -s
> will avoid copying.

Richard's new approach was sort of more along the lines of what I was
thinking. It's essentially fixing the symlinks after we deploy from
sstate-cache. I don't think (correct me if I'm wrong) this step above
will get run when deploying from sstate-cache.

-M

Patch

diff --git a/meta/recipes-core/eglibc/eglibc-common.inc b/meta/recipes-core/eglibc/eglibc-common.inc
index 4fa6488..6a93968 100644
--- a/meta/recipes-core/eglibc/eglibc-common.inc
+++ b/meta/recipes-core/eglibc/eglibc-common.inc
@@ -3,7 +3,7 @@  DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
 HOMEPAGE = "http://www.eglibc.org/home"
 SECTION = "libs"
 LICENSE = "GPLv2 & LGPLv2.1"
-INC_PR = "r11"
+INC_PR = "r12"
 LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
       file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
       file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
diff --git a/meta/recipes-core/eglibc/eglibc-initial.inc b/meta/recipes-core/eglibc/eglibc-initial.inc
index 448f73a..f154d64 100644
--- a/meta/recipes-core/eglibc/eglibc-initial.inc
+++ b/meta/recipes-core/eglibc/eglibc-initial.inc
@@ -48,7 +48,7 @@  do_install () {
 
 	# add links to linux-libc-headers: gcc-{cross,crossdk}-intermediate need this.
 	for t in linux asm asm-generic; do
-		ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
+		cp -ar ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
 	done
 }