Re: Removing postinst script in bbappend

Jim Krantz

The recipe is apparmor, layer is meta-security. 

We're currently using the 2.x recipe, however the 3.x recipe appears to have the same function.

On Wed, Nov 4, 2020 at 2:32 PM Alexander Kanavin <alex.kanavin@...> wrote:
What recipe is it and what layer is it in?


On Wed 4. Nov 2020 at 19.04, Jim Krantz <krantzj84@...> wrote:
Hey folks,

We're doing builds using Yocto 3.1 and are attempting to revise a recipe from another layer we don't control. The recipe we want to make alterations to is from an open source project, so we'd prefer to not make changes directly to the recipe, rather change it using a bbappend. 

The issue we're having is that the recipe has a pkg_postinst_ontarget function defined, but we have our filesystem set to read only via 'read-only-rootfs'. The result is a build time failure:

'The following packages could not be configured offline and rootfs is read-only: ['<package>']

Looking at the Yocto code, it appears that this error is detected by checking for the presence of any files in the image rootfs/rpm-postinsts directory. If something is found and the rootfs is read only, then the error above is thrown and the build fails. 

We also looked at emit_pkgdata() and noted it was checking for the pkg_postinst/pkg_postinst_ontarget globals, so we attempted to add a task that set those to 'None', hoping it would result in the conditional checks for these resolving to 'false', however this did not seem to work either. I'm somewhat new to Yocto, so may have misunderstood how this code is applied.

We've also tried simpler solutions, like implementing a blank pkg_postinst_ontarget_{PN} and using deltask, however this also failed. 

So the question I have is: is there a way for us to remove the pkg_postinst_ontarget_{PN} from the recipe in the original layer using a bbappend file in our layer, so that the read only error is not thrown?


Join to automatically receive all group messages.