[yocto] Postinstallation script warnings in Yocto 2.4 Rocko

Alexander Kanavin alexander.kanavin at linux.intel.com
Mon Jan 8 03:29:54 PST 2018


On 01/08/2018 11:14 AM, Diaz de Grenu, Jose wrote:
> I am trying to create a recipe with a post installation script. I am using the following fragment of code (as documented in http://www.yoctoproject.org/docs/2.4/mega-manual/mega-manual.html#new-recipe-post-installation-scripts ):
> 
> 
> pkg_postinst_PACKAGENAME() {
>       if [ x"$D" = "x" ]; then
>            # Actions to carry out on the device go here
>       else
>            exit 1
>       fi
> }
> 
> This was working fine in Yocto 2.2, but now in Yocto 2.4 I am getting these warnings:
> 
> WARNING: core-image-base-1.0-r0 do_rootfs: [log_check] core-image-base: found 3 warning messages in the logfile:
> [log_check] warning: %post(init-ifupdown-1.0-r7.0.cortexa7hf_neon) scriptlet failed, exit status 1
> 
> How can I clean these warnings in Yocto 2.4? Is that still the correct
> way to create post installation script that must run on the target?
> Should I just replace 'exit 1' by 'exit 0'?

Nope, 'exit 1' is the currently correct way to defer to first boot. On 
the other hand, it's also a correct way to indicate that the script has 
failed, and rpm is right in reporting it as such. This is a design 
defect in Yocto, and I plan to fix it, so that instead you would simply 
write your fragment as follows:


pkg_postinst_ontarget_PACKAGENAME() {
       # Actions to carry out on the device go here
       ....
}


Alex



More information about the yocto mailing list