On 3/9/12 8:15 PM, Andreas Oberritter wrote:
* Explicitly set umask to 022. Otherwise the build system's
   umask leaks into the image.

I'm surprised that do_package_ipk[umask] didn't work. Perhaps its the way it's being invoked that is the issue. (If bitbake doesn't run it, but something else does.. then the umask setting doesn't get used.)

As for the change of the umask, the changes appear to be specific to the ipk case. Is this the desired behavior, or could deb and rpm suffer from similar issues? (I'm not familiar enough with opkg to know how it handles umask settings during package install/rootfs construction..)

I believe that RPM sets a default umask when it goes through it's package installs/rootfs generation. But does DEB?

--Mark

Signed-off-by: Andreas Oberritter<[email protected]>
---
* I tried do_package_ipk[umask] = "022" first, but it didn't work.

  meta/classes/package_ipk.bbclass |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index 565ef93..e7da07a 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -317,7 +317,9 @@ python do_package_ipk () {
                controldir = os.path.join(root, 'CONTROL')
                bb.mkdirhier(controldir)
                try:
+                       mask = os.umask(022)
                        ctrlfile = file(os.path.join(controldir, 'control'), 
'w')
+                       os.umask(mask)
                except OSError:
                        bb.utils.unlockfile(lf)
                        raise bb.build.FuncFailed("unable to open control file for 
writing.")
@@ -410,7 +412,9 @@ python do_package_ipk () {
                conffiles_str = localdata.getVar("CONFFILES", True)
                if conffiles_str:
                        try:
+                               mask = os.umask(022)
                                conffiles = file(os.path.join(controldir, 
'conffiles'), 'w')
+                               os.umask(mask)
                        except OSError:
                                bb.utils.unlockfile(lf)
                                raise bb.build.FuncFailed("unable to open conffiles 
for writing.")


_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Reply via email to