Skip to content

Commit a325b62

Browse files
committed
Fall back to the absolute path for fstrim if needed
fstrim is usually in /usr/sbin, but /usr/sbin might not be in $PATH. Use /usr/sbin/fstrim if this is the case.
1 parent a1a3c04 commit a325b62

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

qubes-rpc/post-install.d/95-fstrim.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
# only run if storage is persistent
66
if [ -f /run/qubes/persistent-full ]
77
then
8-
fstrim -av
8+
if command -v fstrim >/dev/null; then
9+
fstrim -av
10+
else
11+
# /usr/sbin might not be in $PATH, fall back to the absolute path
12+
# if necessary
13+
/usr/sbin/fstrim -av
14+
fi
915
fi

0 commit comments

Comments
 (0)