* [PATCH] avahi-systemd: drop postrm, use prerm instead
@ 2012-05-16 16:55 Andreas Oberritter
2012-05-16 17:17 ` Koen Kooi
0 siblings, 1 reply; 15+ messages in thread
From: Andreas Oberritter @ 2012-05-16 16:55 UTC (permalink / raw)
To: openembedded-core
* Calling "systemctl disable" from postrm is too late and
causes the following error:
| Failed to issue method call: No such file or directory
* Fix indentation of prerm for resulting shell snippet.
* Messing with $D is not needed in *rm scripts.
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
---
meta/recipes-connectivity/avahi/avahi.inc | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc
index 61ca25f..f84a81d 100644
--- a/meta/recipes-connectivity/avahi/avahi.inc
+++ b/meta/recipes-connectivity/avahi/avahi.inc
@@ -14,7 +14,7 @@ SECTION = "network"
# python scripts are under GPLv2+
LICENSE = "GPLv2+ & LGPLv2.1+"
-INC_PR = "r2"
+INC_PR = "r3"
DEPENDS = "expat libcap libdaemon dbus glib-2.0"
@@ -163,12 +163,7 @@ pkg_postinst_avahi-systemd() {
systemctl enable avahi-daemon.service
}
-pkg_postrm_avahi-systemd() {
- # can't do this offline
- if [ "x$D" != "x" ]; then
- exit 1
- fi
-
- systemctl disable avahi-daemon.service
+pkg_prerm_avahi-systemd() {
+systemctl disable avahi-daemon.service
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-16 16:55 [PATCH] avahi-systemd: drop postrm, use prerm instead Andreas Oberritter
@ 2012-05-16 17:17 ` Koen Kooi
2012-05-16 18:38 ` Andreas Oberritter
0 siblings, 1 reply; 15+ messages in thread
From: Koen Kooi @ 2012-05-16 17:17 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Op 16 mei 2012, om 18:55 heeft Andreas Oberritter het volgende geschreven:
> * Calling "systemctl disable" from postrm is too late and
> causes the following error:
>
> | Failed to issue method call: No such file or directory
>
> * Fix indentation of prerm for resulting shell snippet.
> * Messing with $D is not needed in *rm scripts.
It very much is, you can offline remove scripts just like you can install them.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-16 17:17 ` Koen Kooi
@ 2012-05-16 18:38 ` Andreas Oberritter
2012-05-16 18:50 ` Koen Kooi
2012-05-18 15:06 ` Enrico Scholz
0 siblings, 2 replies; 15+ messages in thread
From: Andreas Oberritter @ 2012-05-16 18:38 UTC (permalink / raw)
To: openembedded-core
On 16.05.2012 19:17, Koen Kooi wrote:
>
> Op 16 mei 2012, om 18:55 heeft Andreas Oberritter het volgende geschreven:
>
>> * Calling "systemctl disable" from postrm is too late and
>> causes the following error:
>>
>> | Failed to issue method call: No such file or directory
>>
>> * Fix indentation of prerm for resulting shell snippet.
>> * Messing with $D is not needed in *rm scripts.
>
> It very much is, you can offline remove scripts just like you can install them.
What's the use case for removing packages offline and where in OE is
this used? Is the majority of prerm- and postrm-scripts prepared for that?
Regards,
Andreas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-16 18:38 ` Andreas Oberritter
@ 2012-05-16 18:50 ` Koen Kooi
2012-05-16 19:03 ` Andreas Oberritter
2012-05-18 15:06 ` Enrico Scholz
1 sibling, 1 reply; 15+ messages in thread
From: Koen Kooi @ 2012-05-16 18:50 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Op 16 mei 2012, om 20:38 heeft Andreas Oberritter het volgende geschreven:
> On 16.05.2012 19:17, Koen Kooi wrote:
>>
>> Op 16 mei 2012, om 18:55 heeft Andreas Oberritter het volgende geschreven:
>>
>>> * Calling "systemctl disable" from postrm is too late and
>>> causes the following error:
>>>
>>> | Failed to issue method call: No such file or directory
>>>
>>> * Fix indentation of prerm for resulting shell snippet.
>>> * Messing with $D is not needed in *rm scripts.
>>
>> It very much is, you can offline remove scripts just like you can install them.
>
> What's the use case for removing packages offline
e.g. BAD_RECOMMENDATIONS
> and where in OE is
> this used? Is the majority of prerm- and postrm-scripts prepared for that?
Dunno if the majority is, but you're now actively making it worse.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-16 18:50 ` Koen Kooi
@ 2012-05-16 19:03 ` Andreas Oberritter
0 siblings, 0 replies; 15+ messages in thread
From: Andreas Oberritter @ 2012-05-16 19:03 UTC (permalink / raw)
To: openembedded-core
On 16.05.2012 20:50, Koen Kooi wrote:
>
> Op 16 mei 2012, om 20:38 heeft Andreas Oberritter het volgende geschreven:
>
>> On 16.05.2012 19:17, Koen Kooi wrote:
>>>
>>> Op 16 mei 2012, om 18:55 heeft Andreas Oberritter het volgende geschreven:
>>>
>>>> * Calling "systemctl disable" from postrm is too late and
>>>> causes the following error:
>>>>
>>>> | Failed to issue method call: No such file or directory
>>>>
>>>> * Fix indentation of prerm for resulting shell snippet.
>>>> * Messing with $D is not needed in *rm scripts.
>>>
>>> It very much is, you can offline remove scripts just like you can install them.
>>
>> What's the use case for removing packages offline
>
> e.g. BAD_RECOMMENDATIONS
Packages in BAD_RECOMMENDATIONS don't get installed. So there's no need
for them to get removed. Do you know any real use case?
>> and where in OE is
>> this used? Is the majority of prerm- and postrm-scripts prepared for that?
>
> Dunno if the majority is, but you're now actively making it worse.
I doubt it unless proven wrong.
Actually there's only one line matching opkg-cl.*remove, which is a very
special case:
openembedded-core/meta/classes/rootfs_ipk.bbclass:
opkg-cl ${IPKG_ARGS} --force-depends remove update-rc.d base-passwd || true
Regards,
Andreas
P.S.: No line matches opkg-cl.*upgrade
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-16 18:38 ` Andreas Oberritter
2012-05-16 18:50 ` Koen Kooi
@ 2012-05-18 15:06 ` Enrico Scholz
2012-05-21 8:46 ` Andreas Oberritter
1 sibling, 1 reply; 15+ messages in thread
From: Enrico Scholz @ 2012-05-18 15:06 UTC (permalink / raw)
To: openembedded-core; +Cc: Andreas Oberritter
Andreas Oberritter <obi-Le4rqY8tBtjh/77Yhslz0w@public.gmane.org> writes:
> What's the use case for removing packages offline
I am developing very much with NFS root filesystems (--> the temporary
image directory which is kept by IMAGE_KEEPROOTFS=1). Packaging operations
like install, remove or upgrade are common actions to test recipes and
applications.
Enrico
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-18 15:06 ` Enrico Scholz
@ 2012-05-21 8:46 ` Andreas Oberritter
2012-05-21 9:18 ` Enrico Scholz
0 siblings, 1 reply; 15+ messages in thread
From: Andreas Oberritter @ 2012-05-21 8:46 UTC (permalink / raw)
To: Enrico Scholz; +Cc: openembedded-core
On 18.05.2012 17:06, Enrico Scholz wrote:
>
>
> Andreas Oberritter <obi-Le4rqY8tBtjh/77Yhslz0w@public.gmane.org> writes:
>
>> What's the use case for removing packages offline
>
> I am developing very much with NFS root filesystems (--> the temporary
> image directory which is kept by IMAGE_KEEPROOTFS=1). Packaging operations
> like install, remove or upgrade are common actions to test recipes and
> applications.
Just to make sure we're talking about the same thing: Do you run opkg-cl
on the build machine to remove or upgrade packages inside the target's
NFS root?
Regards,
Andreas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 8:46 ` Andreas Oberritter
@ 2012-05-21 9:18 ` Enrico Scholz
2012-05-21 10:08 ` Andreas Oberritter
0 siblings, 1 reply; 15+ messages in thread
From: Enrico Scholz @ 2012-05-21 9:18 UTC (permalink / raw)
To: Andreas Oberritter; +Cc: openembedded-core
Andreas Oberritter <obi@opendreambox.org> writes:
>>> What's the use case for removing packages offline
>>
>> I am developing very much with NFS root filesystems (--> the temporary
>> image directory which is kept by IMAGE_KEEPROOTFS=1). Packaging operations
>> like install, remove or upgrade are common actions to test recipes and
>> applications.
>
> Just to make sure we're talking about the same thing: Do you run
> opkg-cl on the build machine to remove or upgrade packages inside the
> target's NFS root?
yes; I am working on the build machine. The NFS filesystem is mounted
read-only on the target.
Enrico
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 9:18 ` Enrico Scholz
@ 2012-05-21 10:08 ` Andreas Oberritter
2012-05-21 11:04 ` Enrico Scholz
0 siblings, 1 reply; 15+ messages in thread
From: Andreas Oberritter @ 2012-05-21 10:08 UTC (permalink / raw)
To: Enrico Scholz; +Cc: openembedded-core
On 21.05.2012 11:18, Enrico Scholz wrote:
> Andreas Oberritter <obi@opendreambox.org> writes:
>
>>>> What's the use case for removing packages offline
>>>
>>> I am developing very much with NFS root filesystems (--> the temporary
>>> image directory which is kept by IMAGE_KEEPROOTFS=1). Packaging operations
>>> like install, remove or upgrade are common actions to test recipes and
>>> applications.
>>
>> Just to make sure we're talking about the same thing: Do you run
>> opkg-cl on the build machine to remove or upgrade packages inside the
>> target's NFS root?
>
> yes; I am working on the build machine. The NFS filesystem is mounted
> read-only on the target.
How do you handle prerm and postrm scripts that fail because $D is set?
How do you handle the majority of scripts that don't care about $D at
all? I think your use case is unsupported and always will be.
In contrast, packages having failing postinst scripts will re-run their
scripts on the target on first boot.
Regards,
Andreas
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 10:08 ` Andreas Oberritter
@ 2012-05-21 11:04 ` Enrico Scholz
2012-05-21 11:49 ` Andreas Oberritter
0 siblings, 1 reply; 15+ messages in thread
From: Enrico Scholz @ 2012-05-21 11:04 UTC (permalink / raw)
To: Andreas Oberritter; +Cc: openembedded-core
Andreas Oberritter <obi@opendreambox.org> writes:
>>>>> What's the use case for removing packages offline
>>
>> yes; I am working on the build machine. The NFS filesystem is mounted
>> read-only on the target.
>
> How do you handle prerm and postrm scripts that fail because $D is
> set?
Fortunately, there are very few packages where this failure is
critical (--> package is not working). Important tasks like user
creation, alternatives handling or systemctl calls take care about
offline package management already.
kernel modules are the only package class which might affect me and is
not suited for offline installation/upgrades. But I can live with it
because I develop the kernel at a separate location and call 'make
modules_install INSTALL_MOD_PATH=<nfsroot>' there.
> How do you handle the majority of scripts that don't care about $D at
> all?
Examples? pseudo does a good job for 'systemctl enable/disable' or
update-alternatives operations, 'systemd.bbclass' wraps the 'systemctl
stop/start'.
Btw... your patch is correct about removal of $D. As written above, it
is not needed for 'systemctl disable'. But I am against removal of
offline capabilities because they are not needed in 80% of use cases.
Enrico
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 11:04 ` Enrico Scholz
@ 2012-05-21 11:49 ` Andreas Oberritter
2012-05-21 12:06 ` Koen Kooi
0 siblings, 1 reply; 15+ messages in thread
From: Andreas Oberritter @ 2012-05-21 11:49 UTC (permalink / raw)
To: Enrico Scholz; +Cc: openembedded-core
On 21.05.2012 13:04, Enrico Scholz wrote:
> Andreas Oberritter <obi@opendreambox.org> writes:
>
>>>>>> What's the use case for removing packages offline
>>>
>>> yes; I am working on the build machine. The NFS filesystem is mounted
>>> read-only on the target.
>>
>> How do you handle prerm and postrm scripts that fail because $D is
>> set?
>
> Fortunately, there are very few packages where this failure is
> critical (--> package is not working). Important tasks like user
> creation, alternatives handling or systemctl calls take care about
> offline package management already.
>
> kernel modules are the only package class which might affect me and is
> not suited for offline installation/upgrades. But I can live with it
> because I develop the kernel at a separate location and call 'make
> modules_install INSTALL_MOD_PATH=<nfsroot>' there.
>
>
>> How do you handle the majority of scripts that don't care about $D at
>> all?
>
> Examples?
Every recipe inheriting gconf.bbclass, gtk-icon-cache.bbclass,
kernel.bbclass, module.bbclass or libc-package.bbclass, for example. You
can use git grep '$D' to find more candidates.
> pseudo does a good job for 'systemctl enable/disable' or
> update-alternatives operations, 'systemd.bbclass' wraps the 'systemctl
> stop/start'.
>
> Btw... your patch is correct about removal of $D. As written above, it
> is not needed for 'systemctl disable'. But I am against removal of
> offline capabilities because they are not needed in 80% of use cases.
Considering that in the meantime my similar patch [1] to systemd.bbclass
got merged into meta-oe by Koen, who initially was against it, I guess
this patch can finally get merged now, too.
Regards,
Andreas
[1]
http://git.openembedded.org/meta-openembedded/commit/?id=637cb7e3d2cfdc74d239a4257e6f3477aa17da4e
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 11:49 ` Andreas Oberritter
@ 2012-05-21 12:06 ` Koen Kooi
2012-05-21 12:13 ` Enrico Scholz
0 siblings, 1 reply; 15+ messages in thread
From: Koen Kooi @ 2012-05-21 12:06 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer; +Cc: Enrico Scholz
Op 21 mei 2012, om 13:49 heeft Andreas Oberritter het volgende geschreven:
> On 21.05.2012 13:04, Enrico Scholz wrote:
>> Andreas Oberritter <obi@opendreambox.org> writes:
>>
>>>>>>> What's the use case for removing packages offline
>>>>
>>>> yes; I am working on the build machine. The NFS filesystem is mounted
>>>> read-only on the target.
>>>
>>> How do you handle prerm and postrm scripts that fail because $D is
>>> set?
>>
>> Fortunately, there are very few packages where this failure is
>> critical (--> package is not working). Important tasks like user
>> creation, alternatives handling or systemctl calls take care about
>> offline package management already.
>>
>> kernel modules are the only package class which might affect me and is
>> not suited for offline installation/upgrades. But I can live with it
>> because I develop the kernel at a separate location and call 'make
>> modules_install INSTALL_MOD_PATH=<nfsroot>' there.
>>
>>
>>> How do you handle the majority of scripts that don't care about $D at
>>> all?
>>
>> Examples?
>
> Every recipe inheriting gconf.bbclass, gtk-icon-cache.bbclass,
> kernel.bbclass, module.bbclass or libc-package.bbclass, for example. You
> can use git grep '$D' to find more candidates.
>
>> pseudo does a good job for 'systemctl enable/disable' or
>> update-alternatives operations, 'systemd.bbclass' wraps the 'systemctl
>> stop/start'.
>>
>> Btw... your patch is correct about removal of $D. As written above, it
>> is not needed for 'systemctl disable'. But I am against removal of
>> offline capabilities because they are not needed in 80% of use cases.
>
> Considering that in the meantime my similar patch [1] to systemd.bbclass
> got merged into meta-oe by Koen, who initially was against it, I guess
> this patch can finally get merged now, too.
Crap, I missed the $D part, that's going to get reverted
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 12:06 ` Koen Kooi
@ 2012-05-21 12:13 ` Enrico Scholz
2012-05-21 12:20 ` Koen Kooi
0 siblings, 1 reply; 15+ messages in thread
From: Enrico Scholz @ 2012-05-21 12:13 UTC (permalink / raw)
To: Koen Kooi; +Cc: Patches and discussions about the oe-core layer
Koen Kooi <koen@dominion.thruhere.net> writes:
>> Considering that in the meantime my similar patch [1] to systemd.bbclass
>> got merged into meta-oe by Koen, who initially was against it, I guess
>> this patch can finally get merged now, too.
>
> Crap, I missed the $D part, that's going to get reverted
I think we can keep it when we enhance the systemctl script
(systemd-systemctl-native) to ignore 'stop/start'. This will simplify
the install scripts because the
| if [ -z "$D" ]; then
| systemctl stop ...
| fi
block can be replaced by a simple 'systemctl stop ...'
Enrico
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 12:13 ` Enrico Scholz
@ 2012-05-21 12:20 ` Koen Kooi
2012-05-21 12:33 ` Enrico Scholz
0 siblings, 1 reply; 15+ messages in thread
From: Koen Kooi @ 2012-05-21 12:20 UTC (permalink / raw)
To: Enrico Scholz; +Cc: Patches and discussions about the oe-core layer
Op 21 mei 2012, om 14:13 heeft Enrico Scholz het volgende geschreven:
> Koen Kooi <koen@dominion.thruhere.net> writes:
>
>>> Considering that in the meantime my similar patch [1] to systemd.bbclass
>>> got merged into meta-oe by Koen, who initially was against it, I guess
>>> this patch can finally get merged now, too.
>>
>> Crap, I missed the $D part, that's going to get reverted
>
> I think we can keep it when we enhance the systemctl script
> (systemd-systemctl-native) to ignore 'stop/start'.
That won't work where you don't the have OE tree at hand. Worst case: it will call the native systemctl and break the host distro.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] avahi-systemd: drop postrm, use prerm instead
2012-05-21 12:20 ` Koen Kooi
@ 2012-05-21 12:33 ` Enrico Scholz
0 siblings, 0 replies; 15+ messages in thread
From: Enrico Scholz @ 2012-05-21 12:33 UTC (permalink / raw)
To: Koen Kooi; +Cc: Patches and discussions about the oe-core layer
Koen Kooi <koen@dominion.thruhere.net> writes:
>>>> Considering that in the meantime my similar patch [1] to systemd.bbclass
>>>> got merged into meta-oe by Koen, who initially was against it, I guess
>>>> this patch can finally get merged now, too.
>>>
>>> Crap, I missed the $D part, that's going to get reverted
>>
>> I think we can keep it when we enhance the systemctl script
>> (systemd-systemctl-native) to ignore 'stop/start'.
>
> That won't work where you don't the have OE tree at hand.
Is this case really supported? Lot of scripts depend on encapsulation
by 'pseudo' and/or special wrapper programs. E.g. 'update-alternatives'
must be the tool of the OE tree; the host utility will be used which
does not understand $OPKG_OFFLINE_ROOT.
Else, systemd-systemctl-native is sysrooted by every package inheriting
'systemd.bbclass' and available in every OE tree.
> Worst case: it will call the native systemctl and break the host
> distro.
This would also be the case for the already unwrapped
| systemctl enable ....service
But again... this is not a problem because a custom systemctl script is
installed.
Enrico
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2012-05-21 12:44 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-16 16:55 [PATCH] avahi-systemd: drop postrm, use prerm instead Andreas Oberritter
2012-05-16 17:17 ` Koen Kooi
2012-05-16 18:38 ` Andreas Oberritter
2012-05-16 18:50 ` Koen Kooi
2012-05-16 19:03 ` Andreas Oberritter
2012-05-18 15:06 ` Enrico Scholz
2012-05-21 8:46 ` Andreas Oberritter
2012-05-21 9:18 ` Enrico Scholz
2012-05-21 10:08 ` Andreas Oberritter
2012-05-21 11:04 ` Enrico Scholz
2012-05-21 11:49 ` Andreas Oberritter
2012-05-21 12:06 ` Koen Kooi
2012-05-21 12:13 ` Enrico Scholz
2012-05-21 12:20 ` Koen Kooi
2012-05-21 12:33 ` Enrico Scholz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox