All of lore.kernel.org
 help / color / mirror / Atom feed
* [poky][PATCH] run-postinsts: do not remove postinsts directory.
@ 2021-03-21 10:26 Anton Kachalov
  2021-03-24 15:09 ` [OE-core] " Steve Sakoman
  0 siblings, 1 reply; 5+ messages in thread
From: Anton Kachalov @ 2021-03-21 10:26 UTC (permalink / raw)
  To: openembedded-core; +Cc: Anton D. Kachalov

From: "Anton D. Kachalov" <gmouse@google.com>

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.

Signed-off-by: Anton D. Kachalov <gmouse@google.com>
---
 .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
 1 file 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() {
 		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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [poky][PATCH] run-postinsts: do not remove postinsts directory.
  2021-03-21 10:26 [poky][PATCH] run-postinsts: do not remove postinsts directory Anton Kachalov
@ 2021-03-24 15:09 ` Steve Sakoman
  2021-03-24 18:28   ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Sakoman @ 2021-03-24 15:09 UTC (permalink / raw)
  To: gmouse; +Cc: Patches and discussions about the oe-core layer

On Sun, Mar 21, 2021 at 12:26 AM Anton Kachalov via
lists.openembedded.org <gmouse=google.com@lists.openembedded.org>
wrote:
>
> From: "Anton D. Kachalov" <gmouse@google.com>
>
> 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


> Signed-off-by: Anton D. Kachalov <gmouse@google.com>
> ---
>  .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
>  1 file 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() {
>                 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
>
>
> 
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [poky][PATCH] run-postinsts: do not remove postinsts directory.
  2021-03-24 15:09 ` [OE-core] " Steve Sakoman
@ 2021-03-24 18:28   ` Khem Raj
  2021-03-24 19:12     ` Steve Sakoman
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2021-03-24 18:28 UTC (permalink / raw)
  To: Steve Sakoman, gmouse; +Cc: Patches and discussions about the oe-core layer



On 3/24/21 8:09 AM, Steve Sakoman wrote:
> On Sun, Mar 21, 2021 at 12:26 AM Anton Kachalov via
> lists.openembedded.org <gmouse=google.com@lists.openembedded.org>
> wrote:
>>
>> From: "Anton D. Kachalov" <gmouse@google.com>
>>
>> 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?
> 

yes seems so

> Steve
> 
> 
>> Signed-off-by: Anton D. Kachalov <gmouse@google.com>
>> ---
>>   .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
>>   1 file 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() {
>>                  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
>>
>>
>>
>>
>>
>>
>> 
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [poky][PATCH] run-postinsts: do not remove postinsts directory.
  2021-03-24 18:28   ` Khem Raj
@ 2021-03-24 19:12     ` Steve Sakoman
  2021-04-05 15:59       ` Anton Kachalov
  0 siblings, 1 reply; 5+ messages in thread
From: Steve Sakoman @ 2021-03-24 19:12 UTC (permalink / raw)
  To: Khem Raj; +Cc: gmouse, Patches and discussions about the oe-core layer

On Wed, Mar 24, 2021 at 8:28 AM Khem Raj <raj.khem@gmail.com> wrote:
>
>
>
> On 3/24/21 8:09 AM, Steve Sakoman wrote:
> > On Sun, Mar 21, 2021 at 12:26 AM Anton Kachalov via
> > lists.openembedded.org <gmouse=google.com@lists.openembedded.org>
> > wrote:
> >>
> >> From: "Anton D. Kachalov" <gmouse@google.com>
> >>
> >> 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?
> >
>
> 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

> >
> >> Signed-off-by: Anton D. Kachalov <gmouse@google.com>
> >> ---
> >>   .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
> >>   1 file 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() {
> >>                  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
> >>
> >>
> >>
> >>
> >>
> >>
> >> 
> >>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [poky][PATCH] run-postinsts: do not remove postinsts directory.
  2021-03-24 19:12     ` Steve Sakoman
@ 2021-04-05 15:59       ` Anton Kachalov
  0 siblings, 0 replies; 5+ messages in thread
From: Anton Kachalov @ 2021-04-05 15:59 UTC (permalink / raw)
  To: Steve Sakoman; +Cc: Khem Raj, Patches and discussions about the oe-core layer

On Wed, 24 Mar 2021 at 20:12, Steve Sakoman <steve@sakoman.com> wrote:
>
> On Wed, Mar 24, 2021 at 8:28 AM Khem Raj <raj.khem@gmail.com> wrote:
> >
> >
> >
> > On 3/24/21 8:09 AM, Steve Sakoman wrote:
> > > On Sun, Mar 21, 2021 at 12:26 AM Anton Kachalov via
> > > lists.openembedded.org <gmouse=google.com@lists.openembedded.org>
> > > wrote:
> > >>
> > >> From: "Anton D. Kachalov" <gmouse@google.com>
> > >>
> > >> 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?
> > >
> >
> > 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.

>
> I thought so too, since I need it :-)  But I didn't want to grab it
> just because I liked it!
>
> Steve
>
> > >
> > >> Signed-off-by: Anton D. Kachalov <gmouse@google.com>
> > >> ---
> > >>   .../run-postinsts/run-postinsts/run-postinsts          | 10 ++++------
> > >>   1 file 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() {
> > >>                  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
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> 
> > >>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-05 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-21 10:26 [poky][PATCH] run-postinsts: do not remove postinsts directory Anton Kachalov
2021-03-24 15:09 ` [OE-core] " Steve Sakoman
2021-03-24 18:28   ` Khem Raj
2021-03-24 19:12     ` Steve Sakoman
2021-04-05 15:59       ` Anton Kachalov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.