Skip to contentSkip to conversation

package.bbclass: ensure correct modes on directories

PATCH In review Chen Qi 2 participants 3 messages Jul 17, 2014 – Jul 18, 2014

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover package.bbclass: ensure correct modes on directories

The following changes since commit 846bc50fde11bbb36c8eb5b2e3ae6bb644c037f3:

ltp: use "foreign" automake strictness (2014-07-16 10:27:16 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/package-file-modes
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/package-file-modes

Chen Qi (1):
package.bbclass: ensure correct modes on directories

 meta/classes/package.bbclass |    1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 1/1 package.bbclass: ensure correct modes on directories

Previously, when we create directories in populate_packages, the directory modes are not all correct. Take the base-files recipe as an example. The directory package/home has mode 2755, but packages-split/base-files/home has mode 0755.

So after using creating directory, we need to use chmod to ensure it gets the correct mode.

[YOCTO #6517]

---
 meta/classes/package.bbclass |    1 +
 1 file changed, 1 insertion(+)
meta/classes/package.bbclass +1 -0
index 26a20d1..7e85af4 100644
@@ -1019,6 +1019,7 @@ python populate_packages () {
                 dest = os.path.join(dest, p)
                 fstat = cpath.stat(src)
                 os.mkdir(dest, fstat.st_mode)
+                os.chmod(dest, fstat.st_mode)
                 os.chown(dest, fstat.st_uid, fstat.st_gid)
                 if p not in seen:
                     seen.append(p)
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 3 lines · Chen Qi

fstat = cpath.stat(src)
os.mkdir(dest, fstat.st_mode)
+ os.chmod(dest, fstat.st_mode)

This doesn't make sense. Shouldn't the fstat.st_mode to os.mkdir have taken care of the mode for us?

Cheers,

Richard