[poky] Postinstallation script for target throw warnings

Robert Yang liezhi.yang at windriver.com
Wed Jan 10 21:33:03 PST 2018



On 01/05/2018 07:21 PM, Diaz de Grenu, Jose wrote:
> Hi,
> 
> 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'?

Yes, just remove the "else" block and use something like:

if [ -z "$D" ]; then
	# Actions
fi

But it would be better if you can make it work during do_rootfs rather
than firstboot.

// Robert

> 
> Thanks
> 


More information about the poky mailing list