Build Error Due to Changes in 'udevadm' Output
Symptom
When a make
command for the Meinberg driver package for Linux is run,
execution fails with an error message like:
make: Entering directory '/home/martin/mbgtools-lx/mbgclock' /bin/sh: -c: line 0: syntax error near unexpected token `(' /bin/sh: -c: line 0: `if [ 239 (239-41.el8_3.1) -lt 055 ]; then echo "55-mbgclock.rules.before-udev-055"; else echo "55-mbgclock.rules"; fi; '
Affected Linux Distros
This has been observed on the CentOS8 distribution. Because CentOS is a free clone of Red Hat Enterprise Linux, this will probably also occur on Red Hat Enterprise Linux 8 (i.e. RHEL8), and may also occur on some versions of Fedora Linux, which is also maintained by RedHat.
Root Cause
The command udevadm –version
is called from the Makefile to determine the version of the udev
system provided by the distro.
For many years, and across all distros we have seen before, the output of the command used to be a simple numeric string like 221. However, in the affected Linux distros, the output of the command is something like 239 (239-41.el8_3.1) instead, and the extended string causes confusion when it is evaluated.
Affected Driver Versions
The symptoms described above may occur with version 4.2.14 of the Meinberg driver packages for Linux, and with all earlier versions.
Please note there is no problem with the driver itself, it's just with the commands used to build the driver package.
Possible Fixes
Possible ways to fix this problem for now is to
- either use the stable driver package 4.2.14 and call each
make
command with an additional parameter - or use the
devel
branch of the git repo of the driver package.
Using the Stable Version mbgtools-lx-4.2.14
The stable version 4.2.14 of the driver package is available from the Meinberg web page at
or at the head of the master
branch of the git repository at
If this driver package is used, it is possible to avoid the problem if a specific
command line option is passed to each make
command, e.g.:
make UDEV_VER=239 make UDEV_VER=239 clean make UDEV_VER=239 install
The numeric version code doesn't really matter. It can be anything greater than “55”.
Using the 'git' Repo
A real fix is already available in a prerelease version of the driver package
which is available on the devel
branch of the git repo of the driver package.
So if you use git to update the driver package, you can use the following commands to clone and build the driver package:
git clone https://git.meinbergglobal.com/drivers/mbgtools-lx.git cd mbgtools-lx git checkout devel
After this, it should be possible to build the driver package as described in the README file,
without additional options for the make
command.
— Martin Burnicki martin.burnicki@meinberg.de, last updated 2021-01-27