Bug 14451

Summary: devtool: deploy-target: failed to preserve ownership with --strip option
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Florian Amstutz <florian.amstutz>
Component: Scripts and ToolsAssignee: Florian Amstutz <florian.amstutz>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: randy.macleod, ross.burton
Version: 3.1.8   
Target Milestone: 3.4 M2   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Florian Amstutz 2021-06-25 07:48:49 UTC
When running "devtool deploy-target" with the --strip option the ownership cannot be preserved during copying the files from "image" to "deploy-target-stripped":
 
devtool deploy-target --strip --no-host-check --no-preserve less root@....2
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/bin/less': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/bin/lesskey': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/bin/lessecho': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/bin': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/share/man/man1/less.1': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/share/man/man1/lesskey.1': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/share/man/man1/lessecho.1': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/share/man/man1': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/share/man': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr/share': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped/usr': Operation not permitted
cp: failed to preserve ownership for '/home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped': Operation not permitted
INFO: Successfully deployed /home/yocto/sdk/tmp/work/cortexa9t2hf-neon-poky-linux-gnueabi/less/551-r0/deploy-target-stripped
 
On the target, the deployed files have the ownership of the eSDK user:
 
root@qemu:~# ls -lah /usr/bin/less
-rwx------    1 1002     1003      116.7K Jun 24 08:53 /usr/bin/less

"devtool deploy-target" without the --strip option works as expected. The files are owned by root.

This has been observed in the Yocto build environment and eSDK environment.
The eSDK has been built and installed on the same machine.
Tested on Ubuntu 16.04, 18.04 and 20.04.
Comment 1 Florian Amstutz 2021-06-30 11:51:42 UTC
The Bug has been introduced by commit a2db4fa127a3347fc6df31f895fb0b552669119e which added ${WORKDIR}/deploy-* to PSEUDO_IGNORE_PATHS.

By using the name "devtool-deploy-target-stripped" instead of "deploy-target-stripped" deploy-target with --strip works fine.
Comment 2 Florian Amstutz 2021-06-30 15:10:54 UTC
I have provided a patch to the mailing list:
https://lists.yoctoproject.org/g/yocto/message/54019