Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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')