summaryrefslogtreecommitdiffstats
path: root/meta
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-10-29 11:17:26 +0100
commit7ff34cf0418c6fee43f4d8a0a5d3c5bb93b945bf (patch)
treefb2ea43cc04d86d42a0ca1a5c632832b4bbabb60 /meta
parent41320cf8c3a77b8e95f6c99fe73ca638548d9174 (diff)
downloadpoky-7ff34cf0418c6fee43f4d8a0a5d3c5bb93b945bf.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: 1092bb67737eff63c24c26c9f807bec5e6adffc9) 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>
Diffstat (limited to 'meta')
-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 701a19bc61..240ae111ee 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -825,7 +825,7 @@ sstate_task_postfunc[dirs] = "${WORKDIR}"
825sstate_create_package () { 825sstate_create_package () {
826 # Exit early if it already exists 826 # Exit early if it already exists
827 if [ -e ${SSTATE_PKG} ]; then 827 if [ -e ${SSTATE_PKG} ]; then
828 [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} 828 touch ${SSTATE_PKG} 2>/dev/null || true
829 return 829 return
830 fi 830 fi
831 831
@@ -859,7 +859,7 @@ sstate_create_package () {
859 else 859 else
860 rm $TFILE 860 rm $TFILE
861 fi 861 fi
862 [ ! -w ${SSTATE_PKG} ] || touch ${SSTATE_PKG} 862 touch ${SSTATE_PKG} 2>/dev/null || true
863} 863}
864 864
865python sstate_sign_package () { 865python sstate_sign_package () {