[initcpiocfg] rework is_intel_cpu

This commit is contained in:
Vitor Lopes 2020-12-08 15:54:05 +00:00 committed by Adriaan de Groot
parent df256b608a
commit 5da736466c

View File

@ -127,6 +127,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
encrypt_hook = False
openswap_hook = False
unencrypted_separate_boot = False
is_cpu_intel = cpu["proc0"]["vendor_id"].lower() == "genuineintel"
# It is important that the plymouth hook comes before any encrypt hook
if detect_plymouth():
@ -179,12 +180,13 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
else:
hooks.extend(["filesystems"])
cpu_intel = "genuineintel"
if btrfs and cpu["proc0"]["vendor_id"].lower() != cpu_intel:
if btrfs and not is_cpu_intel:
modules.append("crc32c")
elif (btrfs and cpu["proc0"]["vendor_id"].lower() == cpu_intel):
elif btrfs and is_cpu_intel:
modules.append("crc32c-intel")
else:
elif not btrfs:
hooks.append("fsck")
write_mkinitcpio_lines(hooks, modules, files, root_mount_point)