[yocto] why cp in do_install() change file permission mode?

Richard Purdie rpurdie at linux.intel.com
Fri Dec 10 08:20:18 PST 2010


On Thu, 2010-12-02 at 18:16 +0800, Lu, Lianhao wrote:
> Hi fellows,
> 
> Could anyone tell me why does the cp in do_install() change the file permission mode? Thanks!
> 
> do_install () {
> 	rm -rf ${D}${installed_dir}
> 	install -d ${D}${installed_dir}
> 	cp -rp ${S}/* ${D}${installed_dir}
> }
> 
> After "bitbake xxx -c install", I found the file under
> ${D}${installed_dir} had the permission mode of 0744 while the
> corresponding file under directory ${S} had the mode of 0644. Why did
> this happen? How to avoid this kind of mode change? Thanks!

do_install and all tasks that work on the output of do_install run under
pseduo which can mean the permissions on disk might not match the real
permissions as seen within a pseduo session.

To illustrate, in a do_install do something like

chown root.root somefile 
ls -la somefile

then look at the file on disk and you'll see different owners. The
ownership works the same way as the permissions.

Cheers,

Richard

(Note Poky specific questions should be on the poky mailing list)




More information about the yocto mailing list