[initcpiocfg] Use bools for boolean values
Having "" and "yes" as values is a bit shell-script-ish. Use a regular boolean value instead; simplify code while we're at it.
This commit is contained in:
parent
45daebd989
commit
7f7dc04e8d
@ -132,9 +132,8 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
|
|||||||
:param partitions:
|
:param partitions:
|
||||||
:param root_mount_point:
|
:param root_mount_point:
|
||||||
"""
|
"""
|
||||||
cpu = cpuinfo()
|
|
||||||
swap_uuid = ""
|
swap_uuid = ""
|
||||||
btrfs = ""
|
uses_btrfs = False
|
||||||
lvm2 = ""
|
lvm2 = ""
|
||||||
hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard",
|
hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard",
|
||||||
"keymap"]
|
"keymap"]
|
||||||
@ -159,7 +158,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
|
|||||||
openswap_hook = True
|
openswap_hook = True
|
||||||
|
|
||||||
if partition["fs"] == "btrfs":
|
if partition["fs"] == "btrfs":
|
||||||
btrfs = "yes"
|
uses_btrfs = True
|
||||||
|
|
||||||
if "lvm2" in partition["fs"]:
|
if "lvm2" in partition["fs"]:
|
||||||
lvm2 = "yes"
|
lvm2 = "yes"
|
||||||
@ -194,10 +193,8 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
|
|||||||
else:
|
else:
|
||||||
hooks.extend(["filesystems"])
|
hooks.extend(["filesystems"])
|
||||||
|
|
||||||
if btrfs == "yes" and not cpu.is_intel:
|
if uses_btrfs:
|
||||||
modules.append("crc32c")
|
modules.append("crc32c-intel" if cpuinfo().is_intel else "crc32c")
|
||||||
elif (btrfs == "yes" and cpu.is_intel):
|
|
||||||
modules.append("crc32c-intel")
|
|
||||||
else:
|
else:
|
||||||
hooks.append("fsck")
|
hooks.append("fsck")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user