From dc8e861a3b604b57b146f6442c9716a59346ecb8 Mon Sep 17 00:00:00 2001 From: Bradley Bellairs <11426553+BWBellairs@users.noreply.github.com> Date: Sun, 28 Apr 2024 08:49:34 +0100 Subject: [PATCH] chore: fix /etc/fstab adjustment condition (#1038) Don't look for compress=zstd as user may want to set this. Instead, set a flag so filesystem options are set on first boot instead. --- .../shared/usr/libexec/bazzite-hardware-setup | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/system_files/desktop/shared/usr/libexec/bazzite-hardware-setup b/system_files/desktop/shared/usr/libexec/bazzite-hardware-setup index 2a544660..f28f22de 100755 --- a/system_files/desktop/shared/usr/libexec/bazzite-hardware-setup +++ b/system_files/desktop/shared/usr/libexec/bazzite-hardware-setup @@ -142,16 +142,17 @@ if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME =~ "framegam fi # FSTAB CONFIGURATION -if [[ $(grep "compress=zstd" /etc/fstab) ]]; then - echo "Applying fstab param adjustments" - if grep -q '64GB' <<< "$(lsblk -o MODEL)"; then - echo "64GB eMMC detected" - sed -i 's/compress=zstd:1/noatime,lazytime,discard=sync,compress-force=zstd:3,space_cache=v2/g' /etc/fstab - else - sed -i 's/compress=zstd:1/noatime,lazytime,commit=120,discard=async,compress-force=zstd:1,space_cache=v2/g' /etc/fstab - fi +if [[ ! -e /etc/ublue-os/.fstab_adjusted.flag ]]; then + echo "Applying fstab param adjustments" + if grep -q '64GB' <<< "$(lsblk -o MODEL)"; then + echo "64GB eMMC detected" + sed -i 's/compress=zstd:1/noatime,lazytime,discard=sync,compress-force=zstd:3,space_cache=v2/g' /etc/fstab + else + sed -i 's/compress=zstd:1/noatime,lazytime,commit=120,discard=async,compress-force=zstd:1,space_cache=v2/g' /etc/fstab + fi + touch /etc/ublue-os/.fstab_adjusted.flag else - echo "No fstab param adjustments needed" + echo "No fstab param adjustments needed" fi # ZRAM MINIMUM-FREE CONFIGURATION