From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IBItD849F2PhHAEAbAwnHQ (envelope-from ) for ; Tue, 06 Sep 2022 14:32:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KOEtD849F2ORUQEA9RJhRA (envelope-from ) for ; Tue, 06 Sep 2022 14:32:14 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D745420C3D for ; Tue, 6 Sep 2022 14:32:13 +0200 (CEST) Received: from localhost ([::1]:33478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oVXkS-00069C-EO for larch@yhetil.org; Tue, 06 Sep 2022 08:32:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oVXKB-0006FL-R4 for guix-patches@gnu.org; Tue, 06 Sep 2022 08:05:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oVXKA-00088J-B1 for guix-patches@gnu.org; Tue, 06 Sep 2022 08:05:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oVXKA-0006Au-6m for guix-patches@gnu.org; Tue, 06 Sep 2022 08:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57537] [PATCH v2] gnu: Add ec Resent-From: Denis 'GNUtoo' Carikli Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 06 Sep 2022 12:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57537 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tobias Geerinckx-Rice Cc: 57537@debbugs.gnu.org Received: via spool by 57537-submit@debbugs.gnu.org id=B57537.166246589523718 (code B ref 57537); Tue, 06 Sep 2022 12:05:02 +0000 Received: (at 57537) by debbugs.gnu.org; 6 Sep 2022 12:04:55 +0000 Received: from localhost ([127.0.0.1]:49967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVXK2-0006AT-SA for submit@debbugs.gnu.org; Tue, 06 Sep 2022 08:04:55 -0400 Received: from cyberdimension.org ([80.67.179.20]:52446 helo=gnutoo.cyberdimension.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oVXJz-0006AI-SM for 57537@debbugs.gnu.org; Tue, 06 Sep 2022 08:04:53 -0400 Received: from gnutoo.cyberdimension.org (localhost [127.0.0.1]) by cyberdimension.org (OpenSMTPD) with ESMTP id d1a03a9f; Tue, 6 Sep 2022 12:03:14 +0000 (UTC) Received: from primary_laptop (localhost [::1]) by gnutoo.cyberdimension.org (OpenSMTPD) with ESMTP id bc255537; Tue, 6 Sep 2022 12:03:14 +0000 (UTC) Date: Tue, 6 Sep 2022 06:29:07 +0200 From: Denis 'GNUtoo' Carikli Message-ID: <20220906062907.59f2f8bf@primary_laptop> In-Reply-To: <5f8e53d3d302729b6bf61823b2c5139b@tobias.gr> References: <20220902020049.15420-1-GNUtoo@cyberdimension.org> <20220902023239.26540-1-GNUtoo@cyberdimension.org> <5f8e53d3d302729b6bf61823b2c5139b@tobias.gr> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.30; i686-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/VzacTFFvbqcl2X_FR3p30O/"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662467533; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=lKfreL0ymt+Ph7SpwCmr886e2gQ3GREWE36RdBXIBQc=; b=nD7RB12rr2y7cpAunMX1i7SWBkEYjLTpfAygwjTXnebgT/fH2DoB718KrVPWustwWA6CnV 11t1bBK9MR8GVgAzpj0iV1mrwXz7MNwWClIZmojCiL4qacBuPtfgZ5FSMhvX6iu15OiKkz DGB1IrWHk2z+dF5402Le+/O45Ck9m2ay3z+Qse4jIYkWX8Cfki6Vw2ZoMBASCwy99WhdlA Je+SG/8xK20OHxivrv9mp1zEj5E9ldCcAWlGuyBXdj4PkpDwM+jZ5Iss4/tnwlBpDXFHo0 AcPAIwHpLKjnEqaGjsEkhZfbYDhgg3n63wtUTJ3+EEge06EinhVCkHxiAR63aw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662467533; a=rsa-sha256; cv=none; b=lB+MQKliSj+Bfpt0FU4aumTb7qughLBON26sTL6IbFda4jnygy8HKg/cQa0M8H4LTjslVP pXBCqhk33R9BjP+14DSbL0Kx0Y3IvXiDP2TCaUesHJPtpx2LPwoxSVHRTxb0GMcBiaQYot /lwTDPfYK+07ZHuPPBcyQk1nUNVHzUxA+uTMFGwfegj4lbm6ZABA1ZwzShSCY4YiwZqCxg 1ie4Fvzviwiic6MyX8+uPvC7ifDsUCUcDlY/MbWH7V4xil1LOEZdjwa2Rgb4KavHe+WLNs XQ5aBNfURNJZMLi4O1DjqQbLHHjp8Zz8tQcdYb+ppet0N7cd6dlTu86m7cUwKQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.87 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D745420C3D X-Spam-Score: -2.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: rwtcu4kmWxTr --Sig_/VzacTFFvbqcl2X_FR3p30O/ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 02 Sep 2022 06:47:39 +0200 Tobias Geerinckx-Rice wrote: > Hi Denis, Hi, > This tool has come in handy a few times. (But did I package it? > Nope=E2=80=A6) Thank you for doing so! Thanks for the review and sorry to have left so many issues in the patch. > Don't forget to add a copyright line for yourself at the top of the=20 > file. I thought I already had it but apparently I forgot to add it in the commit f16e6b505d5d2630b786a0477ec73b42e77b04e4 ("gnu: Add usbip-utils"). So I'll add it in the v3 of this ec patch. > > gnu: Add ec >=20 > We =E2=99=A5 full stops, even here. Fixed. > > +(define-public ec > > + (package > > + (name "ec") > > + (version (package-version linux-libre)) > > + (source (package-source linux-libre)) > > + (build-system gnu-build-system) > > + (native-inputs (list coreutils)) >=20 > I doubt this has any effect? It indeed still works without it. I added it because it didn't find true, and then I added the substitute after that. And I forgot to test without (native-inputs (list coreutils)). > > + (arguments > > + '(#:make-flags (list (string-append "DESTDIR=3D" > > + (assoc-ref %outputs > > "out")) >=20 > The magical %output{s,} is fragile and almost never necessary in new=20 > code. Make the arguments a list of keywords/gexps and use #$output=20 > instead. Thanks I've now fixed it. >=20 > > + "sbindir=3D/sbin") > > + #:phases (modify-phases %standard-phases > > + (delete 'configure) ;no configure script >=20 > It makes no difference to Guix, but for the sake of humans: > manipulate phases in their original order when there's no reason not > to. Thanks, I've also fixed that. > > + (add-after 'unpack 'patch-Makefile > > + (lambda _ > > + (substitute* > > "tools/power/acpi/Makefile.config" > > + (("/bin/true") > > + (which "true"))) > > + (substitute* > > "tools/power/acpi/Makefile.config" > > + (("/usr/bin/install") > > + (which "install"))) #t)) >=20 > Aside: no need to call substitute* twice on the exact same (list of)=20 > file(s). Thanks. Here I forgot to try to do something like that. > Nor is it necessary to look up binaries in PATH =E2=80=98by hand=E2=80=99= . Most > tools do that already. >=20 > (substitute* "Makefile.config" > (("/bin/true") "true") > (("/usr/bin/install") "install")) Thanks for the tip, that's indeed way better. > However, substitution is overkill as that Makefile doesn't hard-code=20 > either name. Right, it works if I do STRIPCMD=3Dtrue and INSTALL=3Dinstall. I should re-read the GNU make manual on variables assignments (I assumed '=3D' was like ':=3D'). > > + (add-after 'patch-Makefile 'enter-subdirectory > > + (lambda _ > > + (chdir "tools/power/acpi/tools/ec") #t))) >=20 > I'm happy to be the one to inform you that trailing #ts are=20 > long-obsolete. Nice! > > + #:tests? #f)) ;no tests > > + (home-page (package-home-page linux-libre)) > > + (synopsis > > + "Low level utility for reading or writing Embedded Controller=20 > > registers") > > + (description > > + "This utility can read or write specific registers or all the > > +available registers of the Embedded Controllers supported by the > > Linux >=20 > The =E2=80=98ec=E2=80=99 description should probably mention the word =E2= =80=98EC=E2=80=99 > *somewhere*=E2=80=A6 ;-) >=20 > =E2=86=92 =E2=80=98@acronym{EC, Embedded Controller}=E2=80=99 > > +kernel. To work it needs to run as root, to have the ec_sys driver > > +loaded, and to have the debugfs filesystem mounted at > > +/sys/kernel/debug/. >=20 > =E2=80=98@code{ec_sys} module loaded=E2=80=99, =E2=80=98@code{debugfs} fi= le system=E2=80=99, > =E2=80=98@file{/sys/kernel/debug}=E2=80=99. > > > To make write support work, the ec_sys module > > +needs to be loaded with the write_support=3D1 parameter. Write > > support +can also be enabled after loading the module with > > +the 'echo 1 > /sys/module/ec_sys/parameters/write_support' > > command.") >=20 > Using @code{}/@file{}/@samp{}=E2=80=A6 also applies here Thanks I've now fixed that. > do you know if=20 > there's *any* documentation we could install? There is Documentation/ABI/testing/debugfs-ec, that mention the ec program, but it doesn't really tell how to use it. Though it has a very useful warnings. I also wonder if it's that useful to have a complete HOWTO as this tool is only useful for advanced users that know what they are doing or for reuse in other programs/scripts that do the necessary checks. In my case I use it in a userspace program to force the detection of the Thinkpad X200 dock in userspace and also for leds (though here I could also upstream better Linux support for that, but that requires time). > This kind of highly-specific how-to isn't a great package > description. The issue here is that I've been trying to make two different thing fit inside the package description. Since Guix also has experimental support for HURD and that it can also cross compile binaries for Windows through mingw, I think it's a good idea to at least mention the dependencies of that utility. If I use the word "driver" instead of module, to make sure that people do understand that the ec_sys is not an out of tree module, and that I remove the HOWTO part I can shrink it to that: > This utility can read or write specific registers or all the available > registers of the @acronym{EC, Embedded Controller} supported by the > @code{ec_sys} Linux driver.") Denis. --Sig_/VzacTFFvbqcl2X_FR3p30O/ Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAmMWzJQACgkQX138wUF3 4mMuVA//SrypHOmcqoZi+95x+Nw9JI33JB+kcZbw0wnlNZo5tZ4Ijkh2h/qa7mtq KTVEqgqt8EgKPZxxeF8E1Rq7e/DptKvyigxmEMvAUIbmV/YfjJsTrJGOsulCpQFa Qf7MzM3c07O9Z5ZEOt139HyL1+qLpfgq9hb55KL+izdwxKzxrjN2xcbFA1KCzNZ4 UkfAy8zNX+KT3UeGyByYGbWjiWKa2oRDR2G3vCceMIIpOP22oBfQddGekFoaAeR9 YRtL2mHjk0Hp31ZZtvhmFJAN8ZTmrru0c1MV5RIkV+gQs2C5C7dfitYSd8ZBixoq fakx/eyeu1A5ddiPNiOKivMoZeAbZgK3Oai8yhURpuc+2pz4bldtPJgM1MW1Njk5 Z1zdTE/oiU7NuJG+NIT34rTJc+n03Vr6OPfl3wXOVxFyoWJFMz/f0LnD/GETBZlN 6cbmlA0clCj6n6km09nAubbi5VelP31PacCxxExk/5IQEAb9Ps2s3YZYlKElx3gz oyV/BKVwjz38idAIHPJvESwQT/aJT7dnjHIz3fwnTkURnLIijOxFM/vZo9lbxeXo KD1qzdVe6BhKJto9LOtQNwPEVnFiUFUpFRN164pD0OuogtyLelGaDgpv7Mvu28Bf P1EZPAYe4GxbeHhCFyyWtpVJq7o71/8HLuhfBLUUl/FflNXgKw0= =oTvo -----END PGP SIGNATURE----- --Sig_/VzacTFFvbqcl2X_FR3p30O/--