diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 9dd02c3060..16aa8303e7 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -1334,9 +1334,9 @@ ConditionKernelVersion= may be used to check whether the kernel 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. Each expression starts with one of <, <=, - = (or ==), != (or - <>), >=, > for a relative + expressions. Each expression starts with one of = or != for + string comparisons, <, <=, ==, + <>, >=, > for a relative version comparison, or =$, !=$ for a shell-style glob match. If no operator is specified =$ is implied. diff --git a/src/shared/condition.c b/src/shared/condition.c index 6c8023143b..ffca2006c0 100644 --- a/src/shared/condition.c +++ b/src/shared/condition.c @@ -206,7 +206,7 @@ static int condition_test_kernel_version(Condition *c, char **env) { break; s = strstrip(word); - operator = parse_compare_operator(&s, COMPARE_ALLOW_FNMATCH); + operator = parse_compare_operator(&s, COMPARE_ALLOW_FNMATCH|COMPARE_EQUAL_BY_STRING); if (operator < 0) /* No prefix? Then treat as glob string */ operator = COMPARE_FNMATCH_EQUAL;