All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sstate: Fix make_relative_symlink() for RSS
@ 2017-02-01 10:03 Jussi Kukkonen
  2017-02-01 11:23 ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Jussi Kukkonen @ 2017-02-01 10:03 UTC (permalink / raw)
  To: openembedded-core

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@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.


Thanks,
 Jussi


 meta/classes/sstate.bbclass | 35 ++++++++++++-----------------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index aeb7466..7f99cd3 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -583,32 +583,27 @@ python sstate_hardcode_path () {
 def sstate_package(ss, d):
     import oe.path
 
-    def make_relative_symlink(path, outputpath, d):
-        # Replace out absolute TMPDIR paths in symlinks with relative ones
+    def make_relative_symlink(path, workdir, d):
+        # Replace absolute sysroot paths in symlinks with relative ones
         if not os.path.islink(path):
             return
         link = os.readlink(path)
         if not os.path.isabs(link):
             return
-        if not link.startswith(tmpdir):
+        if not link.startswith(workdir):
             return
 
-        #base = os.path.relpath(link, os.path.dirname(path))
+        directory = os.path.dirname(path.rpartition(workdir)[2])
+        base_link = link.rpartition(workdir)[2]
+        rel_path = os.path.relpath(base_link,directory)
 
-        depth = outputpath.rpartition(tmpdir)[2].count('/')
-        base = link.partition(tmpdir)[2].strip()
-        while depth > 1:
-            base = "/.." + base
-            depth -= 1
-        base = "." + base
-
-        bb.debug(2, "Replacing absolute path %s with relative path %s for %s" % (link, base, outputpath))
+        bb.debug(2, "Replacing absolute path %s with relative path %s for %s" % (link, rel_path, path))
         os.remove(path)
-        os.symlink(base, path)
+        os.symlink(rel_path, path)
 
-    tmpdir = d.getVar('TMPDIR')
+    workdir = d.getVar('WORKDIR')
 
-    sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
+    sstatebuild = workdir + "/sstate-build-" +ss['task'] + "/"
     sstatepkg = d.getVar('SSTATE_PKG') + '_'+ ss['task'] + ".tgz"
     bb.utils.remove(sstatebuild, recurse=True)
     bb.utils.mkdirhier(sstatebuild)
@@ -620,18 +615,12 @@ def sstate_package(ss, d):
             continue
         srcbase = state[0].rstrip("/").rsplit('/', 1)[0]
         for walkroot, dirs, files in os.walk(state[1]):
-            for file in files:
+            for file in files + dirs:
                 srcpath = os.path.join(walkroot, file)
-                dstpath = srcpath.replace(state[1], state[2])
-                make_relative_symlink(srcpath, dstpath, d)
-            for dir in dirs:
-                srcpath = os.path.join(walkroot, dir)
-                dstpath = srcpath.replace(state[1], state[2])
-                make_relative_symlink(srcpath, dstpath, d)
+                make_relative_symlink(srcpath, workdir, d)
         bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0]))
         os.rename(state[1], sstatebuild + state[0])
 
-    workdir = d.getVar('WORKDIR')
     for plain in ss['plaindirs']:
         pdir = plain.replace(workdir, sstatebuild)
         bb.utils.mkdirhier(plain)
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] sstate: Fix make_relative_symlink() for RSS
  2017-02-01 10:03 [PATCH] sstate: Fix make_relative_symlink() for RSS Jussi Kukkonen
@ 2017-02-01 11:23 ` Richard Purdie
  2017-02-01 11:44   ` Jussi Kukkonen
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2017-02-01 11:23 UTC (permalink / raw)
  To: Jussi Kukkonen, openembedded-core

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@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?

Cheers,

