Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorThomas <9749173+uhthomas@users.noreply.github.com>2022-01-20 15:32:07 +0000
committerGitHub <noreply@github.com>2022-01-20 16:32:07 +0100
commit671bf7595c44633db60ce3e139fcc4ccda891325 (patch)
treeaee9658c39ea6f543de7416d1d98725daca18bfc /archinstall/lib
parentc776e30191224b3a6cd9d3712576e88b54bf1ca6 (diff)
Enable periodic TRIM (#882)
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/installer.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 260094c8..4ba304f6 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -390,6 +390,11 @@ class Installer:
self.log('Enabling espeakup.service for speech synthesis (accessibility).', level=logging.INFO)
self.enable_service('espeakup')
+ def enable_periodic_trim(self) -> None:
+ self.log("Enabling periodic TRIM")
+ # fstrim is owned by util-linux, a dependency of both base and systemd.
+ self.enable_service("fstrim.timer")
+
def enable_service(self, *services :str) -> None:
for service in services:
self.log(f'Enabling service {service}', level=logging.INFO)
@@ -571,6 +576,13 @@ class Installer:
self.pacstrap(self.base_packages)
self.helper_flags['base-strapped'] = True
+ # Periodic TRIM may improve the performance and longevity of SSDs whilst
+ # having no adverse effect on other devices. Most distributions enable
+ # periodic TRIM by default.
+ #
+ # https://github.com/archlinux/archinstall/issues/880
+ self.enable_periodic_trim()
+
# TODO: Support locale and timezone
# os.remove(f'{self.target}/etc/localtime')
# sys_command(f'/usr/bin/arch-chroot {self.target} ln -s /usr/share/zoneinfo/{localtime} /etc/localtime')