diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 78a8db2e60..c5ba817579 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -1244,15 +1244,17 @@
device-tree-compatible(value) for systems with a device tree that is compatible to
value.
- smbios-field(field operator value)
- for systems with a SMBIOS field containing a certain value.
- field is the name of the SMBIOS field exposed as sysfs attribute file
- below /sys/class/dmi/id/.
+ smbios-field(field operator
+ value) for systems with a SMBIOS field containing a certain
+ value. field is the name of the SMBIOS field exposed as
+ sysfs attribute file below /sys/class/dmi/id/.
operator is one of <, <=,
- >=, >, =, != for version
- comparison, or =$, !=$ for string comparison.
- value is the expected value of the SMBIOS field (shell-style globs are possible if
- =$ or!=$ is used).
+ >=, >, ==,
+ <> for version comparison, = and !=
+ for literal string comparison, or =$, !=$ for shell-style
+ glob comparison. value is the expected value of the SMBIOS field value
+ (possibly containing shell style globs in case =$/!=$ is
+ used).
@@ -1333,9 +1335,10 @@
version (as reported by uname -r) matches a certain expression (or if prefixed
with the exclamation mark does not match it). The argument must be a list of (potentially quoted)
expressions. For each of the expressions, if it starts with one of <,
- <=, =, !=, >=,
- > a relative version comparison is done, otherwise the specified string is
- matched with shell-style globs.
+ <=, = (or ==), !=
+ (or <>), >=, > a relative
+ version comparison is done, otherwise the specified string is matched with shell-style
+ globs.
Note that using the kernel version string is an unreliable way to determine which features
are supported by a kernel, because of the widespread practice of backporting drivers, features, and
@@ -1605,10 +1608,11 @@
Verify that the specified amount of system memory is available to the current
system. Takes a memory size in bytes as argument, optionally prefixed with a comparison operator
- <, <=, =, !=,
- >=, >. On bare-metal systems compares the amount of
- physical memory in the system with the specified size, adhering to the specified comparison
- operator. In containers compares the amount of memory assigned to the container instead.
+ <, <=, = (or ==),
+ != (or <>), >=,
+ >. On bare-metal systems compares the amount of physical memory in the system
+ with the specified size, adhering to the specified comparison operator. In containers compares the
+ amount of memory assigned to the container instead.
@@ -1617,13 +1621,14 @@
Verify that the specified number of CPUs is available to the current system. Takes
a number of CPUs as argument, optionally prefixed with a comparison operator
- <, <=, =, !=,
- >=, >. Compares the number of CPUs in the CPU affinity
- mask configured of the service manager itself with the specified number, adhering to the specified
- comparison operator. On physical systems the number of CPUs in the affinity mask of the service
- manager usually matches the number of physical CPUs, but in special and virtual environments might
- differ. In particular, in containers the affinity mask usually matches the number of CPUs assigned
- to the container and not the physically available ones.
+ <, <=, = (or ==),
+ != (or <>), >=,
+ >. Compares the number of CPUs in the CPU affinity mask configured of the
+ service manager itself with the specified number, adhering to the specified comparison operator. On
+ physical systems the number of CPUs in the affinity mask of the service manager usually matches the
+ number of physical CPUs, but in special and virtual environments might differ. In particular, in
+ containers the affinity mask usually matches the number of CPUs assigned to the container and not
+ the physically available ones.
@@ -1694,13 +1699,12 @@
Verify that a specific key=value pair is set in the host's
os-release5.
- Other than exact string matching with =, and !=,
- relative comparisons are supported for versioned parameters (e.g. VERSION_ID),
- and shell-style wildcard comparisons (*, ?,
- []) are supported with the =$ (match) and
- !=$ (non-match). The comparator can be one of <,
- <=, =, !=, >=,
- >, =$ and !=$.
+ Other than exact string matching (with = and !=),
+ relative comparisons are supported for versioned parameters (e.g. VERSION_ID;
+ with <, <=, ==,
+ <>, >=, >), and shell-style
+ wildcard comparisons (*, ?, []) are
+ supported with the =$ (match) and !=$ (non-match).
diff --git a/src/shared/compare-operator.c b/src/shared/compare-operator.c
index 43f876cabe..d7117f0771 100644
--- a/src/shared/compare-operator.c
+++ b/src/shared/compare-operator.c
@@ -15,10 +15,12 @@ CompareOperator parse_compare_operator(const char **s, CompareOperatorParseFlags
{ COMPARE_FNMATCH_EQUAL, "=$", .valid_mask = COMPARE_ALLOW_FNMATCH },
{ COMPARE_FNMATCH_UNEQUAL, "!=$", .valid_mask = COMPARE_ALLOW_FNMATCH },
+ { COMPARE_UNEQUAL, "<>" },
{ COMPARE_LOWER_OR_EQUAL, "<=" },
{ COMPARE_GREATER_OR_EQUAL, ">=" },
{ COMPARE_LOWER, "<" },
{ COMPARE_GREATER, ">" },
+ { COMPARE_EQUAL, "==" },
{ COMPARE_STRING_EQUAL, "=", .need_mask = COMPARE_EQUAL_BY_STRING },
{ COMPARE_EQUAL, "=" },
{ COMPARE_STRING_UNEQUAL, "!=", .need_mask = COMPARE_EQUAL_BY_STRING },