I have now set up a multilib build environment to see exactly how that works. If I haven't forgotten anything, it was easier than I thought. I added the following to local.conf:
                                                                                                                      
require conf/multilib.conf
MULTILIBS = “multilib:lib32”
DEFAULTTUNE:virtclass-multilib-lib32 = “x86”
IMAGE_INSTALL:append = “ lib32-glibc lib32-libgcc lib32-libstdc++ snapper lib32-snapper”

Then set FILES:${PN} like this:
FILES:${PN} += “${nonarch_libdir} ${systemd_system_unitdir} ${datadir}”

And I was able to build core-image-minimal with both snapper and lib32-snapper installed without facing any conflicts in do_rootfs



On Fri, Nov 1 2024 at 07:59:35 AM +01:00:00, Markus Volk <f_l_k@t-online.de> wrote:
On Thu, Oct 31 2024 at 11:45:59 PM +01:00:00, Martin Jansa <martin.jansa@gmail.com> wrote:
Not sure if this was worth it :).

An easy way to hack this might also be something like this ?

# Did this just for testing purpose
export nonarch_libdir = "/usr/lib32"

do_install:append() {
 if [ ! "${libdir}" = "${nonarch_libdir}" ]; then mkdir ${D}${nonarch_libdir};mv ${D}${libdir}/snapper ${D}${nonarch_libdir}/snapper; fi
}


FILES:${PN} += "${nonarch_libdir}/snapper ${libdir}/pam_snapper ${systemd_system_unitdir} ${libdir}/security ${datadir}"

Since I'm not building multilib, I just did an export for nonarch_libdir to have a difference here for testing. Kind of seemed to work.
The 'mkdir' command is probably  only needed in my testcase, because if building multilib the ${D}${nonarch_libdir} directory is presumably already present

Not pretty but eventually less maintainance than a patch