Skip to content

Commit

Permalink
chore: Add useful messages about trim status
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Mar 1, 2024
1 parent ed02a65 commit e692ba7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec_files/jupiter-hw-support/fstrim.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
--- a/usr/lib/hwsupport/trim-devices.sh
+++ b/usr/lib/hwsupport/trim-devices.sh
@@ -78,6 +78,16 @@
@@ -78,6 +78,18 @@
return;
}

+# If fstrim has been disabled by the end-user, do nothing
+if ! systemctl is-enabled fstrim.timer; then
+ echo "fstrim.timer disabled, exiting trim-devices.sh"
+ exit
+fi
+
+# If the upstream fstrim service is currently running, do nothing
+if systemctl is-active fstrim.service; then
+ echo "fstrim.service is currently active, exiting trim-devices.sh"
+ exit
+fi
+
Expand Down

0 comments on commit e692ba7

Please sign in to comment.