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

Bruce Ashfield bruce.ashfield at windriver.com
Thu Dec 2 05:55:55 PST 2010


On 10-12-02 05:16 AM, 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!

What's the umask of the your uid ? .. or maybe this is
one of those settings that is controlled by bitbake/poky.
But either way, it should just be that the cp is taking
the current umask which is changing the mode to 0744.

One option is to use install to copy the files, since it
allows a specific set of permissions to be set on its
command line.

I haven't looked into this at all, just some thoughts
off the top of my head.

Cheers,

Bruce

>
> Best Regards
> -Lianhao Lu
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto




More information about the yocto mailing list