Bug 11096

Summary: improve pkg_postinst handling: script errors should be properly reported
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Alexander Kanavin <alex.kanavin>
Component: deploymentAssignee: Unassigned <unassigned>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium+ CC: jose.perez.carranza
Version: unspecified   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
See Also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9261
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)
Bug Depends on: 9675    
Bug Blocks:    

Description Alexander Kanavin 2017-02-22 19:27:50 UTC
Currently if anything goes wrong in pkg_postinst() script, the problem is swept under a carpet in two ways:
1) scripts are not run using sh -e, so only the if the last command in a script fails, the script fails.
2) even if the script does fail, it's taken as a request to defer the script execution to first boot of the image, which may mask a problem or a regression somewhere. Deferral to first boot needs to be requested explicitly by calling a 'hook' command from the script.

I've done some work to address this here, needs to be completed:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=akanavin/dnf-rpm4-postinst-fix

Discussion:
http://lists.openembedded.org/pipermail/openembedded-architecture/2017-February/000422.html
Comment 1 Richard Purdie 2017-11-08 16:23:09 UTC
Related to https://bugzilla.yoctoproject.org/show_bug.cgi?id=9261
Comment 2 Alexander Kanavin 2018-01-31 10:16:52 UTC
Patchset merged to master:
http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146895.html