Yocto Linux /lib/modules/ directory differs per root filesystem build

I am using Yocto Kirkstone to create a Linux image for a i.MX8 device. It successfully builds the Linux kernel version 5.15.71.

I have also integrated RAUC (https://github.com/rauc/rauc) for firmware updates. This method creates an A/B partitioning scheme for firmware updates where the root file system is updated on the device.

I have created a bbappend in my own custom layer and locked the SRCREV of the kernel.

SRCREV = "50ade09d822cbf0f49af4c2cac250edb4003c7ef"

The problem I am facing is that after a RAUC update of the root filesystem, the secondary partition is successfully updated and activated, however the /lib/modules/ directory has the incorrect version. This results in error messsages such as the following:

Aug 27 13:29:02 device python3[754]: modprobe: FATAL: Module ip_tables not found in directory /lib/modules/5.15.71-1.0+ge1cb7633db6d
Aug 27 13:29:02 device python3[753]: iptables v1.8.7 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Aug 27 13:29:02 device python3[753]: Perhaps iptables or your kernel needs to be upgraded.
Aug 27 13:29:02 device python3[748]: 2024-08-27 13:29:02,425:ERROR:Error: Failed to set firewall commands: None

The actual directory that does exist on disk is now:

/lib/modules/2018 5.15.71-1.0+g885f034ad83a

When I check the Yocto tmp/work/*/linux-complab build directory, I can see that the git repository is successfully checked out to my specified version. If I symlink this new directory to the expected directory version, the kernel successfully finds the modules it is looking for.

Why is the root filesystem image produced by Yocto containing this directory by a changing name? How can I lock it down to one dependable name?