run-postinsts isn't used in the case where opkg is the package manager and the package manager is to be installed on the host. Given that this is introducing a different codepath when dpkg/rpm/opkg-without-package-manager all use run-postinsts, we should evaluate removing the first-boot-postinstall code from opkg.
Patches merged: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=5159ddcb62682e1b7e63a20a9218ea96e3fe10a2 http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=cd1195b6fede2005506600bd431a66d4c454d4b9
It seems that package-management is not present in IMAGE_FEATURES when building postinstalls. Also this is related to https://bugzilla.yoctoproject.org/show_bug.cgi?id=5972
I was testing IMAGE_FEATURES in run-postinsts recipe which is not quite right... All my tests were done with core-image-minimal which was hiding the problem because I was adding package-management to IMAGE_FEATURES in local.conf and was available to run-postinsts during compilation. I have a fix already in tests.
Fixed the old solution and created a more generic run-postinsts script: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=cbefaa3e3160aed390722b301e909f72b22dbbb8
Verified on master branch. Commit ID:bb66113bde5361b869dce2bdaece5b938f077ea8