From: Zbigniew Jędrzejewski-Szmek Date: Fri, 21 May 2021 08:45:35 +0000 (+0200) Subject: fstrim: do not start the timer in initrd X-Git-Tag: v2.37~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cacd3e768516383424fc848532d32815bb18bfec;p=thirdparty%2Futil-linux.git fstrim: do not start the timer in initrd I'm working on building initramfs images directly from normal packages, which means that the pristine system rpms should behave correctly as much as possible also in the initrd. There usually isn't enough time for the timer to actually fire, but starting it gives a line on the console and generally looks confusing and sloppy. So let's skip the timer if it ever ends up being enabled in the initrd. Checking for /etc/initrd-release is the standard condition that systemd's initrd units use. --- diff --git a/sys-utils/fstrim.timer b/sys-utils/fstrim.timer index 54b3c18f59..60ab3b6ece 100644 --- a/sys-utils/fstrim.timer +++ b/sys-utils/fstrim.timer @@ -2,6 +2,7 @@ Description=Discard unused blocks once a week Documentation=man:fstrim ConditionVirtualization=!container +ConditionPathExists=!/etc/initrd-release [Timer] OnCalendar=weekly