Bug 9658

Summary: Detect postinst failing verses asking to be delayed?
Product: [Yocto Project Subprojects] opkg Reporter: Ross Burton <ross.burton>
Component: opkgAssignee: Alejandro del Castillo <alejandro.delcastillo>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Undecided    
Version: 0.3.1   
Target Milestone: ---   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Ross Burton 2016-05-20 15:19:53 UTC
It would be useful if there were a way to distinguish between a postinst failing because of errors or a postinst deciding to delay its execution until first boot in the install log.  At the moment all non-successful postinst are assumed to be delayed on purpose.

I suggest exit 75 for "I wish to be executed on the host please" (#define EX_TEMPFAIL 75 is a semi-standard in sysexits.h) and anything else being reported differently.  The goal being that OE's rootfs task can warn when postinsts are delayed without using exit 75 and we can notice if eg a postinst that should run on the build host is failing.
Comment 1 Alejandro del Castillo 2016-12-09 19:35:57 UTC
Shouldn't that be a convention on how postinst are authored and not part of opkg?

 pkg_postinst_PACKAGENAME() {
     if [ x"$D" = "x" ]; then
          # Actions to carry out on the device go here
     else
          exit 75
     fi
     }
Comment 2 Ross Burton 2018-02-03 21:03:09 UTC
Alex's patches make this moot, closing.