Disable zswap (#883)
Disable zswap when using zram. The swap device is now initialised before the bootloader, inline with the installation guide.
This commit is contained in:
parent
671bf7595c
commit
34488d25c5
|
|
@ -619,8 +619,11 @@ class Installer:
|
||||||
with open(f"{self.target}/etc/systemd/zram-generator.conf", "w") as zram_conf:
|
with open(f"{self.target}/etc/systemd/zram-generator.conf", "w") as zram_conf:
|
||||||
zram_conf.write("[zram0]\n")
|
zram_conf.write("[zram0]\n")
|
||||||
|
|
||||||
if self.enable_service('systemd-zram-setup@zram0.service'):
|
self.enable_service('systemd-zram-setup@zram0.service')
|
||||||
return True
|
|
||||||
|
self.zram_enabled = True
|
||||||
|
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Archinstall currently only supports setting up swap on zram")
|
raise ValueError(f"Archinstall currently only supports setting up swap on zram")
|
||||||
|
|
||||||
|
|
@ -727,6 +730,12 @@ class Installer:
|
||||||
if bind_path is not None: # and root_fs_type == 'btrfs':
|
if bind_path is not None: # and root_fs_type == 'btrfs':
|
||||||
options_entry = f"rootflags=subvol={bind_path} " + options_entry
|
options_entry = f"rootflags=subvol={bind_path} " + options_entry
|
||||||
|
|
||||||
|
# Zswap should be disabled when using zram.
|
||||||
|
#
|
||||||
|
# https://github.com/archlinux/archinstall/issues/881
|
||||||
|
if self.zram_enabled:
|
||||||
|
options_entry = "zswap.enabled=0 " + options_entry
|
||||||
|
|
||||||
if real_device := self.detect_encryption(root_partition):
|
if real_device := self.detect_encryption(root_partition):
|
||||||
# TODO: We need to detect if the encrypted device is a whole disk encryption,
|
# TODO: We need to detect if the encrypted device is a whole disk encryption,
|
||||||
# or simply a partition encryption. Right now we assume it's a partition (and we always have)
|
# or simply a partition encryption. Right now we assume it's a partition (and we always have)
|
||||||
|
|
|
||||||
|
|
@ -219,11 +219,11 @@ def perform_installation(mountpoint):
|
||||||
installation.set_hostname(archinstall.arguments['hostname'])
|
installation.set_hostname(archinstall.arguments['hostname'])
|
||||||
if archinstall.arguments['mirror-region'].get("mirrors", None) is not None:
|
if archinstall.arguments['mirror-region'].get("mirrors", None) is not None:
|
||||||
installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
|
installation.set_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors in the installation medium
|
||||||
|
if archinstall.arguments['swap']:
|
||||||
|
installation.setup_swap('zram')
|
||||||
if archinstall.arguments["bootloader"] == "grub-install" and archinstall.has_uefi():
|
if archinstall.arguments["bootloader"] == "grub-install" and archinstall.has_uefi():
|
||||||
installation.add_additional_packages("grub")
|
installation.add_additional_packages("grub")
|
||||||
installation.add_bootloader(archinstall.arguments["bootloader"])
|
installation.add_bootloader(archinstall.arguments["bootloader"])
|
||||||
if archinstall.arguments['swap']:
|
|
||||||
installation.setup_swap('zram')
|
|
||||||
|
|
||||||
# If user selected to copy the current ISO network configuration
|
# If user selected to copy the current ISO network configuration
|
||||||
# Perform a copy of the config
|
# Perform a copy of the config
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue