From: Linus Walleij Date: Fri, 23 Jul 2021 10:29:27 +0000 (+0200) Subject: gemini: Add hdparm setting X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=83441522a2389fd44630df3368c3eecf3cb2579f;p=openwrt%2Fstaging%2Fsvanheule.git gemini: Add hdparm setting This uses "hdparm" (if present) to get the harddisk into low power mode on NAS set-ups. Cc: Adrian Schmutzler Signed-off-by: Linus Walleij --- diff --git a/target/linux/gemini/base-files/etc/board.d/03_hdparm b/target/linux/gemini/base-files/etc/board.d/03_hdparm new file mode 100644 index 0000000000..27f2b76042 --- /dev/null +++ b/target/linux/gemini/base-files/etc/board.d/03_hdparm @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Spin down drives after one minute if inactive + +if [ ! -n "$(command -v hdparm)" ]; then + exit 0 +fi + +DISKS=$(find /dev/sd[a-z] 2>/dev/null) +for DISK in $DISKS +do + if [ -b $DISK ] ; then + hdparm -S 12 $DISK > /dev/null + fi +done