From 83441522a2389fd44630df3368c3eecf3cb2579f Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Fri, 23 Jul 2021 12:29:27 +0200 Subject: 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 --- target/linux/gemini/base-files/etc/board.d/03_hdparm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 target/linux/gemini/base-files/etc/board.d/03_hdparm (limited to 'target/linux/gemini') 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 -- cgit v1.2.3