summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton D. Kachalov <gmouse@google.com>2021-03-21 11:26:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-19 12:55:20 +0100
commit62402e177aa9ed6bcce2a7dc7a74b34000ff2603 (patch)
tree1bbbc5a065819d96792f58c07dcea8ddf1906048
parent786cd996ae17da344817a6fefcfd1c403bcb83ff (diff)
downloadpoky-62402e177aa9ed6bcce2a7dc7a74b34000ff2603.tar.gz
run-postinsts: do not remove postinsts directory.
When running on the systems having read-only rootfs backed by overlayfs, removing the whole directory lead to create a special char device file on the upperdir to reflect directory's removal. Once it is required to upgrade the whole read-only image that might contain new postinsts scripts, it will be impossible to run such scripts with a "deletion mark" file on the overlayfs -- the whole directory will be marked as deleted regardless new files in it. (From OE-Core rev: 214056938f8408c75b68002643789284eabd0389) Signed-off-by: Anton D. Kachalov <gmouse@google.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1a27b62b225ffeecec47c249a0b86cc54d775add) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xmeta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts10
1 files changed, 4 insertions, 6 deletions
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
index f84a7e18c8..95dccb9cae 100755
--- a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -72,12 +72,12 @@ exec_postinst_scriptlets() {
72 else 72 else
73 echo "ERROR: postinst $i failed." 73 echo "ERROR: postinst $i failed."
74 [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log 74 [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
75 remove_pi_dir=0 75 remove_rcsd_link=0
76 fi 76 fi
77 done 77 done
78} 78}
79 79
80remove_pi_dir=1 80remove_rcsd_link=1
81if $pm_installed; then 81if $pm_installed; then
82 case $pm in 82 case $pm in
83 "ipk") 83 "ipk")
@@ -92,9 +92,7 @@ else
92 exec_postinst_scriptlets 92 exec_postinst_scriptlets
93fi 93fi
94 94
95# since all postinstalls executed successfully, remove the postinstalls directory 95# since all postinstalls executed successfully, remove the rcS.d link
96# and the rcS.d link 96if [ $remove_rcsd_link = 1 ]; then
97if [ $remove_pi_dir = 1 ]; then
98 rm -rf $pi_dir
99 remove_rcsd_link 97 remove_rcsd_link
100fi 98fi