summaryrefslogtreecommitdiffstats
path: root/meta/classes/sstate.bbclass
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:18:56 +0000
commitbc73d2c63b48d51d41fd8c2eaa43c941b02c7e2e (patch)
treeddf9d4d54451fe572fd848669f5a33d6c9cd6798 /meta/classes/sstate.bbclass
parent1f3c5353504e225e3bdf6fb7000d6eab0b534ee0 (diff)
downloadpoky-bc73d2c63b48d51d41fd8c2eaa43c941b02c7e2e.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: 590de1dd89cfd5f0ca7395880ba88b27ee35470d) 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: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-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 2ff0d6850c..a2496dce2b 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -796,7 +796,7 @@ sstate_task_postfunc[dirs] = "${WORKDIR}"
796sstate_create_package () { 796sstate_create_package () {
797 # Exit early if it already exists 797 # Exit early if it already exists
798 if [ -e ${SSTATE_PKG} ]; then 798 if [ -e ${SSTATE_PKG} ]; then
799 [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} 799 touch ${SSTATE_PKG} 2>/dev/null || true
800 return 800 return
801 fi 801 fi
802 802
@@ -830,7 +830,7 @@ sstate_create_package () {
830 else 830 else
831 rm $TFILE 831 rm $TFILE
832 fi 832 fi
833 [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} 833 touch ${SSTATE_PKG} 2>/dev/null || true
834} 834}
835 835
836python sstate_sign_package () { 836python sstate_sign_package () {