| Summary: | opkg upgrade fails when scripts return minor errors | ||
|---|---|---|---|
| Product: | [Yocto Project Subprojects] opkg | Reporter: | betacentauri |
| Component: | opkg | Assignee: | Alejandro del Castillo <alejandro.delcastillo> |
| Status: | RESOLVED NOTABUG | QA Contact: | |
| Severity: | normal | ||
| Priority: | Undecided | ||
| Version: | 0.3.3 | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Don't know | |
|
Description
betacentauri
2016-10-13 16:36:25 UTC
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). |