[OE-core] [PATCH] sstate: Fix make_relative_symlink() for RSS

Jussi Kukkonen jussi.kukkonen at intel.com
Wed Feb 1 12:38:58 UTC 2017


On 1 February 2017 at 14:00, Richard Purdie <
richard.purdie at linuxfoundation.org> wrote:

> On Wed, 2017-02-01 at 13:44 +0200, Jussi Kukkonen wrote:
> > On 1 February 2017 at 13:23, Richard Purdie <richard.purdie at linuxfoun
> > dation.org> wrote:
> > > On Wed, 2017-02-01 at 12:03 +0200, Jussi Kukkonen wrote:
> > > > Recipe-specific sysroots broke make_relative_symlink(), which
> > > > turns absolute symlinks in sysroots into relative ones. Use the
> > > > difference between the (in-sysroot) paths to construct the
> > > relative
> > > > symlink.
> > > >
> > > > This fixes links in openssl-native, fontconfig-native and bzip2-
> > > > native.
> > > >
> > > > Signed-off-by: Jussi Kukkonen <jussi.kukkonen at intel.com>
> > > > ---
> > > >
> > > > sstate is not an area I'm familiar with, please take a good look.
> > > >
> > > > As far as I could see outputpath (based on state[2]) was never
> > > really
> > > > needed so I did not use it in the new version.
> > >
> > > I don't think we can hardcode workdir into here as for tasks like
> > > do_deploy, this makes no sense. I think we removed most of the
> > > absolute
> > > links from the deploy tasks so we currently don't need this, at
> > > least
> > > in the common case but the sstate code is meant to be generic.
> > >
> > > I am wondering if we need to pass in anything at all, can't we just
> > > call relpath on the original path and turn it into a relative one
> > > directly without referencing it back to TMPDIR/WORKDIR?
> > >
> > The actual file path during do_populate_sysroot is something like
> >   /mnt/extra-ssd/tmp/work/x86_64-linux/openssl-native/1.0.2j-
> > r0/sysroot-destdir/mnt/extra-ssd/tmp/work/x86_64-linux/openssl-
> > native/1.0.2j-r0/recipe-sysroot-native/usr/lib/ssl/certs
> >
> > and the link before make_relative_symlink() points to
> >   /mnt/extra-ssd/tmp/work/x86_64-linux/openssl-native/1.0.2j-
> > r0/recipe-sysroot-native/etc/ssl/certs
> >
> > Assuming those are correct, I don't see how to do this without
> > referencing WORKDIR or TMPDIR?
>
> Good point, I knew I was missing something. How about passing in
> walkroot/state[1] into the function, then you can subtract that from
> the actual file, then run relpath between the (srcpath - walkroot) and
> the link?
>

Figuring out a sysroot-based path for srcpath is indeed possible (and
nicer) using state[1] but then I have:
  path /usr/lib/ssl/certs
  link
/mnt/extra-ssd/tmp/work/x86_64-linux/openssl-native/1.0.2j-r0/recipe-sysroot-native/etc/ssl/certs

Without knowledge of TMPDIR or WORKDIR, I don't see how I can turn link
into anything like
   ../../../etc/ssl/certs

Maybe I'm missing something?

Jussi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170201/595b29b5/attachment-0002.html>


More information about the Openembedded-core mailing list