From 68337e55f62cf49b7bdfb73dc5662e23b0ea17fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giedrius=20Statkevi=C4=8Dius?= Date: Wed, 11 Nov 2020 22:45:58 +0200 Subject: condition: add CPUFeature Taking a stab at implementing #14479. Add {Condition,Assert}CPUFeature to `systemd-analyze` & friends. Implement it by executing the CPUID instruction. Add tables for common x86/i386 features. Tested via unit tests + checked that commands such as: ```bash systemd-analyze condition 'AssertCPUFeature = rdrand' ``` Succeed as expected and that commands such as ```bash systemd-analyze condition 'AssertCPUFeature = foobar' ``` Fail as expected. Finally, I have amended the `systemd.unit` manual page with the new condition and the list of all currently supported flags. --- src/shared/condition.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/shared/condition.h') diff --git a/src/shared/condition.h b/src/shared/condition.h index 7853490290..75c430e9e0 100644 --- a/src/shared/condition.h +++ b/src/shared/condition.h @@ -19,6 +19,7 @@ typedef enum ConditionType { CONDITION_MEMORY, CONDITION_CPUS, CONDITION_ENVIRONMENT, + CONDITION_CPU_FEATURE, CONDITION_NEEDS_UPDATE, CONDITION_FIRST_BOOT, -- cgit v1.2.1