diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2021-07-23 12:29:27 +0200 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2021-08-08 19:50:45 +0200 |
commit | 83441522a2389fd44630df3368c3eecf3cb2579f (patch) | |
tree | 000a45b0e7196328735799674a7a97052c921079 /target/linux | |
parent | d3794768177293f584cc74f90c921276793da1e7 (diff) | |
download | upstream-83441522a2389fd44630df3368c3eecf3cb2579f.tar.gz upstream-83441522a2389fd44630df3368c3eecf3cb2579f.tar.bz2 upstream-83441522a2389fd44630df3368c3eecf3cb2579f.zip |
gemini: Add hdparm setting
This uses "hdparm" (if present) to get the harddisk into low
power mode on NAS set-ups.
Cc: Adrian Schmutzler <mail@adrianschmutzler.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/gemini/base-files/etc/board.d/03_hdparm | 14 |
1 files changed, 14 insertions, 0 deletions
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 |