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.
This commit is contained in:
Bradley Bellairs 2024-04-28 08:49:34 +01:00 committed by GitHub
parent 96d1d84d10
commit dc8e861a3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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