diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-27 10:25:00 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-07-01 08:49:37 +0100 |
| commit | 6c8292de8541ddf44f34470d06796c3ef7aab3bc (patch) | |
| tree | 2b44061f7826fc23d1df1ba08726df2b5351fe05 /meta/classes-global/sstate.bbclass | |
| parent | 99d0842f16aeb0c43f4674c60cb815c6438ed3bf (diff) | |
| download | poky-6c8292de8541ddf44f34470d06796c3ef7aab3bc.tar.gz | |
bitbake.conf/sstate: Introduce OE_SHARED_UMASK to standarise shared area umask
Currently, the "shared" directory permissions of sstate are hardcoded. Since
multiple areas of the code reference this, separate it out to a variable to
allow the behaviour to be configurable. Initially this applies to SSTATE_DIR.
(From OE-Core rev: ce32daa9843bcb5f6daf3560c64ca9e5144adcb0)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-global/sstate.bbclass')
| -rw-r--r-- | meta/classes-global/sstate.bbclass | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass index 2968cc4c2e..53bc2e3940 100644 --- a/meta/classes-global/sstate.bbclass +++ b/meta/classes-global/sstate.bbclass | |||
| @@ -745,7 +745,7 @@ def pstaging_fetch(sstatefetch, d): | |||
| 745 | if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False): | 745 | if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG"), False): |
| 746 | uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)] | 746 | uris += ['file://{0}.sig;downloadfilename={0}.sig'.format(sstatefetch)] |
| 747 | 747 | ||
| 748 | with bb.utils.umask(0o002): | 748 | with bb.utils.umask(bb.utils.to_filemode(d.getVar("OE_SHARED_UMASK"))): |
| 749 | bb.utils.mkdirhier(dldir) | 749 | bb.utils.mkdirhier(dldir) |
| 750 | 750 | ||
| 751 | for srcuri in uris: | 751 | for srcuri in uris: |
| @@ -776,9 +776,10 @@ sstate_task_prefunc[dirs] = "${WORKDIR}" | |||
| 776 | python sstate_task_postfunc () { | 776 | python sstate_task_postfunc () { |
| 777 | shared_state = sstate_state_fromvars(d) | 777 | shared_state = sstate_state_fromvars(d) |
| 778 | 778 | ||
| 779 | omask = os.umask(0o002) | 779 | shared_umask = bb.utils.to_filemode(d.getVar("OE_SHARED_UMASK")) |
| 780 | if omask != 0o002: | 780 | omask = os.umask(shared_umask) |
| 781 | bb.note("Using umask 0o002 (not %0o) for sstate packaging" % omask) | 781 | if omask != shared_umask: |
| 782 | bb.note("Using umask %0o (not %0o) for sstate packaging" % (shared_umask, omask)) | ||
| 782 | sstate_package(shared_state, d) | 783 | sstate_package(shared_state, d) |
| 783 | os.umask(omask) | 784 | os.umask(omask) |
| 784 | 785 | ||
| @@ -843,7 +844,8 @@ python sstate_create_and_sign_package () { | |||
| 843 | 844 | ||
| 844 | # Create the required sstate directory if it is not present. | 845 | # Create the required sstate directory if it is not present. |
| 845 | if not sstate_pkg.parent.is_dir(): | 846 | if not sstate_pkg.parent.is_dir(): |
| 846 | with bb.utils.umask(0o002): | 847 | shared_umask = bb.utils.to_filemode(d.getVar("OE_SHARED_UMASK")) |
| 848 | with bb.utils.umask(shared_umask): | ||
| 847 | bb.utils.mkdirhier(str(sstate_pkg.parent)) | 849 | bb.utils.mkdirhier(str(sstate_pkg.parent)) |
| 848 | 850 | ||
| 849 | if sign_pkg: | 851 | if sign_pkg: |
