I try to change owership of symbolic link in do_install, but it doesn't work. I use the recipes like below. === do_install_append () { touch ${D}${bindir}/chown-test ln -fs ${bindir}/chown-test ${D}${bindir}/link-to-chown-test chown -R -h user:user ${D}${bindir}/link-to-chown-test chown -R -h user:user ${D}${bindir}/chown-test } === It seems that only ownership of symbolic-link was modified to root when copied to package-split. > $ echo '.dump' |sqlite3 <WORKDIR>/pseudo/files.db |grep chown > INSERT INTO files VALUES(120,'<WORKDIR>/image/usr/bin/chown-test',2066,26881543,1000,1000,33188,0,0); > INSERT INTO files VALUES(121,'<WORKDIR>/image/usr/bin/link-to-chown-test',2066,26881556,1000,1000,41471,0,0); > INSERT INTO files VALUES(17091,'<WORKDIR>/package/usr/bin/chown-test',2066,28453918,1000,1000,33188,0,0); > INSERT INTO files VALUES(17106,'<WORKDIR>/package/usr/bin/link-to-chown-test',2066,28453919,1000,1000,41471,0,0); > INSERT INTO files VALUES(18732,'<WORKDIR>/packages-split/rsyslog/usr/bin/chown-test',2066,28453918,1000,1000,33188,0,0); > INSERT INTO files VALUES(18733,'<WORKDIR>/packages-split/rsyslog/usr/bin/link-to-chown-test',2066,28454108,0,0,41471,0,0); Note: Paths omitted for clarity The following is the copy process that causes this problem. When os.lchown() is uncommented, it works fine for me. - lib/bb/utils.py > def copyfile(src, dest, newmtime = None, sstat = None): ...(snip)... > if stat.S_ISLNK(sstat[stat.ST_MODE]): > try: > target = os.readlink(src) > if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]): > os.unlink(dest) > os.symlink(target, dest) > #os.lchown(dest,sstat[stat.ST_UID],sstat[stat.ST_GID]) > return os.lstat(dest) I think this is a bug. Right?
It does sound like a bug. Could you send a patch please? Bonus marks if you extend our automated test coverage http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/lib/oeqa/selftest/cases/package.py Run as oe-sefltest -e package.PackageTeststest_preserve_sparse_hardlinks (could just add a chown'd symlink to that test)
Hi Richard, thank you for reply. > It does sound like a bug. Could you send a patch please? I just sent a patch. https://bugzilla.yoctoproject.org/show_bug.cgi?id=13806 > Bonus marks if you extend our automated test coverage > http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/lib/oeqa/selftest/cases/package.py > Run as oe-sefltest -e package.PackageTeststest_preserve_sparse_hardlinks I'm making a test now, however it may take some time because I am not used to it.
(In reply to comment #2) > Hi Richard, > thank you for reply. > > > It does sound like a bug. Could you send a patch please? > I just sent a patch. https://bugzilla.yoctoproject.org/show_bug.cgi?id=13806 Thanks, I saw it, put through testing and then merged it! I did a little digging of the history and that code line has been commented out since it was added in 2005! (no idea why) > > Bonus marks if you extend our automated test coverage > > http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/lib/oeqa/selftest/cases/package.py > > Run as oe-sefltest -e package.PackageTeststest_preserve_sparse_hardlinks > I'm making a test now, however it may take some time because I am not used > to it. Thanks, the tests are how we managed to keep the project stable so this does help and is appreciated!
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=2070441607c1315bf3a161968963d7ca979199a0 was the merged commit
Bug fixed. Added backport requests. Tests coming in M4 hopefully. Thanks Daisuke.
> > Bonus marks if you extend our automated test coverage > > http://git.yoctoproject.org/cgit.cgi/poky/tree/meta/lib/oeqa/selftest/cases/package.py > > Run as oe-sefltest -e package.PackageTeststest_preserve_sparse_hardlinks > I'm making a test now, however it may take some time because I am not used to it. I send a patch to add test. Please review it! https://patchwork.openembedded.org/patch/171025/
Thanks for the test, it was close to release to add new tests but this will be queued for the next cycle./
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=caa530a277fd67cb88a077dddcad4b60911cf332