Richard
> 
> Thanks,
>  Jussi
> 
> 
>  meta/classes/sstate.bbclass | 35 ++++++++++++-----------------------
>  1 file changed, 12 insertions(+), 23 deletions(-)
> 
> diff --git a/meta/classes/sstate.bbclass
> b/meta/classes/sstate.bbclass
> index aeb7466..7f99cd3 100644
> --- a/meta/classes/sstate.bbclass
> +++ b/meta/classes/sstate.bbclass
> @@ -583,32 +583,27 @@ python sstate_hardcode_path () {
>  def sstate_package(ss, d):
>      import oe.path
>  
> -    def make_relative_symlink(path, outputpath, d):
> -        # Replace out absolute TMPDIR paths in symlinks with
> relative ones
> +    def make_relative_symlink(path, workdir, d):
> +        # Replace absolute sysroot paths in symlinks with relative
> ones
>          if not os.path.islink(path):
>              return
>          link = os.readlink(path)
>          if not os.path.isabs(link):
>              return
> -        if not link.startswith(tmpdir):
> +        if not link.startswith(workdir):
>              return
>  
> -        #base = os.path.relpath(link, os.path.dirname(path))
> +        directory = os.path.dirname(path.rpartition(workdir)[2])
> +        base_link = link.rpartition(workdir)[2]
> +        rel_path = os.path.relpath(base_link,directory)
>  
> -        depth = outputpath.rpartition(tmpdir)[2].count('/')
> -        base = link.partition(tmpdir)[2].strip()
> -        while depth > 1:
> -            base = "/.." + base
> -            depth -= 1
> -        base = "." + base
> -
> -        bb.debug(2, "Replacing absolute path %s with relative path
> %s for %s" % (link, base, outputpath))
> +        bb.debug(2, "Replacing absolute path %s with relative path
> %s for %s" % (link, rel_path, path))
>          os.remove(path)
> -        os.symlink(base, path)
> +        os.symlink(rel_path, path)
>  
> -    tmpdir = d.getVar('TMPDIR')
> +    workdir = d.getVar('WORKDIR')
>  
> -    sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" %
> ss['task'])
> +    sstatebuild = workdir + "/sstate-build-" +ss['task'] + "/"
>      sstatepkg = d.getVar('SSTATE_PKG') + '_'+ ss['task'] + ".tgz"
>      bb.utils.remove(sstatebuild, recurse=True)
>      bb.utils.mkdirhier(sstatebuild)
> @@ -620,18 +615,12 @@ def sstate_package(ss, d):
>              continue
>          srcbase = state[0].rstrip("/").rsplit('/', 1)[0]
>          for walkroot, dirs, files in os.walk(state[1]):
> -            for file in files:
> +            for file in files + dirs:
>                  srcpath = os.path.join(walkroot, file)
> -                dstpath = srcpath.replace(state[1], state[2])
> -                make_relative_symlink(srcpath, dstpath, d)
> -            for dir in dirs:
> -                srcpath = os.path.join(walkroot, dir)
> -                dstpath = srcpath.replace(state[1], state[2])
> -                make_relative_symlink(srcpath, dstpath, d)
> +                make_relative_symlink(srcpath, workdir, d)
>          bb.debug(2, "Preparing tree %s for packaging at %s" %
> (state[1], sstatebuild + state[0]))
>          os.rename(state[1], sstatebuild + state[0])
>  
> -    workdir = d.getVar('WORKDIR')
>      for plain in ss['plaindirs']:
>          pdir = plain.replace(workdir, sstatebuild)
>          bb.utils.mkdirhier(plain)
> -- 
> 2.1.4
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sstate: Fix make_relative_symlink() for RSS
  2017-02-01 11:23 ` Richard Purdie
@ 2017-02-01 11:44   ` Jussi Kukkonen
  2017-02-01 12:00     ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Jussi Kukkonen @ 2017-02-01 11:44 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]

On 1 February 2017 at 13:23, Richard Purdie <
richard.purdie@linuxfoundation.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@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?

Jussi

[-- Attachment #2: Type: text/html, Size: 2380 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sstate: Fix make_relative_symlink() for RSS
  2017-02-01 11:44   ` Jussi Kukkonen
@ 2017-02-01 12:00     ` Richard Purdie
  2017-02-01 12:38       ` Jussi Kukkonen
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2017-02-01 12:00 UTC (permalink / raw)
  To: Jussi Kukkonen; +Cc: Patches and discussions about the oe-core layer

On Wed, 2017-02-01 at 13:44 +0200, Jussi Kukkonen wrote:
> On 1 February 2017 at 13:23, Richard Purdie <richard.purdie@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@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?

Cheers,

Richard





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sstate: Fix make_relative_symlink() for RSS
  2017-02-01 12:00     ` Richard Purdie
@ 2017-02-01 12:38       ` Jussi Kukkonen
  2017-02-01 12:53         ` Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Jussi Kukkonen @ 2017-02-01 12:38 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 2726 bytes --]

On 1 February 2017 at 14:00, Richard Purdie <
richard.purdie@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@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@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

[-- Attachment #2: Type: text/html, Size: 3778 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sstate: Fix make_relative_symlink() for RSS
  2017-02-01 12:38       ` Jussi Kukkonen
@ 2017-02-01 12:53         ` Richard Purdie
  2017-02-01 13:27           ` Jussi Kukkonen
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2017-02-01 12:53 UTC (permalink / raw)
  To: Jussi Kukkonen; +Cc: Patches and discussions about the oe-core layer

On Wed, 2017-02-01 at 14:38 +0200, Jussi Kukkonen wrote:
> On 1 February 2017 at 14:00, Richard Purdie <richard.purdie@linuxfoun
> dation.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@linux
> > foun
> > > 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@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

Are you sure path isn't /mnt/extra-ssd/tmp/work/x86_64-linux/openssl-
native/1.0.2j-r0/recipe-sysroot-native/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?

I think you haven't realised path in this (native) case includes
$base_prefix which is the long path. I could well be missing something
too though...

Cheers,

Richard



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] sstate: Fix make_relative_symlink() for RSS
  2017-02-01 12:53         ` Richard Purdie
@ 2017-02-01 13:27           ` Jussi Kukkonen
  0 siblings, 0 replies; 7+ messages in thread
From: Jussi Kukkonen @ 2017-02-01 13:27 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 3352 bytes --]

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

> On Wed, 2017-02-01 at 14:38 +0200, Jussi Kukkonen wrote:
> > On 1 February 2017 at 14:00, Richard Purdie <richard.purdie@linuxfoun
> > dation.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@linux
> > > foun
> > > > 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@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
>
> Are you sure path isn't /mnt/extra-ssd/tmp/work/x86_64-linux/openssl-
> native/1.0.2j-r0/recipe-sysroot-native/usr/lib/ssl/certs ?
>

state[1] really is the whole thing until and including
"recipe-sysroot-native":

/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
removing that prefix from path leaves me with
  /usr/lib/ssl/certs

[-- Attachment #2: Type: text/html, Size: 4857 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-02-01 13:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-01 10:03 [PATCH] sstate: Fix make_relative_symlink() for RSS Jussi Kukkonen
2017-02-01 11:23 ` Richard Purdie
2017-02-01 11:44   ` Jussi Kukkonen
2017-02-01 12:00     ` Richard Purdie
2017-02-01 12:38       ` Jussi Kukkonen
2017-02-01 12:53         ` Richard Purdie
2017-02-01 13:27           ` Jussi Kukkonen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.