]> Frank Brehm's Git Trees - config/samara/etc.git/commitdiff
Current state
authorFrank Brehm <frank.brehm@profitbricks.com>
Tue, 17 Dec 2013 15:33:21 +0000 (16:33 +0100)
committerFrank Brehm <frank.brehm@profitbricks.com>
Tue, 17 Dec 2013 15:33:21 +0000 (16:33 +0100)
conf.d/hdparm [new file with mode: 0644]
init.d/hdparm [new file with mode: 0755]
portage/package.keywords/common
runlevels/default/avahi-daemon [deleted symlink]

diff --git a/conf.d/hdparm b/conf.d/hdparm
new file mode 100644 (file)
index 0000000..a1ae626
--- /dev/null
@@ -0,0 +1,26 @@
+# /etc/conf.d/hdparm: config file for /etc/init.d/hdparm
+
+#
+# Note that options such as -y which force *immediate* power saving options
+# should generally not be placed here.  The hdparm init.d script may run at
+# anytime with respect to other init.d scripts that do system wide drive
+# scans (like the hald script), so they will merely get spun right back up.
+# If you wish to use these options, please use the local.start init.d script
+# instead so that you're guaranteed that it will run last.
+#
+
+# You can either set hdparm arguments for each drive using hdX_args,
+# discX_args, cdromX_args and genericX_args, e.g.
+#
+# hda_args="-d1 -X66"
+# disc1_args="-d1"
+# cdrom0_args="-d1"
+
+# or you can set options for all PATA drives
+pata_all_args="-d1"
+
+# or you can set options for all SATA drives
+sata_all_args=""
+
+# or, you can set hdparm options for all drives
+all_args=""
diff --git a/init.d/hdparm b/init.d/hdparm
new file mode 100755 (executable)
index 0000000..9a4200c
--- /dev/null
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-init-8,v 1.3 2012/04/29 00:30:18 vapier Exp $
+
+depend() {
+       before bootmisc
+}
+
+do_hdparm() {
+       local e=
+       eval e=\$${extra_args}
+       [ -z "${args}${all_args}${e}" ] && return 0
+       
+       if [ -n "${args:=${all_args} ${e}}" ] ; then
+               local orgdevice=$(readlink -f "${device}")
+               if [ -b "${orgdevice}" ] ; then
+                       ebegin "Running hdparm on ${device}"
+                       hdparm ${args} "${device}" > /dev/null
+                       eend $?
+               fi
+       fi
+}
+
+scan_nondevfs() {
+       # non-devfs compatible system
+       local device
+
+       for device in /dev/hd* /dev/sd* /dev/cdrom* ; do
+               [ -e "${device}" ] || continue
+               case "${device}" in
+                       *[0-9]) continue ;;
+                       /dev/hd*)  extra_args="pata_all_args" ;;
+                       /dev/sd*)  extra_args="sata_all_args" ;;
+                       *)         extra_args="_no_xtra_args" ;;
+               esac
+
+               # check that the block device really exists by
+               # opening it for reading
+               local errmsg= status= nomed=1
+               errmsg=$(export LC_ALL=C ; : 2>&1 <"${device}")
+               status=$?
+               case ${errmsg} in
+                   *": No medium found") nomed=0;;
+               esac
+               if [ -b "${device}" ] && [ "${status}" = "0" -o "${nomed}" = "0" ] ; then
+                       local conf_var="${device##*/}_args"
+                       eval args=\$${conf_var}
+                       do_hdparm
+               fi
+       done
+}
+
+start() {
+       if get_bootparam "nohdparm" ; then
+               ewarn "Skipping hdparm init as requested in kernel cmdline"
+               return 0
+       fi
+
+       scan_nondevfs
+}
index b58793f2f20dfa8078363a27d3bc8350e4df1097..7abcbd15f5d8e3b64e2e9fca880329bb080d5076 100644 (file)
@@ -35,6 +35,7 @@ app-text/docbook2odf-xsl-stylesheets
 ~dev-java/oracle-jre-bin-1.7.0.2
 =dev-java/oracle-jre-bin-1.7*
 
+~dev-libs/icu-51.2
 #required by www-client/firefox-13.0, required by @selected, required by @world (argument)
 ~dev-libs/nspr-4.9.1
 ~dev-libs/nspr-4.9.6
diff --git a/runlevels/default/avahi-daemon b/runlevels/default/avahi-daemon
deleted file mode 120000 (symlink)
index 9a26743..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/etc/init.d/avahi-daemon
\ No newline at end of file