<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7868</bug_id>
          
          <creation_ts>2015-06-09 15:27:26 +0000</creation_ts>
          <short_desc>devtool: deploy-target follows symlinks when deploying</short_desc>
          <delta_ts>2015-10-15 09:44:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>1.8</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>1.9 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>bogdanx.a.voiculescu</cc>
    
    <cc>ejo</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          <qa_contact name="Costin">costin.c.constantin</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>New (Never tested)</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>51579</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-06-09 15:27:26 +0000</bug_when>
    <thetext>devtool deploy-target uses scp -rp to deploy files to the target. Unfortunately it seems like this has the unfortunate behaviour of following symlinks, with the result that if for example one of the files being deployed is a symlink, you get the target of the symlink (which will probably be a file on the user&apos;s host system) deployed instead of the file itself. You can see this with mdadm - /usr/lib/mdadm/ptest/mdadm on the target will be a copy of /sbin/mdadm on the host instead of a symlink to /sbin/mdadm.

Apparently this behaviour of scp is by design, so we&apos;ll have to work around it. We could use tar + ssh as described here:

https://smaftoul.wordpress.com/2008/08/13/recursive-scp-and-symlinks/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51782</commentid>
    <comment_count>1</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-06-18 11:02:28 +0000</bug_when>
    <thetext>Fix merged to master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2054b29dd7be74d09b53df178ef87c69b15a809e

This is probably a candidate for fido as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55340</commentid>
    <comment_count>2</comment_count>
    <who name="Costin">costin.c.constantin</who>
    <bug_when>2015-10-15 09:44:08 +0000</bug_when>
    <thetext>Hello,

Tested on master with d302c98822efe2cb78a63b620aed1b94b4ed4a68 on Ubuntu 15.04 os.

Steps performed to test it:

1) follow the directions described in YP#8136 to create a recipe and package it
(used this because i had the environment already in place). Besides those directions, I modified the do_install step, by adding a symlink to a file on target:

do_install () {
        # Specify install commands here
        install -d ${D}/${bindir}
        install -m 0755 hellomake ${D}/${bindir}
        ln -s /usr/bin/awk ${D}/${bindir}/myawk
}

2) execute devtool deploy-target test root@test_machine:/home/root/teste
root@intel-core2-32:~/teste/usr/bin# ls -ltr
total 12
-rwxr-xr-x 1 root root 8632 Oct 15  2015 hellomake
lrwxrwxrwx 1 root root   12 May  4 21:42 myawk -&gt; /usr/bin/awk

This proves the symlink was copied instead of the file (awk) that i also have on host machine

Marking as verified.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>