summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2021-10-20 18:25:46 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-03 11:19:04 +0000
commit68078583b50495b1c653bb74526b3f5bd3c9a06a (patch)
tree67eabef778b973130ddc22e21ce8f5e297903d54
parent0550ad316d6821e6b0ae1a662d67a307708a4d86 (diff)
downloadpoky-68078583b50495b1c653bb74526b3f5bd3c9a06a.tar.gz
sstate: fix touching files inside pseudo
running the 'id' command inside the sstate_create_package function shows that this funcion run inside the pseudo: uid=0(root) gid=0(root) groups=0(root) The check for touch files [ ! -w ${SSTATE_PKG} ] will always return true and the touch can fail when the real user don't have permission or in readonly filesystem. As the documentation refers, the file test operator "-w" check if the file has write permission (for the user running the test). We can avoid this test running the touch and mask any return errors that we have. (From OE-Core rev: 8acd5626b5b89fb48d5d7f0e4eee263793ba383f) Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f6e7445c94443544e92fda97a017ce93393c5f84) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 8b4bfc25b7..4bc80b6078 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -800,7 +800,7 @@ sstate_task_postfunc[dirs] = "${WORKDIR}"
800sstate_create_package () { 800sstate_create_package () {
801 # Exit early if it already exists 801 # Exit early if it already exists
802 if [ -e ${SSTATE_PKG} ]; then 802 if [ -e ${SSTATE_PKG} ]; then
803 [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} 803 touch ${SSTATE_PKG} 2>/dev/null || true
804 return 804 return
805 fi 805 fi
806 806
@@ -834,7 +834,7 @@ sstate_create_package () {
834 else 834 else
835 rm $TFILE 835 rm $TFILE
836 fi 836 fi
837 [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} 837 touch ${SSTATE_PKG} 2>/dev/null || true
838} 838}
839 839
840python sstate_sign_package () { 840python sstate_sign_package () {