[PATCH] gemini: Add hdparm setting

Linus Walleij linus.walleij at linaro.org
Sun Jul 4 15:01:06 PDT 2021


This uses "hdparm" (if present) to get the harddisk into low
power mode on NAS set-ups.

Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 .../linux/gemini/base-files/etc/board.d/03_hdparm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100755 target/linux/gemini/base-files/etc/board.d/03_hdparm

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 100755
index 000000000000..68d76f0acdf8
--- /dev/null
+++ b/target/linux/gemini/base-files/etc/board.d/03_hdparm
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Spin down drives after one minute if inactive
+
+which hdparm > /dev/null
+if [ ! $? -eq 0 ] ; 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 /dev/sda > /dev/null
+	fi
+done
-- 
2.31.1




More information about the openwrt-devel mailing list