From f4ea5df4b415f042af412f9393f18b6c7f04df5f Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 17 Dec 2013 16:33:21 +0100 Subject: [PATCH] Current state --- conf.d/hdparm | 26 ++++++++++++++ init.d/hdparm | 61 +++++++++++++++++++++++++++++++++ portage/package.keywords/common | 1 + runlevels/default/avahi-daemon | 1 - 4 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 conf.d/hdparm create mode 100755 init.d/hdparm delete mode 120000 runlevels/default/avahi-daemon diff --git a/conf.d/hdparm b/conf.d/hdparm new file mode 100644 index 0000000..a1ae626 --- /dev/null +++ b/conf.d/hdparm @@ -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 index 0000000..9a4200c --- /dev/null +++ b/init.d/hdparm @@ -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 +} diff --git a/portage/package.keywords/common b/portage/package.keywords/common index b58793f..7abcbd1 100644 --- a/portage/package.keywords/common +++ b/portage/package.keywords/common @@ -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 index 9a26743..0000000 --- a/runlevels/default/avahi-daemon +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/avahi-daemon \ No newline at end of file -- 2.39.5