summaryrefslogtreecommitdiff
path: root/sys-apps/hdparm
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/hdparm
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/hdparm')
-rw-r--r--sys-apps/hdparm/Manifest12
-rw-r--r--sys-apps/hdparm/files/hdparm-9.48-sysmacros.patch23
-rw-r--r--sys-apps/hdparm/files/hdparm-9.50-build.patch32
-rw-r--r--sys-apps/hdparm/files/hdparm-9.51-build.patch32
-rw-r--r--sys-apps/hdparm/files/hdparm-conf.d.326
-rw-r--r--sys-apps/hdparm/files/hdparm-init-860
-rw-r--r--sys-apps/hdparm/hdparm-9.51.ebuild44
-rw-r--r--sys-apps/hdparm/hdparm-9.52.ebuild44
-rw-r--r--sys-apps/hdparm/metadata.xml11
9 files changed, 284 insertions, 0 deletions
diff --git a/sys-apps/hdparm/Manifest b/sys-apps/hdparm/Manifest
new file mode 100644
index 000000000000..bd1f7bc6550c
--- /dev/null
+++ b/sys-apps/hdparm/Manifest
@@ -0,0 +1,12 @@
+AUX hdparm-9.48-sysmacros.patch 474 SHA256 6e75ceceac0065586af5982822d3c54fbd189dbd929102d40ac3fbf372fc1698 SHA512 cd12a544f6149076c48657f572d71dbc400fa80fa26e6604325d3812159f2a3cd3ab79d8f248b64aac3db7c9913c6f406e427cab62103c927274ff6439a4151a WHIRLPOOL 453542b64f9c64dce17824a46d4d81468b79f7252eb8dc502578264cc3735d15c08ee69a61e98be5e451f4477e05c4fdf70248ec2267d4d177295e9f515ce65c
+AUX hdparm-9.50-build.patch 1216 SHA256 389c96c9769b470b7a6e50d3a02ace02cc15d4f4058229e24f808e1f47c8ec99 SHA512 5b914d446a1a8ee5e99253abc450dec706e57a55d87d82b14e4fcabf1cd76d0575f3adc1a3a226925662ac30cd674403d5b652af17e8776bdc43453b2cda9951 WHIRLPOOL 837f6e449cdbd20ae2991b57f01d6542d4ac5f00ef8d63e1b6449fe026e3c6e50ae96c27c3c769cea27e71b04cc4fd24c0b082243f65f1262b18145908a7f598
+AUX hdparm-9.51-build.patch 1210 SHA256 cb69bd4c70ee1e5c0e854ff4f9c86b512e1dee1b9843eb64b74643d477155e39 SHA512 d8efe50cc8ab963be2ace3e52e077e3be8d266b2c5c293febe344fc53760d53c1b52f7bbd1c7813f7a7979a6e4ebc52cb808dc3797f6e1ac7949ac5f9696239a WHIRLPOOL 77f0351420208af26c3e48ae022396cf9535093914341ab2510e33ac94872863f75e91f7b95062e1a495d50ff2f87c2efad553f52485d7c17f00f62ecff7e11b
+AUX hdparm-conf.d.3 872 SHA256 37c95ff723fa578e9039613d09dbf790d99113a318c065422986c744519214e9 SHA512 968c6b9d26a71bf724728c259d35a499a644496875eac255dcac3cb4a7e5cadb677a4f6e5e0f8bbd7e1826b6fb77cb39af15b11d1e59b3e9daf9ba442b9e6f02 WHIRLPOOL 110d330860c4f5e3b1626b85ab369a02e5c092acf656edc845a2f311b5349644317ec2021063a0fb977d3b9851e0bb9c54fd66e814a080d6af3aa0f05fbd658b
+AUX hdparm-init-8 1360 SHA256 05b264cadc84984f773cd555af322b41fdb13da7cb2ca60d8a7d590ddf4d5e5f SHA512 0417168cf540d2385c5edc4e199c9c2318f97c397d4bbb8b0ac6d4dcadf153564a51a9a5da172442c75a670f79fdec84da5db777a1400cf3c8d8cf6a7066fcc8 WHIRLPOOL 5b0a1ac41153ba724540cdc8285dda32916ce1251ef94cca3b2bfd10ceff2d317f838827efb5f8646993617436f030768b00cf24ccd8dfa786f592128d90f69c
+DIST hdparm-9.51.tar.gz 133725 SHA256 1afad8891ecbe644c283f7d725157660ebf8bd5b4d9d67232afd45f83d2d5d91 SHA512 144d073d697d05058e0240ff46e5517803baa8475e1d381a31c25179ceb1564bbb561ba7f9dee8654d80a3510e3bf2f2d2f4a267618f0ab27967f37626aef91c WHIRLPOOL 4010a38656098820f7b34fced0b001209c12c42d22a1d8c2ca8ac3370e938ba1fb06f98afd7dcc1a1e22abf910bd476663fe8ad18fb221605e702e14bcabc25f
+DIST hdparm-9.52.tar.gz 140737 SHA256 c3429cd423e271fa565bf584598fd751dd2e773bb7199a592b06b5a61cec4fb6 SHA512 7c37d1381c1dd2d46762a8cdcaba2015b0b051ee7bd135dbcf6346def51b085cc2f9ecd7e1ebdc67e12ab4b765df548d4757b3700ed6e7514c2b13ed40661c59 WHIRLPOOL 0ce98e2d496c849be1300d76d1d67757448354a019b5c455f579435d4003055baeef87085da25e6b97958a1c4b07431d805c5cbfd51a1bf10d963fbf7ea91391
+EBUILD hdparm-9.51.ebuild 1068 SHA256 77ea5e2a05e6a6d1197f72414a5885e718b85062f89007748b76a409d3ae5491 SHA512 af88b4d68dbb6c844b170a0313bb0ba98b6a0b2e36b3b2b6e45a5e6f6f6129f2a2aafb6b0fa63177b2af717cac5c0e322f3ed00f7ffe6a6c941dfa8145d3d7bb WHIRLPOOL 0ad3c1be3f3e2316691927aaa99e688b0599599d63c4c0604b57cf46e27e02af7d4cb99baf07f669e706eba08c0d51955b00f714f890978f11147520436db4b9
+EBUILD hdparm-9.52.ebuild 1078 SHA256 eb2301df15ed656a22f666b66b1026e3802a6a8cb3d7cef71b7bc5729b329c5b SHA512 ac4011c806f47a3738bef9e0665f4b7f5bde684b201d312b1c6f0cd117a1a66527204091b02cbfbbc8b4eeb715507e1f5e52aeee29a7e0e7af2aa860530e019a WHIRLPOOL b3532ab5b6e1dd6b484993ba8e9a2779edbe14680e92d062e1ed38aff7f809f4d4fc72b2ab5268dd146555365ded84cc7b70a1360f98ba3a7ff8c265510f73a5
+MISC ChangeLog 6089 SHA256 1c9961ba41505fa44254f46d5407b0fe041c9f652e219337d5bec5655c1a416c SHA512 c16eaa5639e54681ec0e6034c0967bb647fcbb49284124a52d5e4623575be60a9a4e4f076bc73e633ef68df7e27711eab3a202dfdcf3935f0ef4d061f1eeb953 WHIRLPOOL d26ee92e3246dc80fb5cfa545c8e4946a0a5eaff9dcd9aa73a0534f6c72a8d4577c777ee7a99af71fd00bef9bb359465462358010754d8b13961b52bacff5b3b
+MISC ChangeLog-2015 29602 SHA256 b11c232cbca367d9174b4a13a5bc97d4ff4e2f881ddc9272bc0147bca2efeb1c SHA512 2767c835711cb2284f76f6af9e300f2d398b76b9ba9f9d0af0ff2dfa468c4632ad45f1a1a1e27b6fbfd6de280c217190f4cc7b9677831542f52dcf519c78ac11 WHIRLPOOL 6365cbaf837b554f04294f386624f759465fa9f5f602c44130cd2fbf9e0c475387647e97529584f4a86f7624d4482e94c6da33b3cf2268d79bb73564170c268c
+MISC metadata.xml 326 SHA256 7be17151b3f5f5c65b8edad44e9c49ac62d306f856a257b67e0f01a1d6b1796d SHA512 39219fcef0756910c51e804cf94170408208840e7b88d99b4583f8fcfb02e1664358f9d4bf4c3f1a1a619b6a87852bc4831c93f10215500842023132a85c2287 WHIRLPOOL 0c72b42d0ce47a7985115e1f65cd3a25bee06d41807b746e32966d69de586d4a84e22ffba08d1fbe0f0526d80074d8433813652e4512cadee0bbc847dac19e1b
diff --git a/sys-apps/hdparm/files/hdparm-9.48-sysmacros.patch b/sys-apps/hdparm/files/hdparm-9.48-sysmacros.patch
new file mode 100644
index 000000000000..98a08c7d36d0
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-9.48-sysmacros.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/580052
+https://sourceforge.net/p/hdparm/patches/44/
+
+--- a/geom.c
++++ b/geom.c
+@@ -15,6 +15,7 @@
+ #include <errno.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <sys/ioctl.h>
+ #include <linux/types.h>
+ #include <linux/fs.h>
+--- a/sysfs.c
++++ b/sysfs.c
+@@ -15,6 +15,7 @@
+ #include <dirent.h>
+ #include <limits.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <linux/types.h>
+
+ #include "hdparm.h"
diff --git a/sys-apps/hdparm/files/hdparm-9.50-build.patch b/sys-apps/hdparm/files/hdparm-9.50-build.patch
new file mode 100644
index 000000000000..ff1948acb01e
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-9.50-build.patch
@@ -0,0 +1,32 @@
+* drop hardcoded -O2 flag from CFLAGS
+* drop hardcoded -s (strip) flag from LDFLAGS, and respect user LDFLAGS
+* fix hardcoded `make` and hardcoded -j2 flags
+* respect CFLAGS when linking
+
+--- a/Makefile
++++ b/Makefile
+@@ -13,9 +13,8 @@
+ CC ?= gcc
+ STRIP ?= strip
+
+-CFLAGS := -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs $(CFLAGS)
++CFLAGS += -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs
+
+-LDFLAGS = -s
+ #LDFLAGS = -s -static
+ INSTALL = install
+ INSTALL_DATA = $(INSTALL) -m 644
+@@ -24,11 +23,10 @@ INSTALL_PROGRAM = $(INSTALL)
+
+ OBJS = hdparm.o identify.o sgio.o sysfs.o geom.o fallocate.o fibmap.o fwdownload.o dvdspeed.o wdidle3.o
+
+-all:
+- make -j2 hdparm
++all: hdparm
+
+ hdparm: hdparm.h sgio.h $(OBJS)
+- $(CC) $(LDFLAGS) -o hdparm $(OBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o hdparm $(OBJS)
+ $(STRIP) hdparm
+
+ hdparm.o: hdparm.h sgio.h
diff --git a/sys-apps/hdparm/files/hdparm-9.51-build.patch b/sys-apps/hdparm/files/hdparm-9.51-build.patch
new file mode 100644
index 000000000000..2c6bdba68e3f
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-9.51-build.patch
@@ -0,0 +1,32 @@
+* drop hardcoded -O2 flag from CFLAGS
+* drop hardcoded -s (strip) flag from LDFLAGS, and respect user LDFLAGS
+* fix hardcoded `make` and hardcoded -j2 flags
+* respect CFLAGS when linking
+
+--- hdparm-9.51/Makefile
++++ hdparm-9.51/Makefile
+@@ -13,9 +13,8 @@
+ CC ?= gcc
+ STRIP ?= strip
+
+-CFLAGS := -O2 -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs $(CFLAGS)
++CFLAGS += -W -Wall -Wbad-function-cast -Wcast-align -Wpointer-arith -Wcast-qual -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -fkeep-inline-functions -Wwrite-strings -Waggregate-return -Wnested-externs -Wtrigraphs
+
+-LDFLAGS = -s
+ #LDFLAGS = -s -static
+ INSTALL = install
+ INSTALL_DATA = $(INSTALL) -m 644
+@@ -24,11 +23,10 @@
+
+ OBJS = hdparm.o identify.o sgio.o sysfs.o geom.o fallocate.o fibmap.o fwdownload.o dvdspeed.o wdidle3.o
+
+-all:
+- $(MAKE) -j4 hdparm
++all: hdparm
+
+ hdparm: hdparm.h sgio.h $(OBJS)
+- $(CC) $(LDFLAGS) -o hdparm $(OBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o hdparm $(OBJS)
+ $(STRIP) hdparm
+
+ hdparm.o: hdparm.h sgio.h
diff --git a/sys-apps/hdparm/files/hdparm-conf.d.3 b/sys-apps/hdparm/files/hdparm-conf.d.3
new file mode 100644
index 000000000000..a1ae626b3b05
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-conf.d.3
@@ -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/sys-apps/hdparm/files/hdparm-init-8 b/sys-apps/hdparm/files/hdparm-init-8
new file mode 100644
index 000000000000..bb88d447e730
--- /dev/null
+++ b/sys-apps/hdparm/files/hdparm-init-8
@@ -0,0 +1,60 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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/sys-apps/hdparm/hdparm-9.51.ebuild b/sys-apps/hdparm/hdparm-9.51.ebuild
new file mode 100644
index 000000000000..23e26825b22c
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.51.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="Utility to change hard drive performance parameters"
+HOMEPAGE="https://sourceforge.net/projects/hdparm/"
+SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz"
+
+LICENSE="BSD GPL-2" # GPL-2 only
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-9.48-sysmacros.patch #580052
+ "${FILESDIR}"/${PN}-9.51-build.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ use static && append-ldflags -static
+}
+
+src_configure() {
+ tc-export CC
+ export STRIP=:
+}
+
+src_install() {
+ into /
+ dosbin hdparm contrib/idectl
+
+ newinitd "${FILESDIR}"/hdparm-init-8 hdparm
+ newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm
+
+ doman hdparm.8
+ dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig
+ docinto wiper
+ dodoc wiper/{README.txt,wiper.sh}
+ docompress -x /usr/share/doc/${PF}/wiper/wiper.sh
+}
diff --git a/sys-apps/hdparm/hdparm-9.52.ebuild b/sys-apps/hdparm/hdparm-9.52.ebuild
new file mode 100644
index 000000000000..974af72c31e2
--- /dev/null
+++ b/sys-apps/hdparm/hdparm-9.52.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="Utility to change hard drive performance parameters"
+HOMEPAGE="https://sourceforge.net/projects/hdparm/"
+SRC_URI="mirror://sourceforge/hdparm/${P}.tar.gz"
+
+LICENSE="BSD GPL-2" # GPL-2 only
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="static"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-9.48-sysmacros.patch #580052
+ "${FILESDIR}"/${PN}-9.51-build.patch
+)
+
+src_prepare() {
+ epatch "${PATCHES[@]}"
+ use static && append-ldflags -static
+}
+
+src_configure() {
+ tc-export CC
+ export STRIP=:
+}
+
+src_install() {
+ into /
+ dosbin hdparm contrib/idectl
+
+ newinitd "${FILESDIR}"/hdparm-init-8 hdparm
+ newconfd "${FILESDIR}"/hdparm-conf.d.3 hdparm
+
+ doman hdparm.8
+ dodoc hdparm.lsm Changelog README.acoustic hdparm-sysconfig
+ docinto wiper
+ dodoc wiper/{README.txt,wiper.sh}
+ docompress -x /usr/share/doc/${PF}/wiper/wiper.sh
+}
diff --git a/sys-apps/hdparm/metadata.xml b/sys-apps/hdparm/metadata.xml
new file mode 100644
index 000000000000..dc7b6247e89e
--- /dev/null
+++ b/sys-apps/hdparm/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">hdparm</remote-id>
+</upstream>
+</pkgmetadata>