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.
This commit is contained in:
committed by
Yu Watanabe
parent
b1b4e9204c
commit
68337e55f6
@@ -19,6 +19,7 @@ typedef enum ConditionType {
|
||||
CONDITION_MEMORY,
|
||||
CONDITION_CPUS,
|
||||
CONDITION_ENVIRONMENT,
|
||||
CONDITION_CPU_FEATURE,
|
||||
|
||||
CONDITION_NEEDS_UPDATE,
|
||||
CONDITION_FIRST_BOOT,
|
||||
|
||||
Reference in New Issue
Block a user