Disabled fstrim on BTRFS by default (#2109)

* Disabled fstrim on BTRFS by default

* Changed variable name to conform with suggestion in #2109
This commit is contained in:
Anton Hvornum 2023-09-26 09:56:34 +02:00 committed by GitHub
parent b141609990
commit c427391543
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -587,6 +587,7 @@ class Installer:
hostname: str = 'archinstall',
locale_config: LocaleConfiguration = LocaleConfiguration.default()
):
_disable_fstrim = False
for mod in self._disk_config.device_modifications:
for part in mod.partitions:
if part.fs_type is not None:
@ -597,6 +598,10 @@ class Installer:
if (binary := part.fs_type.installation_binary) is not None:
self._binaries.append(binary)
# https://github.com/archlinux/archinstall/issues/1837
if part.fs_type.fs_type_mount == 'btrfs':
_disable_fstrim = True
# There is not yet an fsck tool for NTFS. If it's being used for the root filesystem, the hook should be removed.
if part.fs_type.fs_type_mount == 'ntfs3' and part.mountpoint == self.target:
if 'fsck' in self._hooks:
@ -651,7 +656,10 @@ class Installer:
# periodic TRIM by default.
#
# https://github.com/archlinux/archinstall/issues/880
self.enable_periodic_trim()
# https://github.com/archlinux/archinstall/issues/1837
# https://github.com/archlinux/archinstall/issues/1841
if not _disable_fstrim:
self.enable_periodic_trim()
# TODO: Support locale and timezone
# os.remove(f'{self.target}/etc/localtime')