[OE-core] [PATCH 2/3] libc-package.bbclass: Use install utility to create directories with right permissions

Khem Raj raj.khem at gmail.com
Thu Feb 14 15:56:24 UTC 2019


On Wed, Feb 13, 2019 at 10:05 PM Peter Kjellerstedt
<peter.kjellerstedt at axis.com> wrote:
>
> > -----Original Message-----
> > From: openembedded-core-bounces at lists.openembedded.org <openembedded-
> > core-bounces at lists.openembedded.org> On Behalf Of Khem Raj
> > Sent: den 12 februari 2019 06:48
> > To: openembedded-core at lists.openembedded.org
> > Subject: [OE-core] [PATCH 2/3] libc-package.bbclass: Use install
> > utility to create directories with right permissions
> >
> > Could fix issues where dirs with wrong permission is created with mkdir -p
> >
> > Signed-off-by: Khem Raj <raj.khem at gmail.com>
> > ---
> >  meta/classes/libc-package.bbclass | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-
> > package.bbclass
> > index 0b4c666a74..34025635ce 100644
> > --- a/meta/classes/libc-package.bbclass
> > +++ b/meta/classes/libc-package.bbclass
> > @@ -61,7 +61,7 @@ LOCALETREESRC ?= "${PKGD}"
> >  do_prep_locale_tree() {
> >       treedir=${WORKDIR}/locale-tree
> >       rm -rf $treedir
> > -     mkdir -p $treedir/${base_bindir} $treedir/${base_libdir} $treedir/${datadir} $treedir/${localedir}
> > +     install -d $treedir/${base_bindir} $treedir/${base_libdir} $treedir/${datadir} $treedir/${localedir}
>
> This does not change anything (install -d and mkdir -p does the same thing).
>
> >       tar -cf - -C ${LOCALETREESRC}${datadir} -p i18n | tar -xf - -C $treedir/${datadir}
> >       # unzip to avoid parsing errors
> >       for i in $treedir/${datadir}/i18n/charmaps/*gz; do
> >               gunzip $i
> >       done
> >       tar -cf - -C ${LOCALETREESRC}${base_libdir} -p . | tar -xf - -C $treedir/${base_libdir}
>
> This is where the problem happens. When the files are copied from
> ${LOCALETREESRC}, the ownership of $treedir${localedir} is changed to that
> of ${LOCALETREESRC}${localedir}. However, I now realized that the problem
> may be due to the fact that I have usrmerge enabled in DISTRO_FEATURES,
> which causes the above line to copy things it was never meant to copy, in
> this case ${LOCALETREESRC}${localedir}. I tried to just remove the line
> altogether and then it built just fine. But I do not know what the
> consequences are of removing it... I guess it is related to setting up an
> environment for qemu to run in, but since that seems to work fine without
> the files copied by the above line, maybe it is not needed? Or maybe it
> is just not needed when having usrmerge in DISTRO_FEATURES? I tried to
> backtrack it through the commit logs, but it was introduced with the
> do_prep_locale_tree() function, so no help there.
>

I wonder if we should use --preserve option to tar -xf call here for
making it explicit.

> > --
> > 2.20.1
>
> //Peter
>


More information about the Openembedded-core mailing list