From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1PJ2j7-0002RK-J9 for mharc-grub-devel@gnu.org; Thu, 18 Nov 2010 06:32:29 -0500 Received: from [140.186.70.92] (port=41804 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJ2j3-0002Pe-Sb for grub-devel@gnu.org; Thu, 18 Nov 2010 06:32:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJ2j2-000822-C5 for grub-devel@gnu.org; Thu, 18 Nov 2010 06:32:25 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:62658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJ2j2-00081i-28 for grub-devel@gnu.org; Thu, 18 Nov 2010 06:32:24 -0500 Received: by eydd26 with SMTP id d26so1843010eyd.0 for ; Thu, 18 Nov 2010 03:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=DWnez7GKy1zUThdKwzJAXuH3ZHJRhJIK5gF0G7HPfO0=; b=wx9WAfvOuAM2jOrodXPeslQuzJkZqKKDd1VrmsgE/bIugZ0sd7hMSiaUQh0LQoKtwN nKc1y6fhjcwrG3TdgwGaiCDtV9ROhmA5zkzi5OpyfKsLIuwxZkBfiUJExh8UqRi0LxCu QITXpNlpYpf+ifONn0TmbVupRw38iwJ7AIeKo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=v6l3jawBL8PMB5W5ZsJaKcpb5A+KSxLu/sfjR22im2/22JE2HX+nunAABC4NOfb5VG 0Um4LI5Y42A0YxqD+Y+zreWc1lGI/2lbJ2haQvQitfkcO8N/sP90AxpgrD8Ip0D6I9CU 0MqzrvKxJ+uvWz0e7+NF7hznGHVWZCcA/Zfxc= Received: by 10.213.33.139 with SMTP id h11mr3506129ebd.77.1290079942429; Thu, 18 Nov 2010 03:32:22 -0800 (PST) Received: from debian.bg45.phnet (158-110.62-81.cust.bluewin.ch [81.62.110.158]) by mx.google.com with ESMTPS id b52sm305382eei.19.2010.11.18.03.32.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Nov 2010 03:32:20 -0800 (PST) Message-ID: <4CE50EC4.3020705@gmail.com> Date: Thu, 18 Nov 2010 12:32:20 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: grub-devel@gnu.org References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigCACA033097F0D1193FFB1810" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: RFC: Plan for new "hwmatch" command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Nov 2010 11:32:27 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCACA033097F0D1193FFB1810 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/18/2010 05:58 AM, Evan Broder wrote: > Hi - > Based on some off-list discussion, I'd like to try a different > angle for the Lua patches I submitted a week or two ago. For context, > Ubuntu is interested in setting gfxpayload=3Dkeep as often as we can in= > the next release [1]. Since gfxpayload=3Dkeep doesn't work with all > hardware/driver combinations, we need a way to selectively turn it on, > based on a whitelist or blacklist. > > For my first crack at this [2], I used Lua scripting for comparing > current hardware against the whitelist/blacklist. However, I've gotten > feedback that a solution without Lua would be better. Whatever I do, > I'd like it to be with upstream's approval, and ideally adoption, so I > want to have a discussion about interfaces before I start coding. > > I'm intentionally opening myself up to bikeshedding, but I'm > interested in people's opinions on the format of the > blacklist/whitelist file. I'm also interested in if this is generic > enough to be a reasonable addition to the GRUB core. And of course I'm > interested to know if people think I'm going about this all wrong. > > As a strawman, I propose adding the "hwmatch" command: > > Usage: hwmatch MATCHLIST [BASECLASS] > > MATCHLIST is a file containing a list of hardware identifiers. > BASECLASS is a PCI base class code. If specified, only PCI devices > with that base class will be checked. hwmatch returns 0 if any PCI > device in the system is listed in MATCHLIST, and 1 otherwise. > > MATCHLIST has one device per line with the following space-separated > fields: base class, subclass, vendor ID, device ID, subsystem vendor > ID, subsystem device ID. The first two fields are 2 hex digits; the > other fields are 4 hex digits. Any field can be replaced by a single > '*' to indicate a wildcard. > =20 This has a problem of multiple matches in both white and black list. To disambigute such thing you would need some logic. Also having a command dedicated to this seems ad-hoc. I think something more along the lines of extending scripting is better. So you'd have something like: iterate_pci { classid=3D$1 vendorid=3D$2 deviceid=3D$3 if [ x$classid !=3D x ]; then continue fi case x$vendorid ) .... ;; ) .... ;; esac } I'd recommend to have this code in a separate hwconfig.cfg for convenienc= e. We already have the necessary infrastructure to implement iterate_pci without touching the scripting code. "continue" though will need a bit of extension to work in iterate_pci. "case" isn't implemented yet but we already have pattern matching, the main issue is the arrival of new terminal ";;" and proper handling of it. Some logic with && and || would come in handy too. > Thanks in advance, > - Evan > > [1] https://blueprints.launchpad.net/ubuntu/+spec/packageselection-foun= dations-n-grub2-boot-framebuffer > [2] https://code.launchpad.net/~broder/+junk/grub2-extras-lua-enum-pci > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > > =20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enigCACA033097F0D1193FFB1810 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAkzlDsQACgkQNak7dOguQgkHYwD+OCr+xNFdSTVxpV8EV+RKnUqN 8bVHiaT0Z3blsePakq0A/R67jHWaTqgw6/JKSNGTkxXnTd4kClT6Y8kKh2JI4oyR =BZja -----END PGP SIGNATURE----- --------------enigCACA033097F0D1193FFB1810--