From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- sys-power/pm-utils/Manifest | 22 +++++ .../pm-utils/files/1.4.1-bluetooth-sync.patch | 43 ++++++++++ .../pm-utils/files/1.4.1-disable-sata-alpm.patch | 24 ++++++ sys-power/pm-utils/files/1.4.1-echo-n.patch | 51 ++++++++++++ sys-power/pm-utils/files/1.4.1-fix-alpm-typo.patch | 29 +++++++ .../1.4.1-fix-intel-audio-powersave-hook.patch | 40 +++++++++ .../pm-utils/files/1.4.1-ignore-led-failure.patch | 14 ++++ .../files/1.4.1-inhibit-on-right-status.patch | 20 +++++ .../pm-utils/files/1.4.1-logging-append.patch | 17 ++++ .../pm-utils/files/1.4.1-run-hook-logging.patch | 17 ++++ .../pm-utils/files/1.4.1-suspend-hybrid.patch | 36 +++++++++ .../files/1.4.1-uswsusp-hibernate-mode.patch | 19 +++++ .../files/1.4.1-xfs_buffer_arguments.patch | 31 +++++++ sys-power/pm-utils/files/pm-utils.logrotate | 8 ++ sys-power/pm-utils/files/power.d/pci_devices | 61 ++++++++++++++ sys-power/pm-utils/files/power.d/usb_bluetooth | 45 +++++++++++ sys-power/pm-utils/files/sleep.d/50unload_alx | 18 +++++ sys-power/pm-utils/metadata.xml | 10 +++ sys-power/pm-utils/pm-utils-1.4.1-r6.ebuild | 93 +++++++++++++++++++++ sys-power/pm-utils/pm-utils-1.4.1-r7.ebuild | 94 ++++++++++++++++++++++ 20 files changed, 692 insertions(+) create mode 100644 sys-power/pm-utils/Manifest create mode 100644 sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch create mode 100644 sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch create mode 100644 sys-power/pm-utils/files/1.4.1-echo-n.patch create mode 100644 sys-power/pm-utils/files/1.4.1-fix-alpm-typo.patch create mode 100644 sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch create mode 100644 sys-power/pm-utils/files/1.4.1-ignore-led-failure.patch create mode 100644 sys-power/pm-utils/files/1.4.1-inhibit-on-right-status.patch create mode 100644 sys-power/pm-utils/files/1.4.1-logging-append.patch create mode 100644 sys-power/pm-utils/files/1.4.1-run-hook-logging.patch create mode 100644 sys-power/pm-utils/files/1.4.1-suspend-hybrid.patch create mode 100644 sys-power/pm-utils/files/1.4.1-uswsusp-hibernate-mode.patch create mode 100644 sys-power/pm-utils/files/1.4.1-xfs_buffer_arguments.patch create mode 100644 sys-power/pm-utils/files/pm-utils.logrotate create mode 100644 sys-power/pm-utils/files/power.d/pci_devices create mode 100644 sys-power/pm-utils/files/power.d/usb_bluetooth create mode 100644 sys-power/pm-utils/files/sleep.d/50unload_alx create mode 100644 sys-power/pm-utils/metadata.xml create mode 100644 sys-power/pm-utils/pm-utils-1.4.1-r6.ebuild create mode 100644 sys-power/pm-utils/pm-utils-1.4.1-r7.ebuild (limited to 'sys-power/pm-utils') diff --git a/sys-power/pm-utils/Manifest b/sys-power/pm-utils/Manifest new file mode 100644 index 000000000000..c8667a263b90 --- /dev/null +++ b/sys-power/pm-utils/Manifest @@ -0,0 +1,22 @@ +AUX 1.4.1-bluetooth-sync.patch 1504 SHA256 2af763812d609f384c818635028791c875e3e56a1fa387e80b7f1ca5afc3c4e3 SHA512 35e02607280b4cd166fbbb1dfc44ef33d20debe1e564db9d532af74a773cc4f8cc3ee3be149318cbbc0f9cc451b5001a499609dd962ff42c0a7c3305215ef831 WHIRLPOOL ca8cd0a50962f100fd956254771a243d4433a6a518a3c8d925ee78f1b527888b0d3d37e71981779dd7b424f9771d5a418d8d2e82ee96ac3fcf401c574f644bcb +AUX 1.4.1-disable-sata-alpm.patch 578 SHA256 93fb45b92af2772975155f4c0dfc8d8c596dc4d0e67668313658aef19bf118f2 SHA512 ae2ed5c0170c3c54592819b39b3901f88c795b285decdffc1c505d3f05b2f68f9c5f9ff074157d7b176daa674cd63cda05faf11cd8f03a91a6010f3de1acf683 WHIRLPOOL 7e4a9ce758c7e40a9be37c37513c102c55b25fb10e1a1017c315169aed3215919329300bfdb5c5e5f0d2ddadbc6d54ac9e057edcfb2a0a070666a0784b49f033 +AUX 1.4.1-echo-n.patch 1602 SHA256 7a6581179a08bf3c7db051beb31d9d4b93c1726af1acbf9e7a66d178a418fb4e SHA512 a3ea6ac65b5a75b2af43c3c4ba36c2cab50ad7d4f916ff2750426ae87853d110253d157b365884615f0daa58b51fd41fb45d3dbc182b8d53f55e1f04e968f62b WHIRLPOOL 30e259a68492c157b0c212f4e7311a913531dc322e5c7faf6541f2dd4f3c7960b0241ba6e38ad5c8e15557b6c2eed7ebd5088aeb89709d7c3a85f9dcf0a7d777 +AUX 1.4.1-fix-alpm-typo.patch 1052 SHA256 340135cc9b8cfd538564c4e839922401011f0bd374dafde0b00252b4939f1726 SHA512 9858ad0400e420387c458349e375cf7d9c9fd40f54cc329595eda9458adf830cdd5033dc4c0408aae9fb010852face5c82df04a2ef1dce536d451e50372a2555 WHIRLPOOL 5ab4ec6412f0dfa9841269149e8e2d206781f713352fbd476428585020de519713edb4848e5e9b7f148cb38f2a990b89482e971dc4079fd41634b61d5e1af003 +AUX 1.4.1-fix-intel-audio-powersave-hook.patch 1412 SHA256 16d5355d1c5cff6316fef11768673434394582c67039c79e8b86aafe2d2f7797 SHA512 5c5cc0e810c9a189de5d3b603cac1c5adb69058f2033daad3558463d1a0f65c039e19132da54da373929fe8e652ae06e28edad2ea9ce17a2f73527e494eecaff WHIRLPOOL aa0f8191cd4697a3fe314c248624282284e6ef540add5998de11d1e910c1516103c3061490ce6b8750ac929891f4ce5b757532aee0f2d8e233fc83ec4d60410e +AUX 1.4.1-ignore-led-failure.patch 269 SHA256 0d2262a68a2abdbcca99b310d39399fa11afc6e04bd6540d03502b902454e873 SHA512 7429d2adad4caa53a787456a223ae2b280b81285bebf3f952597a8e56ec818c61502721d95095ac58e9846769f70ab377cd1ea5bede7c4f9620a7ff0c4b9f0d3 WHIRLPOOL cb78388793c69fd2eb98dce7f4ada8d214723f85d786e8d081211e9d70af7ab6ae4a5d06449e0960133409c70cba563aa9ce3bc20617b37e7c0e39db0bd38eda +AUX 1.4.1-inhibit-on-right-status.patch 568 SHA256 160a61d0517d8df086f98b935db2ddf174084ca18510be6939762f1bdf4e28bc SHA512 79e835bf1ba214e6fc5c4ea3d8861f61d83c583311d170215265cf1f7180dacd74b380ee4e14c36ed75cc9777f8f02004167c263fb2bf8a871538732f5adf3e9 WHIRLPOOL 71e18b41e827cfc224b8eb170ef7023b02c2c7df5e375a871f041074e66093efcaa55e5c5c8ec5b08804218bcf11d91a0dbb44173025955e10ba0577762db145 +AUX 1.4.1-logging-append.patch 485 SHA256 955f80e12212988abd63f78e98d74ad894c0b84ca11355fc9554edae209e1abf SHA512 215f3ca6a01fc22fa2065a7d3be02a95e0cef15fb4c04121b1dec673a98318e78799a81545474535f8ec6d48309809af855b79cc122db2010193d24647c71b71 WHIRLPOOL 916d99a6255af11c3e96f175d0ddb915fe492d612016ff3ebe4c4b8f0f52fc4ab2c444b4a2ac3d64433e07b2f5e335f603b28ca2feda902152ff544bf9f4678c +AUX 1.4.1-run-hook-logging.patch 461 SHA256 f320b0d77631a7a382dd4ed0796555f571dfd2705d6bc79587eec4cb99d5e9a9 SHA512 f6c136229527033765203344f7cb08959c289bb011a74ac44afc0e32a6a7e3983ea8dcbc5b0929a7ea23101a56ebceb79425614f88c131c9fe13b3885f008458 WHIRLPOOL cde40f7cbbbe6dab4b0b189abff1acecae3539ea4b0090c053aaa455a379eac862e848ba92dc809f5ae5bbc29fe0784bce31c67989fde69b2289e5d34448a4e0 +AUX 1.4.1-suspend-hybrid.patch 1096 SHA256 3d1d499fc62f9aba84d99950501496d444a3357db3fb27dd5e78d886cd0add12 SHA512 57fe2b4c55a6b946eccfba1701d9d21d9e9e3e8937b37be3a9d0984664e32dfb368373b3f6556382de0f72e3ea38dd710f4e6efc0ce8fca959e35c745243acc3 WHIRLPOOL 3fd03ee02267db0c4a24d7243a28e5e8017ee3f0936a2ffa2ce4c60c3e72ff47ab379f02cb7f95e45af081b12c7185605ca44fb9d1ff39ec80a0801a0811047a +AUX 1.4.1-uswsusp-hibernate-mode.patch 385 SHA256 c2495e09767a5d2ca3299e0e98f38d20abde06e3d700bf32f51a166d3e14b73d SHA512 b558aef41b93ffc528e18d80a82db99bef3afc19955a112437adb1dcae2342272f45d14de758ae07f496bf3f36b479b3439959ad2731ab76f75d60f55134e3b0 WHIRLPOOL 8ec555e2f1482db36ccbc1dba8073a4da645ac4185eb1af7bdce3fce96c9c71d5e5d296c8d50aa9322f03adaf9cf1a9eeaa8901d64dc94578fa74d4947681606 +AUX 1.4.1-xfs_buffer_arguments.patch 956 SHA256 f22e2ffe0ed6e0ef7e18ce48509eb3a1b4ea84facef73f30ce015c8bbf399fbf SHA512 5e3a3394f941833446b6d2ee0f0d0fb570e1bafc1ebbff218bdd67dc8f15b2f7e919e2b45157c761e924e32811c28a7b0eacd1a571bccdb4ceaa6f029f99c0f8 WHIRLPOOL b8ddd5d2934ca5a5e6d216603a44173be311a19ca49f95c7c3af2007a520e8ead984d77b54d82d8150a927e02bba555cfbb4085b13b180b2c46b3e2c98930b37 +AUX pm-utils.logrotate 157 SHA256 5109125cf5af3658f417a4e41e62eb45c722b3d74ef5d9b589ae6cf795b5cfe9 SHA512 70e9ef36928258e046f37d3369aad28c1222c1ca58956b57ba35a6476762228cd7b3a68bbf434c4b4936db3b4a921a50025e6da885632d7696f4f4c800310707 WHIRLPOOL 0383cf7db5111a0204662300894ac85191bf2fca1a1474b1e874ced0d8333dc23aa1dab4eff6b1f0566a22ab22c336b352eea418790f5360b11503f94e7d2128 +AUX power.d/pci_devices 1391 SHA256 cec8e843d992a01c98d51255674f86ec78ee2034f76bde917eb718c2b72d67e3 SHA512 62ec8d6b6704690304ab31612c6141a6f0362cde0a18c884606d1513afebad2acddb82268471bf57bd5a641604a6f196446c8da8d899ccc3e09c008db18df7b2 WHIRLPOOL ef807e96a8382ac569d2f577499ef33874217050870b2b28b99cdc77408eea1032b8818274158f3406a5c0a1bcff559a64544de6617a9520cd66614fa849e588 +AUX power.d/usb_bluetooth 1121 SHA256 f2f06d4a7179edf51a0022ca0f6d61b5013ace1f94944c8fac75f075d11c9e69 SHA512 b96abfdb8745f320ac3f1f368d1095195c68b0a56270aea4c5ad61e913ddc1641c5b5e1aadc6225d78f88956c4ffb2a396e031de02b9ecced09fac09765701bf WHIRLPOOL 6c82f5b5e2f844fea3a55a2ca7506e31862f3b1a21915d1a7c0b59b9860f0507c1c8c74b27d3e7acd8d5b5c79bb37fdd1abef554e4beef88c41e759bc6091306 +AUX sleep.d/50unload_alx 316 SHA256 7325ffde4b6cbb70eecfeafb301df4a053fe1db11cd3314275cdb3ca3af38a04 SHA512 64e7f77088a6157c90024d26ae6afde40abffc17d8ec2775e6a4ed17fac6c6fc1787c9f1b02cd0f4cd9e18dd74502f84e894006875b7dcacc39e509b3e0d86b0 WHIRLPOOL a5bc946803a0bedd84ff60938dcf98dd25b76374a8d9772475ff15d3d4807f51ef4b65b2ffad401e08a9b0b2b946a540155c5a0fc7ca884eeac85c90f79bbf60 +DIST pm-utils-1.4.1.tar.gz 208687 SHA256 8ed899032866d88b2933a1d34cc75e8ae42dcde20e1cc21836baaae3d4370c0b SHA512 5bc9479fe75f120aee136befeb24c8d7d85f61410b551177ed61fd1b4ea9cce7989796b067e357ea93b44b4ae9f66311687066f188236c5efdfd3750695a8017 WHIRLPOOL 7bf4752d96af776c90eb2d0319d615be157c8289551c72edb0c7fed05aeebbdc729f405d5ff04de401f4c12bfb8801e8b80242c3ba28e7b973442e51bf2374a3 +EBUILD pm-utils-1.4.1-r6.ebuild 2910 SHA256 a91a7590f474be52927c8f667f8f9f419455441087c2131b105270d879bc9868 SHA512 89762dd49c51124d4100f248ab39307f5916dcb0454439e9007abe601053b14cd8ff54c9381678af72cf9db9d462b242171475554577cb6395efdb600b37aa7f WHIRLPOOL 7e41398747864ad876d92680ddff784352ade9120044d3f94b676c85a8393a23bae3378856715e88fb32676f38627a285ce821ed6fdafa200bdac7014947a1e0 +EBUILD pm-utils-1.4.1-r7.ebuild 2954 SHA256 aa35ee2ae35ad2a1638facea105b2c0d4e0ea2200dd9069462d467a6f26b4de4 SHA512 a934a5594cc531db8e25f8a9e386abefbd1d84547d8773680309a8d06668b14d63a9155a6a03b168bffde665d6c958e191f1df9d6634e33443c87bb6a6e3bbbc WHIRLPOOL 4ac7f33761d44f9f876244940812092e4cf2b9fa79f5fbafd9838066f236e0aa90a3bedf83d4e5abe29dfc857b128a955f47aabbe626618d09c739830e9539ff +MISC ChangeLog 4292 SHA256 185360d74f62fe130105c2249d562cadbe063d3bdf1fe3da59ac405be26cfddb SHA512 005bb97e59b4325fb0545272dc17db77b2a2a6fc365c1d15677eee7476a468d87c9ae4d979cf2a26cfd1c939c41af1558726c5a6df84aa9fffad6b1fda2db0c8 WHIRLPOOL 4236e3322f93b7c53261e6cbe14d4d5a0530fb79cfcea697b9080ffbfd9d79673057bc1a355349984dc5cd40d48608a140ab1fe1e7c6027a5f9aee6233a222e0 +MISC ChangeLog-2015 12697 SHA256 c71bc84336a631c39228a45700a3f44aff6b6a6f7ecbc261f618c9671f0e2229 SHA512 004fe1880eae437af246124ee41259f2f7c18fa01e165b0ccee906e2b7c2045307dd120295cc2be8cd1785ac52a45cabe73a6a3ed0b3b111266b8a523d420e72 WHIRLPOOL 9e2ef7230b4dda9508fc5657368f9a6b83d68f9d0391dffa08c20c18febe82e08af904e63aee8961b389bdaa4c73c0bf4dca90309c4d683809ac2499f34d1ad2 +MISC metadata.xml 321 SHA256 a2d02d6ed75f6dd8f896ea4ba6be0015ddc0aeb6827bced520acf70b2162e8eb SHA512 8bbd7192ac92567bef9234c1725dd9abd12fbb2809d961d0f6690f05b9477e0d07ef6056a516b1eddb1c533c6b80560c9924d74f1e2fe57f682ca1e622354563 WHIRLPOOL e5e9ea74b111b1e6a4bb3f2045532f5899788e3a1fbe731c76e7a22628967b5685a3420bb84a69cd5d4e785f4e50888d2b7011367179bcb554a13815748f23cd diff --git a/sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch b/sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch new file mode 100644 index 000000000000..b41f32cf9165 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-bluetooth-sync.patch @@ -0,0 +1,43 @@ +From 640b53438c20818b3e344343b58b1f1765606a85 Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Mon, 31 Jan 2011 15:30:01 +0100 +Subject: [PATCH] 49bluetooth: Wait for btusb module to get unused + +The 49bluetooth hook disables /proc/acpi/ibm/bluetooth but this isn't +synchronous, i. e. it doesn't wait until the module usage count actually drops +to 0. Due to that, it's impossible to add btusb to SUSPEND_MODULES (on some +models/older kernels you need to do that to fix suspend problems), as at that +point the module is still in use. + +On my system (ThinkPad X201) the module takes between 0.3 and 0.5 seconds to +unload, so use 100 ms wait steps with a timeout of 2 seconds. + +Bug: https://bugs.freedesktop.org//show_bug.cgi?id=33759 +Bug-Ubuntu: https://launchpad.net/bugs/698331 +--- + pm/sleep.d/49bluetooth | 9 +++++++++ + 1 files changed, 9 insertions(+), 0 deletions(-) + +diff --git a/pm/sleep.d/49bluetooth b/pm/sleep.d/49bluetooth +index d46ba49..0dc1909 100755 +--- a/pm/sleep.d/49bluetooth ++++ b/pm/sleep.d/49bluetooth +@@ -12,6 +12,15 @@ suspend_bluetooth() + if grep -q enabled /proc/acpi/ibm/bluetooth; then + savestate ibm_bluetooth enable + echo disable > /proc/acpi/ibm/bluetooth ++ ++ # wait for up to 2 seconds for the module to actually get ++ # unused ++ TIMEOUT=20 ++ while [ $TIMEOUT -ge 0 ]; do ++ [ `cat /sys/module/btusb/refcnt` = 0 ] && break ++ TIMEOUT=$((TIMEOUT-1)) ++ sleep 0.1 ++ done + else + savestate ibm_bluetooth disable + fi +-- +1.7.2.3 + diff --git a/sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch b/sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch new file mode 100644 index 000000000000..e3e3819b82eb --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-disable-sata-alpm.patch @@ -0,0 +1,24 @@ +Description: Disable SATA link power management by default, as it still causes disk errors and corruptions on many hardware. +Author: Martin Pitt +Bug-Ubuntu: https://launchpad.net/bugs/539467 + +--- pm/power.d/sata_alpm ++++ pm/power.d/sata_alpm +@@ -2,7 +2,7 @@ + + . "${PM_FUNCTIONS}" + +-SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-true} ++SATA_ALPM_ENABLE=${SATA_ALPM_ENABLE:-false} + + help() { + cat < +Date: Tue, 28 Jul 2015 22:24:56 -0400 +Subject: [PATCH] Avoid -n in "echo -n foo > /sys/bar" + +It's not portable and not needed. + +https://bugs.freedesktop.org/show_bug.cgi?id=91497 + +[ Rebased on top of Gentoo's -r6 patchset. ] +--- + pm/pm-functions.in | 8 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/pm/pm-functions.in b/pm/pm-functions.in +index c82be30..a68f955 100644 +--- a/pm/pm-functions.in ++++ b/pm/pm-functions.in +@@ -296,13 +296,13 @@ + if [ -z "$SUSPEND_MODULE" ]; then + if grep -q mem /sys/power/state; then + SUSPEND_MODULE="kernel" +- do_suspend() { echo -n "mem" >/sys/power/state; } ++ do_suspend() { echo "mem" >/sys/power/state; } + elif [ -c /dev/pmu ] && pm-pmu --check; then + SUSPEND_MODULE="kernel" + do_suspend() { pm-pmu --suspend; } + elif grep -q standby /sys/power/state; then + SUSPEND_MODULE="kernel" +- do_suspend() { echo -n "standby" >/sys/power/state; } ++ do_suspend() { echo "standby" >/sys/power/state; } + fi + fi + +@@ -317,10 +317,10 @@ + HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \ + HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \ + HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \ +- echo -n "${HIBERNATE_MODE}" > /sys/power/disk +- echo -n "disk" > /sys/power/state ++ echo "${HIBERNATE_MODE}" > /sys/power/disk ++ echo "disk" > /sys/power/state + RET=$? +- echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk ++ echo "$HIBERNATE_MODE_SAVE" > /sys/power/disk + return "$RET" + } + fi +-- +2.4.6 + diff --git a/sys-power/pm-utils/files/1.4.1-fix-alpm-typo.patch b/sys-power/pm-utils/files/1.4.1-fix-alpm-typo.patch new file mode 100644 index 000000000000..799369159ff2 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-fix-alpm-typo.patch @@ -0,0 +1,29 @@ +From 93d46b88f415c1931b017856e3162c192bfba07c Mon Sep 17 00:00:00 2001 +From: Martin Pitt +Date: Wed, 11 Jan 2012 15:39:53 +0100 +Subject: [PATCH 3/3] Fix typo in sata_alpm +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +ALPM → APLM + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44676 +Bug-Ubuntu: https://launchpad.net/bugs/900930 +--- + pm/power.d/sata_alpm | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pm/power.d/sata_alpm b/pm/power.d/sata_alpm +index 5ede307..400e1e7 100644 +--- a/pm/power.d/sata_alpm ++++ b/pm/power.d/sata_alpm +@@ -28,7 +28,7 @@ set_sata_alpm() { + [ "${kv%-*}" \< "2.6.33" ] && exit $NA # avoid fs corruption + for f in /sys/class/scsi_host/host*; do + [ -w "$f/link_power_management_policy" ] || continue +- printf "Setting SATA APLM on %s to %s..." "${f##*/}" "$1" ++ printf "Setting SATA ALPM on %s to %s..." "${f##*/}" "$1" + echo "$1" > "$f/link_power_management_policy" && echo Done. || \ + echo Failed. + done diff --git a/sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch b/sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch new file mode 100644 index 000000000000..2d884da1e7b6 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-fix-intel-audio-powersave-hook.patch @@ -0,0 +1,40 @@ +From: Florian Kriener +To: submit@bugs.debian.org +Subject: [pm-utils] wrong path in intel-audio-powersave (and a small bug) +Date: Sat, 25 Sep 2010 11:27:30 +0200 + +In the script intel-audio-powersave is this loop + +for dev in /sys/module/snd_*/parameters/power_save; do + [ -w "$dev/parameters/power_save" ] || continue + printf "Setting power savings for $s to %d..." "$dev##*/" "$1" + echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed. +done + +I think it should be + +for dev in /sys/module/snd_*; do + [ -w "$dev/parameters/power_save" ] || continue + printf "Setting power savings for %s to %d..." "${dev##*/}" "$1" + echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed. +done + + +This fixes the two bugs. + +diff --git a/pm/power.d/intel-audio-powersave b/pm/power.d/intel-audio-powersave +index 36675a8..da63e40 100644 +--- a/pm/power.d/intel-audio-powersave ++++ b/pm/power.d/intel-audio-powersave +@@ -20,9 +20,9 @@ EOF + + audio_powersave() { + [ "$INTEL_AUDIO_POWERSAVE" = "true" ] || exit $NA +- for dev in /sys/module/snd_*/parameters/power_save; do ++ for dev in /sys/module/snd_*; do + [ -w "$dev/parameters/power_save" ] || continue +- printf "Setting power savings for $s to %d..." "$dev##*/" "$1" ++ printf "Setting power savings for %s to %d..." "${dev##*/}" "$1" + echo $1 > "$dev/parameters/power_save" && echo Done. || echo Failed. + done + } diff --git a/sys-power/pm-utils/files/1.4.1-ignore-led-failure.patch b/sys-power/pm-utils/files/1.4.1-ignore-led-failure.patch new file mode 100644 index 000000000000..7b8e4f2da1d1 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-ignore-led-failure.patch @@ -0,0 +1,14 @@ +Description: LED operation should not block S3/S4 +Author: Adam Lee + +Some Lenovo Thinkpad models don't have a suspend LED, this should not +block S3/S4. + +--- pm/sleep.d/95led ++++ pm/sleep.d/95led +@@ -14,3 +14,5 @@ + *) exit $NA + ;; + esac ++ ++exit 0 diff --git a/sys-power/pm-utils/files/1.4.1-inhibit-on-right-status.patch b/sys-power/pm-utils/files/1.4.1-inhibit-on-right-status.patch new file mode 100644 index 000000000000..250ae0872fbd --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-inhibit-on-right-status.patch @@ -0,0 +1,20 @@ +Description: Do not use the exit status of log rather the exit status of the hook. + +http://bugs.freedesktop.org/show_bug.cgi?id=32210 +http://bugs.gentoo.org/360673 + +--- pm/pm-functions.in ++++ pm/pm-functions.in +@@ -197,9 +197,11 @@ + # rest of args passed to hook unchanged. + log "Running hook $*:" + hook_ok "$1" && "$@" ++ # log() changes the return value, so save it for later ++ local status=$? + log "" + log -n "$*: " +- hook_exit_status $? && LAST_HOOK="${1##*/}" || inhibit ++ hook_exit_status $status && LAST_HOOK="${1##*/}" || inhibit + } + + if profiling; then diff --git a/sys-power/pm-utils/files/1.4.1-logging-append.patch b/sys-power/pm-utils/files/1.4.1-logging-append.patch new file mode 100644 index 000000000000..7a5d682b122d --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-logging-append.patch @@ -0,0 +1,17 @@ +Author: James Westby +Description: Do not clear the log file on each operation, but instead append to it. + This makes debugging of several suspends much easier. +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=25255 +Bug-Ubuntu: https://launchpad.net/bugs/410352 + +--- pm/pm-functions.in ++++ pm/pm-functions.in +@@ -271,7 +271,7 @@ + return 1 + fi + export LOGGING=true +- exec > "$1" 2>&1 ++ exec >> "$1" 2>&1 + } + + check_suspend() { [ -n "$SUSPEND_MODULE" ]; } diff --git a/sys-power/pm-utils/files/1.4.1-run-hook-logging.patch b/sys-power/pm-utils/files/1.4.1-run-hook-logging.patch new file mode 100644 index 000000000000..19ac4064d791 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-run-hook-logging.patch @@ -0,0 +1,17 @@ +Description: In suspend log, put empty line after running the hook, not in between. +Author: Dominique Brazziel +Bug-Debian: http://bugs.debian.org/661168 + +--- pm/pm-functions.in ++++ pm/pm-functions.in +@@ -199,9 +199,9 @@ + hook_ok "$1" && "$@" + # log() changes the return value, so save it for later + local status=$? +- log "" + log -n "$*: " + hook_exit_status $status && LAST_HOOK="${1##*/}" || inhibit ++ log "" + } + + if profiling; then diff --git a/sys-power/pm-utils/files/1.4.1-suspend-hybrid.patch b/sys-power/pm-utils/files/1.4.1-suspend-hybrid.patch new file mode 100644 index 000000000000..8d92002733f3 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-suspend-hybrid.patch @@ -0,0 +1,36 @@ +Description: Add support for in-kernel suspend to both +Author: Bojan Smojver +Author: Jaroslav Škarvada +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=52572 +Bug-Ubuntu: https://launchpad.net/bugs/1172692 + +--- pm/pm-functions.in ++++ pm/pm-functions.in +@@ -336,8 +336,28 @@ + { + [ -n "${HIBERNATE_MODE}" ] && \ + grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \ ++ HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \ ++ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*[}" && \ ++ HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%]*}" && \ + echo -n "${HIBERNATE_MODE}" > /sys/power/disk + echo -n "disk" > /sys/power/state ++ RET=$? ++ echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk ++ return "$RET" ++ } ++fi ++ ++# for kernels that support suspend to both (i.e. hybrid suspend) ++# since kernel 3.6 ++if [ -z "$SUSPEND_HYBRID_MODULE" ] && \ ++ [ -f /sys/power/disk ] && \ ++ grep -q disk /sys/power/state && \ ++ grep -q suspend /sys/power/disk; then ++ SUSPEND_HYBRID_MODULE="kernel" ++ do_suspend_hybrid() ++ { ++ HIBERNATE_MODE="suspend" ++ do_hibernate + } + fi diff --git a/sys-power/pm-utils/files/1.4.1-uswsusp-hibernate-mode.patch b/sys-power/pm-utils/files/1.4.1-uswsusp-hibernate-mode.patch new file mode 100644 index 000000000000..8c970698d5bb --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-uswsusp-hibernate-mode.patch @@ -0,0 +1,19 @@ +Description: Check HIBERNATE_MODE in uswsusp module +Author: Vadim Solomin +Bug-Debian: http://bugs.debian.org/589553 + +--- pm/module.d/uswsusp ++++ pm/module.d/uswsusp +@@ -87,7 +87,11 @@ + HIBERNATE_MODULE="uswsusp" + do_hibernate() + { +- s2disk ++ if [ -n "$HIBERNATE_MODE" ]; then ++ s2disk -P "shutdown method=$HIBERNATE_MODE" ++ else ++ s2disk ++ fi + } + fi + diff --git a/sys-power/pm-utils/files/1.4.1-xfs_buffer_arguments.patch b/sys-power/pm-utils/files/1.4.1-xfs_buffer_arguments.patch new file mode 100644 index 000000000000..3eee91166f88 --- /dev/null +++ b/sys-power/pm-utils/files/1.4.1-xfs_buffer_arguments.patch @@ -0,0 +1,31 @@ +From fdc626dadfd985e823f4e828f2a542c945aea219 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andr=C3=A9=20Draszik?= +Date: Tue, 10 Jan 2012 11:21:02 +0100 +Subject: [PATCH 2/2] pm/power.d/xfs_buffer: Fix wrong argument ordering + +Write the values in the correct order. + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=44620 +Bug-Ubuntu: https://launchpad.net/bugs/645974 + +Signed-off-by: Martin Pitt +--- + pm/power.d/xfs_buffer | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/pm/power.d/xfs_buffer b/pm/power.d/xfs_buffer +index d21e845..9f06f6e 100644 +--- a/pm/power.d/xfs_buffer ++++ b/pm/power.d/xfs_buffer +@@ -59,7 +59,7 @@ xfs_ac() { + xfs_battery() { + state_exists xfs_buffer_default || \ + read_values |savestate xfs_buffer_default +- write_values "$XFS_AGE_BUFFER" "$XFS_BUFD" "$XFS_SYNCD" ++ write_values "$XFS_AGE_BUFFER" "$XFS_SYNCD" "$XFS_BUFD" + } + + case $1 in +-- +1.7.7.3 + diff --git a/sys-power/pm-utils/files/pm-utils.logrotate b/sys-power/pm-utils/files/pm-utils.logrotate new file mode 100644 index 000000000000..85de40035092 --- /dev/null +++ b/sys-power/pm-utils/files/pm-utils.logrotate @@ -0,0 +1,8 @@ +/var/log/pm-suspend.log /var/log/pm-powersave.log { + monthly + rotate 4 + delaycompress + compress + notifempty + missingok +} diff --git a/sys-power/pm-utils/files/power.d/pci_devices b/sys-power/pm-utils/files/power.d/pci_devices new file mode 100644 index 000000000000..c06b706d82a7 --- /dev/null +++ b/sys-power/pm-utils/files/power.d/pci_devices @@ -0,0 +1,61 @@ +#!/bin/sh + +# +# This script adjusts the power control of a set of PCI devices that +# prove beneficial to enable power savings +# + +PCI_DEVICES_PM_ENABLE="${PCI_DEVICES_PM_ENABLE:-true}" + +set_pci_device() +{ + for dev in /sys/bus/pci/devices/* ; do + if [ -e $dev/class -a -e $dev/power/control ]; then + id=`basename $dev` + case `cat $dev/class` in + 0x020000) # ethernet + echo "Setting Ethernet device $id to $1" + echo $1 > $dev/power/control + ;; + 0x028000) # wireless + echo "Setting Wireless device $id to $1" + echo $1 > $dev/power/control + ;; + 0x040300) # audio + echo "Setting Audio device $id to $1" + echo $1 > $dev/power/control + ;; + 0x060000) # host bridge + echo "Setting Host Bridge $id to $1" + echo $1 > $dev/power/control + ;; + 0x080500) # SD card reader + echo "Setting SD card reader device $id to $1" + echo $1 > $dev/power/control + ;; + 0x088000|0x088001) # card reader + echo "Setting card reader device $id to $1" + echo $1 > $dev/power/control + ;; + 0x0c0000|0x0c0010) # firewire + echo "Setting FireWire device $id to $1" + echo $1 > $dev/power/control + ;; + esac + fi + done +} + +case "$1" in + true) # powersaving on + [ "$PCI_DEVICES_PM_ENABLE" = true ] && set_pci_device "auto" + ;; + false) # powersaving off + [ "$PCI_DEVICES_PM_ENABLE" = true ] && set_pci_device "on" + ;; + *) + exit 254 + ;; +esac + +exit 0 diff --git a/sys-power/pm-utils/files/power.d/usb_bluetooth b/sys-power/pm-utils/files/power.d/usb_bluetooth new file mode 100644 index 000000000000..615d19e95631 --- /dev/null +++ b/sys-power/pm-utils/files/power.d/usb_bluetooth @@ -0,0 +1,45 @@ +#!/bin/sh + +# +# This script adjusts the USB bluetooth device settings via the USB +# power control. This simply sets this to "auto" for power saving and to "on" +# for non-power saving. This has been shown to save about 1W on some +# systems. +# +# According to http://www.usb.org/developers/defined_class +# USB wireless bluetooth devices have baseclass 0xe0, subclass 0x01, +# protocol 0x01 +# + +USB_BLUETOOTH_PM_ENABLE="${USB_BLUETOOTH_PM_ENABLE:-true}" + +set_usb_bluetooth() +{ + for dev in /sys/bus/usb/devices/* ; do + if [ -e $dev/bDeviceClass -a \ + -e $dev/bDeviceSubClass -a \ + -e $dev/bDeviceProtocol -a \ + -e $dev/power/control ]; then + if [ x`cat $dev/bDeviceClass` = xe0 -a \ + x`cat $dev/bDeviceSubClass` = x01 -a \ + x`cat $dev/bDeviceProtocol` = x01 ]; then + echo Setting $dev to $1 + echo $1 > $dev/power/control + fi + fi + done +} + +case "$1" in + true) # powersaving on + [ "$USB_BLUETOOTH_PM_ENABLE" = true ] && set_usb_bluetooth "auto" + ;; + false) # powersaving off + [ "$USB_BLUETOOTH_PM_ENABLE" = true ] && set_usb_bluetooth "on" + ;; + *) + exit 254 + ;; +esac + +exit 0 diff --git a/sys-power/pm-utils/files/sleep.d/50unload_alx b/sys-power/pm-utils/files/sleep.d/50unload_alx new file mode 100644 index 000000000000..6d352c50f7c0 --- /dev/null +++ b/sys-power/pm-utils/files/sleep.d/50unload_alx @@ -0,0 +1,18 @@ +#!/bin/sh + +# 50unload_alx: unload the alx module during suspend (LP #1173952) + +[ -d /sys/module/alx ] || exit 0 + +. "${PM_FUNCTIONS}" + +case "$1" in + suspend) + echo "Unloading alx kernel module ..." + modunload alx && echo Done. || echo Failed. + ;; + resume) + echo "Reloading alx kernel module ..." + ;; +esac +exit 0 diff --git a/sys-power/pm-utils/metadata.xml b/sys-power/pm-utils/metadata.xml new file mode 100644 index 000000000000..26e2876f1a74 --- /dev/null +++ b/sys-power/pm-utils/metadata.xml @@ -0,0 +1,10 @@ + + + + + freedesktop-bugs@gentoo.org + + + Install support for net-misc/ntp + + diff --git a/sys-power/pm-utils/pm-utils-1.4.1-r6.ebuild b/sys-power/pm-utils/pm-utils-1.4.1-r6.ebuild new file mode 100644 index 000000000000..f7ada2b2e566 --- /dev/null +++ b/sys-power/pm-utils/pm-utils-1.4.1-r6.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils multilib + +DESCRIPTION="Suspend and hibernation utilities" +HOMEPAGE="https://pm-utils.freedesktop.org/" +SRC_URI="https://pm-utils.freedesktop.org/releases/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 sparc x86" +IUSE="alsa debug ntp video_cards_intel video_cards_radeon" + +vbetool="!video_cards_intel? ( sys-apps/vbetool )" +RDEPEND="!=sys-apps/util-linux-2.13 + sys-power/pm-quirks + alsa? ( media-sound/alsa-utils ) + ntp? ( || ( net-misc/ntp net-misc/openntpd ) ) + amd64? ( ${vbetool} ) + x86? ( ${vbetool} ) + video_cards_radeon? ( app-laptop/radeontool )" +DEPEND="${RDEPEND}" + +DOCS="AUTHORS ChangeLog NEWS pm/HOWTO* README* TODO" + +src_prepare() { + local ignore="01grub" + use ntp || ignore+=" 90clock" + + use debug && echo 'PM_DEBUG="true"' > "${T}"/gentoo + echo "HOOK_BLACKLIST=\"${ignore}\"" >> "${T}"/gentoo + + epatch \ + "${FILESDIR}"/${PV}-bluetooth-sync.patch \ + "${FILESDIR}"/${PV}-disable-sata-alpm.patch \ + "${FILESDIR}"/${PV}-fix-intel-audio-powersave-hook.patch \ + "${FILESDIR}"/${PV}-logging-append.patch \ + "${FILESDIR}"/${PV}-fix-alpm-typo.patch \ + "${FILESDIR}"/${PV}-inhibit-on-right-status.patch \ + "${FILESDIR}"/${PV}-ignore-led-failure.patch \ + "${FILESDIR}"/${PV}-run-hook-logging.patch \ + "${FILESDIR}"/${PV}-suspend-hybrid.patch \ + "${FILESDIR}"/${PV}-uswsusp-hibernate-mode.patch \ + "${FILESDIR}"/${PV}-xfs_buffer_arguments.patch +} + +src_configure() { + econf --disable-doc +} + +src_install() { + default + doman man/*.{1,8} + + # Remove duplicate documentation install + rm -r "${ED}"/usr/share/doc/${PN} + + insinto /etc/pm/config.d + doins "${T}"/gentoo + + insinto /etc/logrotate.d + newins "${FILESDIR}"/${PN}.logrotate ${PN} #408091 + + exeinto /usr/$(get_libdir)/${PN}/sleep.d + doexe "${FILESDIR}"/sleep.d/50unload_alx + + exeinto /usr/$(get_libdir)/${PN}/power.d + doexe "${FILESDIR}"/power.d/{pci_devices,usb_bluetooth} + + # No longer required with current networkmanager (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/55NetworkManager + + # No longer required with current kernels (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/49bluetooth + + # Punt HAL related file wrt #401257 (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/hal-cd-polling + + # Punt hooks which have shown to not reduce, or even increase power usage + # (rm -f from debian rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/{journal-commit,readahead} + + # Remove hooks which are not stable enough yet (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/harddrive + + # Change to executable (chmod +x from debian/rules) + fperms +x /usr/$(get_libdir)/${PN}/defaults +} diff --git a/sys-power/pm-utils/pm-utils-1.4.1-r7.ebuild b/sys-power/pm-utils/pm-utils-1.4.1-r7.ebuild new file mode 100644 index 000000000000..774ad3b31331 --- /dev/null +++ b/sys-power/pm-utils/pm-utils-1.4.1-r7.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 +inherit eutils multilib + +DESCRIPTION="Suspend and hibernation utilities" +HOMEPAGE="https://pm-utils.freedesktop.org/" +SRC_URI="https://pm-utils.freedesktop.org/releases/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm ~arm64 ia64 ~mips ppc ppc64 sparc x86" +IUSE="alsa debug ntp video_cards_intel video_cards_radeon" + +vbetool="!video_cards_intel? ( sys-apps/vbetool )" +RDEPEND="!=sys-apps/util-linux-2.13 + sys-power/pm-quirks + alsa? ( media-sound/alsa-utils ) + ntp? ( || ( net-misc/ntp net-misc/openntpd ) ) + amd64? ( ${vbetool} ) + x86? ( ${vbetool} ) + video_cards_radeon? ( app-laptop/radeontool )" +DEPEND="${RDEPEND}" + +DOCS="AUTHORS ChangeLog NEWS pm/HOWTO* README* TODO" + +src_prepare() { + local ignore="01grub" + use ntp || ignore+=" 90clock" + + use debug && echo 'PM_DEBUG="true"' > "${T}"/gentoo + echo "HOOK_BLACKLIST=\"${ignore}\"" >> "${T}"/gentoo + + epatch \ + "${FILESDIR}"/${PV}-bluetooth-sync.patch \ + "${FILESDIR}"/${PV}-disable-sata-alpm.patch \ + "${FILESDIR}"/${PV}-fix-intel-audio-powersave-hook.patch \ + "${FILESDIR}"/${PV}-logging-append.patch \ + "${FILESDIR}"/${PV}-fix-alpm-typo.patch \ + "${FILESDIR}"/${PV}-inhibit-on-right-status.patch \ + "${FILESDIR}"/${PV}-ignore-led-failure.patch \ + "${FILESDIR}"/${PV}-run-hook-logging.patch \ + "${FILESDIR}"/${PV}-suspend-hybrid.patch \ + "${FILESDIR}"/${PV}-uswsusp-hibernate-mode.patch \ + "${FILESDIR}"/${PV}-xfs_buffer_arguments.patch \ + "${FILESDIR}"/${PV}-echo-n.patch +} + +src_configure() { + econf --disable-doc +} + +src_install() { + default + doman man/*.{1,8} + + # Remove duplicate documentation install + rm -r "${ED}"/usr/share/doc/${PN} + + insinto /etc/pm/config.d + doins "${T}"/gentoo + + insinto /etc/logrotate.d + newins "${FILESDIR}"/${PN}.logrotate ${PN} #408091 + + exeinto /usr/$(get_libdir)/${PN}/sleep.d + doexe "${FILESDIR}"/sleep.d/50unload_alx + + exeinto /usr/$(get_libdir)/${PN}/power.d + doexe "${FILESDIR}"/power.d/{pci_devices,usb_bluetooth} + + # No longer required with current networkmanager (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/55NetworkManager + + # No longer required with current kernels (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/sleep.d/49bluetooth + + # Punt HAL related file wrt #401257 (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/hal-cd-polling + + # Punt hooks which have shown to not reduce, or even increase power usage + # (rm -f from debian rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/{journal-commit,readahead} + + # Remove hooks which are not stable enough yet (rm -f from debian/rules) + rm -f "${ED}"/usr/$(get_libdir)/${PN}/power.d/harddrive + + # Change to executable (chmod +x from debian/rules) + fperms +x /usr/$(get_libdir)/${PN}/defaults +} -- cgit v1.2.3