Skip to contentSkip to conversation

run-postinsts: do not remove postinsts directory.

PATCH In review Anton Kachalov 3 participants 5 messages Mar 21, 2021 – Apr 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 run-postinsts: do not remove postinsts directory.

From: "Anton D. Kachalov" <[email protected]>

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.

---
 .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +4 -6
index f84a7e18c8..95dccb9cae 100755
@@ -72,12 +72,12 @@ exec_postinst_scriptlets() {
 		else
 			echo "ERROR: postinst $i failed."
 			[ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
-			remove_pi_dir=0
+			remove_rcsd_link=0
 		fi
 	done
 }
 
-remove_pi_dir=1
+remove_rcsd_link=1
 if $pm_installed; then
 	case $pm in
 		"ipk")
@@ -92,9 +92,7 @@ else
 	exec_postinst_scriptlets
 fi
 
-# since all postinstalls executed successfully, remove the postinstalls directory
-# and the rcS.d link
-if [ $remove_pi_dir = 1 ]; then
-	rm -rf $pi_dir
+# since all postinstalls executed successfully, remove the rcS.d link
+if [ $remove_rcsd_link = 1 ]; then
 	remove_rcsd_link
 fi
Signature · 1 line
2.31.0.rc2.261.g7f71774620-goog
#1 lore raw
Quoted 10 lines · Anton Kachalov via lists.openembedded.org

From: "Anton D. Kachalov" <[email protected]>

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.

Is this something that should be considered for backporting to dunfell/gatesgarth?

Steve

Quoted 42 lines
---
 .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +4 -7
index f84a7e18c8..95dccb9cae 100755
@@ -72,12 +72,12 @@ exec_postinst_scriptlets() {
                else
                        echo "ERROR: postinst $i failed."
                        [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
-                       remove_pi_dir=0
+                       remove_rcsd_link=0
                fi
        done
 }
 
-remove_pi_dir=1
+remove_rcsd_link=1
 if $pm_installed; then
        case $pm in
                "ipk")
@@ -92,9 +92,7 @@ else
        exec_postinst_scriptlets
 fi
 
-# since all postinstalls executed successfully, remove the postinstalls directory
-# and the rcS.d link
-if [ $remove_pi_dir = 1 ]; then
-       rm -rf $pi_dir
+# since all postinstalls executed successfully, remove the rcS.d link
+if [ $remove_rcsd_link = 1 ]; then
        remove_rcsd_link
 fi
--

2.31.0.rc2.261.g7f71774620-goog

#2 lore raw
Quoted 14 lines · Steve Sakoman
Quoted 10 lines · Anton Kachalov via lists.openembedded.org

From: "Anton D. Kachalov" <[email protected]>

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.

Quoted 3 lines

Is this something that should be considered for backporting to dunfell/gatesgarth?

yes seems so

Quoted 49 lines

Steve

Quoted 46 lines
---
  .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +4 -7
index f84a7e18c8..95dccb9cae 100755
@@ -72,12 +72,12 @@ exec_postinst_scriptlets() {
                 else
                         echo "ERROR: postinst $i failed."
                         [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
-                       remove_pi_dir=0
+                       remove_rcsd_link=0
                 fi
         done
  }
 
-remove_pi_dir=1
+remove_rcsd_link=1
  if $pm_installed; then
         case $pm in
                 "ipk")
@@ -92,9 +92,7 @@ else
         exec_postinst_scriptlets
  fi
 
-# since all postinstalls executed successfully, remove the postinstalls directory
-# and the rcS.d link
-if [ $remove_pi_dir = 1 ]; then
-       rm -rf $pi_dir
+# since all postinstalls executed successfully, remove the rcS.d link
+if [ $remove_rcsd_link = 1 ]; then
         remove_rcsd_link
  fi
--

2.31.0.rc2.261.g7f71774620-goog

#3 lore raw
Quoted 18 lines · Khem Raj
Quoted 14 lines · Steve Sakoman
Quoted 10 lines · Anton Kachalov via lists.openembedded.org

From: "Anton D. Kachalov" <[email protected]>

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.

Quoted 5 lines
Quoted 3 lines

Is this something that should be considered for backporting to dunfell/gatesgarth?

yes seems so

I thought so too, since I need it :-) But I didn't want to grab it just because I liked it!

Steve

Quoted 47 lines
Quoted 47 lines
Quoted 47 lines
---
  .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +4 -7
index f84a7e18c8..95dccb9cae 100755
@@ -72,12 +72,12 @@ exec_postinst_scriptlets() {
                 else
                         echo "ERROR: postinst $i failed."
                         [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
-                       remove_pi_dir=0
+                       remove_rcsd_link=0
                 fi
         done
  }
 
-remove_pi_dir=1
+remove_rcsd_link=1
  if $pm_installed; then
         case $pm in
                 "ipk")
@@ -92,9 +92,7 @@ else
         exec_postinst_scriptlets
  fi
 
-# since all postinstalls executed successfully, remove the postinstalls directory
-# and the rcS.d link
-if [ $remove_pi_dir = 1 ]; then
-       rm -rf $pi_dir
+# since all postinstalls executed successfully, remove the rcS.d link
+if [ $remove_rcsd_link = 1 ]; then
         remove_rcsd_link
  fi
--

2.31.0.rc2.261.g7f71774620-goog

#4 lore raw
Quoted 20 lines · Steve Sakoman
Quoted 18 lines · Khem Raj
Quoted 14 lines · Steve Sakoman
Quoted 10 lines · Anton Kachalov via lists.openembedded.org

From: "Anton D. Kachalov" <[email protected]>

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.

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

Is this something that should be considered for backporting to dunfell/gatesgarth?

yes seems so

I think so.
I'm unsure which version does OpenBMC use:

https://github.com/openbmc/openbmc/tree/master/poky

They sync it from time to time from Poky upstream.

Quoted 53 lines

I thought so too, since I need it :-) But I didn't want to grab it just because I liked it!

Steve

Quoted 47 lines
Quoted 47 lines
Quoted 47 lines
---
  .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
  1 file changed, 4 insertions(+), 6 deletions(-)
meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts +4 -7
index f84a7e18c8..95dccb9cae 100755
@@ -72,12 +72,12 @@ exec_postinst_scriptlets() {
                 else
                         echo "ERROR: postinst $i failed."
                         [ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
-                       remove_pi_dir=0
+                       remove_rcsd_link=0
                 fi
         done
  }
 
-remove_pi_dir=1
+remove_rcsd_link=1
  if $pm_installed; then
         case $pm in
                 "ipk")
@@ -92,9 +92,7 @@ else
         exec_postinst_scriptlets
  fi
 
-# since all postinstalls executed successfully, remove the postinstalls directory
-# and the rcS.d link
-if [ $remove_pi_dir = 1 ]; then
-       rm -rf $pi_dir
+# since all postinstalls executed successfully, remove the rcS.d link
+if [ $remove_rcsd_link = 1 ]; then
         remove_rcsd_link
  fi
--

2.31.0.rc2.261.g7f71774620-goog