We have problems with this commit: http://git.yoctoproject.org/cgit/cgit.cgi/opkg/commit/libopkg/opkg_install.c?id=a8555d352d2851ee1482b74b57ba9eacfb354c18 opkg now calls prerm and postrm scripts in case of an upgrade. If any error occurs in the scripts the upgrade fails. E.g. if a daemon is stopped the upgrade fails as a try to stop a stopped daemon returns an error code. This specific problem was fixed here: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10299 But there might be other minor problems in the scripts which now prevents a package upgrade. E.g. the user has accidentally deleted a file which is called in one of the scripts. I guess it's quite difficult to make all scripts robust against all possible errors. See also this comment: https://bugzilla.yoctoproject.org/show_bug.cgi?id=10299#c8 The execution of prerm and postrm also causes the problem with avahi-daemon upgrade described here (the fixes from Markus Lehtonen only fixes a part of the problem): https://bugzilla.yoctoproject.org/show_bug.cgi?id=10299#c4
Opkg calls pre/post inst/rm scripts at the same point in time as dpkg does [1]. However, OE disabled the call of prerm && postrm scripts for the debian backend [2]. The scripts calls were disabled to address Yocto #6768, which sounded too much of a nuclear option to me. If there are good reasons to disable opkg prerm/postrm scripts during upgrade for OE, then maybe we can discuss that on an OE bug report. For opkg itself, it shouldn't avoid calling prerm/postrm as that's the right model for upgrades (same as debian) [1] https://wiki.debian.org/MaintainerScripts. [2] Commit 7b9161dd0c475cca6ea7eb507f7c3c51869eb493
So we have this situation: 1. opkg fails in case of an script error, because failover states are missing 2. dpkg in OE don't execute the scripts so it cannot fail You say opkg uses right model for upgrade, but it doesn't implement the failover states as OE don't use these states currently (as you told me in https://bugzilla.yoctoproject.org/show_bug.cgi?id=10446). I think there should be a workaround/fix in opkg as long as there are no failover states in the OE. Can't you just execute the scripts and ignore the return values? (Don't expect perfect scripts as you have to make the scripts robust against all possible errors) You think I should create another bug against OE to discuss the situation? (Sorry, I reopen the bug so that you can see it. Don't know whether you read all comments. So you can resolve it again if you like)
Dpkg on OE doesn't use failover states. Basically, it goes with the approach of not running prerm/postrm on upgrades at all. I am not sure why this approach was applied to dpkg and not to opkg since dpkg without failover states switch case on the scrip behaves the same as opkg. What I think should be up to discussion on the OE mailing list or on a bug report is 1) if not running prerm/postrm on upgrade is the right approach to make the scripts robust and 2) if that approach should be applied to opkg (which would be an OE change, not an opkg change). Regarding opkg itself, I think it's reasonable to consider that it should use failover states. However, doesn't seem like this would help your case on the short term since OE would have to change all it's scripts to start using them (a switch statement on each prerm/postrm with a case for failed-upgrade and abort-upgrade). (I am closing the bug report again, but if you have further comments that you think make sense to discuss here, please re-open).