[baseimage]: Add fstrim service and fstrim timer by default (#2804)

This service (weekly) will let SSD firmware to do the garbage collection
after file-system deleted files. It could avoid slowness or
even READ-ONLY error due to SSD not being able to free the pages
even though the file system thinks there was a lot of space left.

Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
This commit is contained in:
zhenggen-xu 2019-04-21 14:21:16 -07:00 committed by lguohan
parent ba0ca01ee0
commit 75964ef243
7 changed files with 4 additions and 12 deletions

View File

@ -269,6 +269,10 @@ sudo dpkg --root=$FILESYSTEM_ROOT -P {{ debname }}
sudo rm -f $FILESYSTEM_ROOT/usr/sbin/policy-rc.d
# Copy fstrim service and timer file, enable fstrim timer
sudo cp $IMAGE_CONFIGS/fstrim/* $FILESYSTEM_ROOT/etc/systemd/system/
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable fstrim.timer
## copy platform rc.local
sudo cp $IMAGE_CONFIGS/platform/rc.local $FILESYSTEM_ROOT/etc/

View File

@ -2,8 +2,6 @@ s6100/scripts/iom_power_*.sh usr/local/bin
s6100/scripts/s6100_platform.sh usr/local/bin
common/dell_i2c_utils.sh usr/local/bin
common/io_rd_wr.py usr/local/bin
common/fstrim.timer etc/systemd/system
common/fstrim.service etc/systemd/system
common/platform_reboot usr/share/sonic/device/x86_64-dell_s6100_c2538-r0
s6100/scripts/platform_sensors.py usr/local/bin
s6100/scripts/platform_watchdog_enable.sh usr/local/bin

View File

@ -1,9 +1,5 @@
# postinst script for S6100
# Enable fstrim
systemctl enable fstrim.timer
systemctl start fstrim.timer
# Enable Dell-S6100-platform-service
depmod -a
systemctl enable platform-modules-s6100.service

View File

@ -2,8 +2,6 @@ z9100/scripts/check_qsfp.sh usr/local/bin
z9100/scripts/z9100_platform.sh usr/local/bin
common/dell_i2c_utils.sh usr/local/bin
common/io_rd_wr.py usr/local/bin
common/fstrim.timer etc/systemd/system
common/fstrim.service etc/systemd/system
common/platform_reboot usr/share/sonic/device/x86_64-dell_z9100_c2538-r0
z9100/scripts/platform_sensors.py usr/local/bin
z9100/scripts/z9100_qsfp_monitor.py usr/local/bin

View File

@ -1,9 +1,5 @@
# postinst script for Z9100
# Enable fstrim
systemctl enable fstrim.timer
systemctl start fstrim.timer
# Enable Dell-Z9100-platform-service
depmod -a
systemctl enable platform-modules-z9100.service