Re: [OE-core] [PATCH] rootfs.py: mask run-postinsts systemd service when unneeded

2021-03-22 Thread Alexander Kanavin
Right, I guess I was missing the context where the patch is applied: "if
delayed_postinst is None" inside uninstall_unneeded(). Perhaps you could
expand the commit message a bit, and say specifically what is the scenario
when this is executed ("not needed" is somewhat vague).

Then no separate test is necessary.

Alex

On Mon, 22 Mar 2021 at 14:41, Awais Belal  wrote:

> Hi Alex,
>
> Why isn’t this seen in the tests? Can you add a test that shows the issue
> please? (Fails without the patch, passes with)
>
> I'm not very well versed with the oe test infrastructure, I'd be happy to
> create a test for this scenario if you can point me to the material that I
> need to go through in order to be able to create a test for this. However,
> if you want me to summarize this tends to fix the issue where the systemd
> run-postinsts.service is run at the target even when not needed (no pending
> postinsts are found during build).
>
> I do need to send a v2 for this as there's a slight issue in the patch.
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149780): 
https://lists.openembedded.org/g/openembedded-core/message/149780
Mute This Topic: https://lists.openembedded.org/mt/81518683/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] rootfs.py: mask run-postinsts systemd service when unneeded

2021-03-22 Thread Awais Belal
Hi Alex,

> 
> Why isn’t this seen in the tests? Can you add a test that shows the issue
> please? (Fails without the patch, passes with)

I'm not very well versed with the oe test infrastructure, I'd be happy to 
create a test for this scenario if you can point me to the material that I need 
to go through in order to be able to create a test for this. However, if you 
want me to summarize this tends to fix the issue where the systemd 
run-postinsts.service is run at the target even when not needed (no pending 
postinsts are found during build).

I do need to send a v2 for this as there's a slight issue in the patch.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149776): 
https://lists.openembedded.org/g/openembedded-core/message/149776
Mute This Topic: https://lists.openembedded.org/mt/81518683/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] rootfs.py: mask run-postinsts systemd service when unneeded

2021-03-22 Thread Alexander Kanavin
Why isn’t this seen in the tests? Can you add a test that shows the issue
please? (Fails without the patch, passes with)

Alex

On Mon 22. Mar 2021 at 10.07, Awais Belal  wrote:

> The service is unnecessarily run even when it is unneeded.
> This was handled correctly for sysV systems however the
> service still runs on the systemd systems as it is not
> disabled/masked when not needed.
>
> Signed-off-by: Awais Belal 
> ---
>  meta/lib/oe/rootfs.py | 4 
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
> index 249c685dcf..a29d1f6742 100644
> --- a/meta/lib/oe/rootfs.py
> +++ b/meta/lib/oe/rootfs.py
> @@ -257,6 +257,10 @@ class Rootfs(object, metaclass=ABCMeta):
>  self._exec_shell_cmd(["update-rc.d", "-f", "-r",
>self.d.getVar('IMAGE_ROOTFS'),
>"run-postinsts", "remove"])
> +if
> os.path.exists(self.d.expand("${IMAGE_ROOTFS}${systemd_unitdir}/system/run-postinsts.service")):
> +self._exec_shell_cmd(["systemctl",
> +"--root",
> self.d.getVar('IMAGE_ROOTFS'),
> +"mask", "run-postinsts"])
>
>  image_rorfs = bb.utils.contains("IMAGE_FEATURES",
> "read-only-rootfs",
>  True, False, self.d)
> --
> 2.17.1
>
>
> 
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149769): 
https://lists.openembedded.org/g/openembedded-core/message/149769
Mute This Topic: https://lists.openembedded.org/mt/81518683/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] rootfs.py: mask run-postinsts systemd service when unneeded

2021-03-22 Thread Awais Belal
The service is unnecessarily run even when it is unneeded.
This was handled correctly for sysV systems however the
service still runs on the systemd systems as it is not
disabled/masked when not needed.

Signed-off-by: Awais Belal 
---
 meta/lib/oe/rootfs.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 249c685dcf..a29d1f6742 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -257,6 +257,10 @@ class Rootfs(object, metaclass=ABCMeta):
 self._exec_shell_cmd(["update-rc.d", "-f", "-r",
   self.d.getVar('IMAGE_ROOTFS'),
   "run-postinsts", "remove"])
+if 
os.path.exists(self.d.expand("${IMAGE_ROOTFS}${systemd_unitdir}/system/run-postinsts.service")):
+self._exec_shell_cmd(["systemctl",
+"--root", 
self.d.getVar('IMAGE_ROOTFS'),
+"mask", "run-postinsts"])
 
 image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
 True, False, self.d)
-- 
2.17.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#149764): 
https://lists.openembedded.org/g/openembedded-core/message/149764
Mute This Topic: https://lists.openembedded.org/mt/81518683/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-