Building mender client on master branch fails due to usrmerge

I am working to bring up Mender on our board with the master branch, and I am seeing the mender_4.0.0.bb recipe fail with the following error:

sed: can't read .../build/tmp/work/armv8a_tegra-oe4t-linux/mender/4.0.0/image/usr/lib/systemd/system/mender-updated.service: No such file or directory

That file gets installed in /lib/..., not /usr/lib/.... This appears to be due to the new usrmerge feature, but I have not been able to track down the exact place where things go sideways.

Any ideas?

I dug into this a little deeper and found that this service unit is installed by support/CMakeLists.txt, in the mender client source repository. That’s where I stopped digging, as I have a nasty allergy to cmake. :mask:

Hi @zach-welch-aquabyte,

I could reproduce it and it is indeed a mixture of the usrmerge-aware pieces in the Yocto build, and the non-aware parts in the cmake parts. Already poked the devs, will keep you updated.

Greets,
Josef

Thanks, we’ve created MEN-7038 to investigate this.

@zach-welch-aquabyte as a side note, I think the Golang client is not affected by the usrmerge issue. Maybe sticking with it for a bit more time until this is fixed is a viable workaround for you?

Greets,
Josef

I just took a quick look at switching back to the Go client, and my experiments with PREFERRED_VERSION and PREFERRED_PROVIDER did not work to select the old mender-client recipes over the new mender client. What’s the trick?

You just need to do the opposite of enabling the 4.0 client. The old client provider is “mender-client”, the new one is simply “mender”:

PREFERRED_PROVIDER_mender-native =  "mender-client-native"
PREFERRED_RPROVIDER_mender-auth =   "mender-client"
PREFERRED_RPROVIDER_mender-update = "mender-client"

PREFERRED_VERSION doesn’t need to be set, since they are different packages.