From patchwork Sat Apr 20 16:45:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Stefanovi=C4=87?= X-Patchwork-Id: 11838 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C76E916ED2; Sat, 20 Apr 2019 18:34:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 545D816E94 for ; Sat, 20 Apr 2019 18:34:23 +0100 (BST) Received: from localhost ([127.0.0.1]:43724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHtsa-0003xk-Rb for patchwork@mira.cbaines.net; Sat, 20 Apr 2019 13:34:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHt7r-0003bL-C2 for guix-patches@gnu.org; Sat, 20 Apr 2019 12:46:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHt7q-00078X-A5 for guix-patches@gnu.org; Sat, 20 Apr 2019 12:46:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33136) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHt7q-00077o-4I for guix-patches@gnu.org; Sat, 20 Apr 2019 12:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHt7p-0000WR-Ui for guix-patches@gnu.org; Sat, 20 Apr 2019 12:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35345] [PATCH 1/2] gnu: Add x86-energy-perf-policy References: In-Reply-To: Resent-From: Stefan =?utf-8?q?Stefanovi=C4=87?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Apr 2019 16:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35345@debbugs.gnu.org Received: via spool by 35345-submit@debbugs.gnu.org id=B35345.15557787201956 (code B ref 35345); Sat, 20 Apr 2019 16:46:01 +0000 Received: (at 35345) by debbugs.gnu.org; 20 Apr 2019 16:45:20 +0000 Received: from localhost ([127.0.0.1]:46680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHt7A-0000VU-1t for submit@debbugs.gnu.org; Sat, 20 Apr 2019 12:45:20 -0400 Received: from mail-ot1-f52.google.com ([209.85.210.52]:43003) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHt79-0000VI-1J for 35345@debbugs.gnu.org; Sat, 20 Apr 2019 12:45:19 -0400 Received: by mail-ot1-f52.google.com with SMTP id 103so6509768otd.9 for <35345@debbugs.gnu.org>; Sat, 20 Apr 2019 09:45:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=p0armiYJk/9SAgQnZxeXUrT55JKUqeI0AHEdvMkxN+M=; b=kbBClNFYZG3Fm45naioKBnIfWZRkF4NmYxggfiwgqf3liB5BC4qHCqsQbmlzcwpXcn HKZZQgMjayX/CJ88Zic3acxXPuvFrgUQ/+/BGDJYn2zQVkD2ptv0jNB3qlv7X2yx3S35 liDKnM2GTDUYbsxYY3uzhR37c6XnX3iwMd3bf8+nBm5hO8firEc1rgRLeHALYVWLifQn MhUYpPrzveHlLB53Jv9LhCDoC3E1O4LffPoCQexfN2u2pAcrUGg1324R4+7cwu4/u5HI rseJzeJDdhjt0jEw6JWxr3uHwMBgtAexy0BfsSP5X5Mmf7+21gTwnGev/AxOSCp3okbQ MgIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=p0armiYJk/9SAgQnZxeXUrT55JKUqeI0AHEdvMkxN+M=; b=pmFD2IKUl+oH8yMCOPd431xVusincEkTji0Ualn45HioABbppprkkWVu4p8sWO/P4d 0tn+svztIn+ERjxWE1fdTpbFPZwx6/jeMFt2jczuB9Ch3rctJHp+tTzLA0/V1J65dfVt 6Y3x9TtGZS68Ebnt4aVpnLEU/XJen2pNQw+BnpIffliFMhD1QS6wLSJYT30WLicpuQMd v4QxcimkNS2gWg1ty5Zni4Q8GhNKs6WMgjo2sYzGjiwq3ftQt+E67gQmjCbY7hbTnnLc 74sS4g0nuqcvkCc35UujA6Bjv8c70XWfK1sh2TjPPibBOv59W0V9D311/JxYDR4rOh2J UVog== X-Gm-Message-State: APjAAAW9giP//LqML1nyfyFlYiDRY1MtQxHAYzXVdEg1+pxXh5Fw/gnm DztE3VAC58J8RHmhQpxQA1RuADWQMmC1CiA/mf7b8Q== X-Google-Smtp-Source: APXvYqz8RtDPik/fqVOExYh/oERztIhXbMNe9mEwqtfhxnrpgTzpqt7fnI6x2aYqxm5keEm2SkXcF8M4PYrKI/7LL8A= X-Received: by 2002:a9d:6206:: with SMTP id g6mr6130120otj.7.1555778713092; Sat, 20 Apr 2019 09:45:13 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:a849:0:0:0:0:0 with HTTP; Sat, 20 Apr 2019 09:45:12 -0700 (PDT) From: Stefan =?utf-8?q?Stefanovi=C4=87?= Date: Sat, 20 Apr 2019 16:45:12 +0000 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-Mailman-Approved-At: Sat, 20 Apr 2019 13:34:19 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From 79d021f7bd686159ad9cf4dd2f94c360b2a21ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Stefanovi=C4=87?= Date: Sat, 20 Apr 2019 15:37:13 +0200 Subject: [PATCH 1/2] gnu: Add x86-energy-perf-policy. * gnu/packages/linux.scm (cpupower): New variable. --- gnu/packages/linux.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index b562a23b2f..88905b6b74 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -3889,6 +3889,40 @@ Linux kernel to retrieve and control processor features related to power saving, such as frequency and voltage scaling.") (license license:gpl2))) +(define-public x86-energy-perf-policy + (package + (name "x86-energy-perf-policy") + (version (package-version linux-libre)) + (source (package-source linux-libre)) + (build-system gnu-build-system) + (arguments + '(#:tests? #f + #:phases + (modify-phases + %standard-phases + (add-after 'unpack 'enter-subdirectory + (lambda _ + (chdir "tools/power/x86/x86_energy_perf_policy") + #t)) + (delete 'configure) + (add-before 'build 'fix-makefile + (lambda _ + (substitute* "Makefile" (("/usr") "")) + #t))) + #:make-flags + (let ((out (assoc-ref %outputs "out"))) + (list (string-append "DESTDIR=" out) + (string-append "LDFLAGS=-Wl,-rpath=" out "/lib"))))) + (supported-systems '("i686-linux" "x86_64-linux")) + (home-page (package-home-page linux-libre)) + (synopsis "Display and update Intel-CPU energy-performance policy") + (description + "@command{x86_energy_perf_policy} displays and updates +energy-performance policy settings specific to Intel Architecture Processors. +Settings are accessed via Model Specific Register (MSR) updates, +no matter if the Linux cpufreq sub-system is enabled or not.") + (license license:gpl2))) + (define-public haveged (package (name "haveged") -- 2.21.0 From patchwork Sat Apr 20 16:48:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Stefanovi=C4=87?= X-Patchwork-Id: 11840 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5EC8716ED2; Sat, 20 Apr 2019 18:34:49 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D9CDB16E94 for ; Sat, 20 Apr 2019 18:34:48 +0100 (BST) Received: from localhost ([127.0.0.1]:43736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHtt2-0004Es-GE for patchwork@mira.cbaines.net; Sat, 20 Apr 2019 13:34:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHtPn-0005Q6-Vo for guix-patches@gnu.org; Sat, 20 Apr 2019 13:04:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHtAk-0007BP-Lu for guix-patches@gnu.org; Sat, 20 Apr 2019 12:49:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHtAk-0007Az-HU for guix-patches@gnu.org; Sat, 20 Apr 2019 12:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHtAk-0000az-FC for guix-patches@gnu.org; Sat, 20 Apr 2019 12:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35345] [PATCH 2/2] gnu: tlp: Add required x86-energy-perf-policy input dependency. References: In-Reply-To: Resent-From: Stefan =?utf-8?q?Stefanovi=C4=87?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Apr 2019 16:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35345 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35345@debbugs.gnu.org Received: via spool by 35345-submit@debbugs.gnu.org id=B35345.15557789082249 (code B ref 35345); Sat, 20 Apr 2019 16:49:02 +0000 Received: (at 35345) by debbugs.gnu.org; 20 Apr 2019 16:48:28 +0000 Received: from localhost ([127.0.0.1]:46686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHtAC-0000aB-IP for submit@debbugs.gnu.org; Sat, 20 Apr 2019 12:48:28 -0400 Received: from mail-ot1-f51.google.com ([209.85.210.51]:33998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHtAA-0000Zy-7m for 35345@debbugs.gnu.org; Sat, 20 Apr 2019 12:48:27 -0400 Received: by mail-ot1-f51.google.com with SMTP id k21so6549497otf.1 for <35345@debbugs.gnu.org>; Sat, 20 Apr 2019 09:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=vUnKI6GRr+n49Yu2cF2sj0X2NdrYcd2r2uqByE7NUrQ=; b=OXvTJUJlP6OqU2xoSA87hkl+z6BA7+IJ62eqHjxu0OFHge7Vz7GKtRpciY+5DsORmv HSPxxVck4kb4pgwjZCUISC/f6+k6nCvENwBebpkNvec1CX1CrCHTqWo0fwuGin0zN+0Z XTw2Sa/hVDeRx9aqCdyO0mZnAYTQ+Uwp/uKDUcNAOZJC/Wbfnl1vYc3AsK34ym6u3uif pTvH8HoZUsJ2vi4+2u7dLcmLmBco5j7tkxQTJAwUP30IsYTv5nliaBjwEz4Rr1E9P6YK ts7TUjUy9vnxmvKSG4db2MHScELrjPGCRig9BtZ/WAvSNU8nm0cQiJriB2xqzCDbwobP Dv5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vUnKI6GRr+n49Yu2cF2sj0X2NdrYcd2r2uqByE7NUrQ=; b=NtMtbfZkMtcyeaEnK5yerIuXcGojGorxpcPUk3ffeoRfQwo7lihXZhcQWIZNO7qFke Q7ak7lmlO6NxFgngzYXi7okPH63VmXoxEp2TK0Lwj/jQeigA5d6xRc40TJKygtADJdVh /nSRJUTpmwkFYLcIchKNSZLtqG+lFD73bWLXSJgpyff8p4ikSjCgIyBlh8zex7kOedem yfhjO6StGZAwh8Ieoz9x01MXeImK2Q1wOIF/FSUw27pR7vcTwNqE86BnrAwcMQfC4AJT E+fPIbvJQGv+SGGNhnNid8yUkjf+/3+R8BW1eWVXujg1wklXe4JmjmQScU7otmk15Lqi JU5Q== X-Gm-Message-State: APjAAAX2iJEHCfbrFzn/liHsSuuI1SkeACBmiiWXiHCgPoT5VYZJwzbZ 4h9pORhBEUfSbnFzlessi4CM819WsjFXAu1U6wuVag== X-Google-Smtp-Source: APXvYqw24Wrjib0ARgvArfruUwwReHrVehYYLJgQh4KPqxSzPL8vrtEGUvfIWbBD8/mHPEm3qogNWLyHua4ZjzDZFxk= X-Received: by 2002:a9d:4909:: with SMTP id e9mr6117342otf.160.1555778900510; Sat, 20 Apr 2019 09:48:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:a849:0:0:0:0:0 with HTTP; Sat, 20 Apr 2019 09:48:19 -0700 (PDT) From: Stefan =?utf-8?q?Stefanovi=C4=87?= Date: Sat, 20 Apr 2019 16:48:19 +0000 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-Mailman-Approved-At: Sat, 20 Apr 2019 13:34:20 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From a7264289ba328478a1dab1978fe080a5b4f392c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Stefanovi=C4=87?= Date: Sat, 20 Apr 2019 16:13:37 +0200 Subject: [PATCH 2/2] gnu: tlp: Add required x86-energy-perf-policy input dependency. * gnu/packages/linux.scm (tlp) [inputs]: Add system specific x86-energy-perf-policy dependency. [arguments]<#:phases>['wrap]: Adjust bin-directory procedure to return #f on missing input, a guard against system specific input dependencies. Filter only strings in the path list. Reformat for-each block. Add x86-energy-perf-policy in bin-directory input-name list. --- gnu/packages/linux.scm | 56 ++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 88905b6b74..aa0eeef1b0 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -4451,7 +4451,11 @@ interface in sysfs, which can be accomplished with the included udev rules.") ("sed" ,sed) ("usbutils" ,usbutils) ("util-linux" ,util-linux) - ("wireless-tools" ,wireless-tools))) + ("wireless-tools" ,wireless-tools) + ,@(if (member (or (%current-target-system) (%current-system)) + (package-supported-systems x86-energy-perf-policy)) + `(("x86-energy-perf-policy" ,x86-energy-perf-policy)) + '()))) (build-system gnu-build-system) (arguments `(#:phases @@ -4488,31 +4492,35 @@ interface in sysfs, which can be accomplished with the included udev rules.") (let* ((bin (string-append (assoc-ref outputs "out") "/bin")) (bin-files (find-files bin ".*"))) (define (bin-directory input-name) - (string-append (assoc-ref inputs input-name) "/bin")) + (let ((p (assoc-ref inputs input-name))) + (and p (string-append p "/bin")))) (define (sbin-directory input-name) (string-append (assoc-ref inputs input-name) "/sbin")) - (for-each (lambda (program) - (wrap-program program - `("PATH" ":" prefix - ,(append - (map bin-directory '("bash" - "coreutils" - "dbus" - "eudev" - "grep" - "inetutils" - "kmod" - "perl" - "sed" - "usbutils" - "util-linux")) - (map sbin-directory '("ethtool" - "hdparm" - "iw" - "pciutils" - "rfkill" - "wireless-tools")))))) - bin-files) + (for-each + (lambda (program) + (wrap-program program + `("PATH" ":" prefix + ,(filter string? + (append + (map bin-directory '("bash" + "coreutils" + "dbus" + "eudev" + "grep" + "inetutils" + "kmod" + "perl" + "sed" + "usbutils" + "util-linux" + "x86-energy-perf-policy")) + (map sbin-directory '("ethtool" + "hdparm" + "iw" + "pciutils" + "rfkill" + "wireless-tools"))))))) + bin-files) #t)))))) (home-page "http://linrunner.de/en/tlp/tlp.html") (synopsis "Power management tool for Linux") -- 2.21.0