Bug 7428 - meta/lib/oe/package.py: wrong file ownership in packages
Summary: meta/lib/oe/package.py: wrong file ownership in packages
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.7.2
Hardware: All Multiple
: Medium normal
Target Milestone: 1.7.3
Assignee: Paul Eggleton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-03-09 12:45 UTC by fabrice.coulon
Modified: 2015-05-18 16:22 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fabrice.coulon 2015-03-09 12:45:27 UTC
The commit with SHA1 6f7943 currently in Poky branch "origin/dizzy" , has created some problems for us. We have seen that the ownership of some files in rpm packages have changed from UID:GID e.g root:viewer to root:root. The do_install task was producing correct/expected output but when the files are being put in a rpm package, they changed ownership.

I have run git bisect and managed to isolate the commit that was triggering the problem (commit with SHA1 6f7943 for meta/lib/oe/package.py):

-    stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
+    # Use mv to break hardlinks
+    stripcmd = "'%s' %s '%s' -o '%s.tmp' && mv '%s.tmp' '%s'" % (strip, extraflags, file, file, file, file)


If I change that line to this instead:


stripcmd = "'%s' %s '%s' -o '%s.tmp' && chown --reference='%s' '%s.tmp' && mv '%s.tmp' '%s'" % (strip, extraflags, file, file, file, file, file, file)


Then, the ownership is kept as expected. I have also checked that the problem is also on master. If you confirm that this can be an issue, I can send a patch today with the suggested solution.

/Fabrice
Comment 1 Saul Wold 2015-03-12 00:36:27 UTC
Please go ahead and send the patch if you have not already, for inclusion in Dizzy also.  Should to go master and dizzy probably.
Comment 2 fabrice.coulon 2015-03-26 09:13:54 UTC
I've seen the fix has been pushed to master branch but could you also make it available on the Dizzy branch of Poky?
Comment 3 Paul Eggleton 2015-05-14 15:02:51 UTC
For reference the fix merged to master was this one:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=1e34e71e0f6752ec33eb4b30ce72f249b80e9a5d

Since this got stalled I'll do the backport and send it for dizzy.
Comment 4 Paul Eggleton 2015-05-15 15:34:53 UTC
dizzy patch posted for review.
Comment 5 Paul Eggleton 2015-05-18 16:22:50 UTC
Fix has now been merged into the dizzy branch also:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=dizzy&id=6adbd2deb92a4159106b78fe880d97ac7e686e95

Marking as resolved.