From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a2JgD-0002Cr-3w for mharc-grub-devel@gnu.org; Fri, 27 Nov 2015 09:07:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2Jg7-00025I-4x for grub-devel@gnu.org; Fri, 27 Nov 2015 09:07:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2Jg5-0004gB-OZ for grub-devel@gnu.org; Fri, 27 Nov 2015 09:07:11 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2Jg5-0004fw-Hs for grub-devel@gnu.org; Fri, 27 Nov 2015 09:07:09 -0500 Received: by wmuu63 with SMTP id u63so56902175wmu.0 for ; Fri, 27 Nov 2015 06:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=Er13rmbdnQ1VHjgNSQkbUsyEDMLR5yKRExfVJwh5Waw=; b=PsclHdeH3vqSFfpgYR7Dat38w3gSaUpnmWOaXWouOs3uzCGkDi91Nb2SqhrT1RdGtu +2KV2nKgk4/REaqaInv0ckNBsDTdpGu2bLfFM64eGq/UvNeuQh46sbFs0bF51vIw3+uv wsb7ca59u54tWGGT6wwR/10V/qTTwNJ2V6l6VZjQpWMjGwAIbkBRq6Wa8lLjtGi6JXvh D4ZjFQlZmCGt124lUEv5lc93RU5tAlSscR86TzshKkBUF/HNlVGjGc09exGthvR25Xpx cc7wDqo4xJrp/Hi5xU1Chwk74qE/upSK4eXeq9xcHC+i3dPmAStCIOmAhxd6tY6OajpX 5nIA== X-Received: by 10.194.117.163 with SMTP id kf3mr44281163wjb.139.1448633228685; Fri, 27 Nov 2015 06:07:08 -0800 (PST) Received: from ?IPv6:2620:0:105f:fd00:a2a8:cdff:fe64:b3b5? ([2620:0:105f:fd00:a2a8:cdff:fe64:b3b5]) by smtp.gmail.com with ESMTPSA id pc2sm32957040wjb.11.2015.11.27.06.07.07 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Nov 2015 06:07:07 -0800 (PST) Subject: Re: Grub get and set efi variables To: The development of GNU GRUB References: <563999B9.7020108@gmail.com> <5643845E.9060204@gmail.com> <5646B275.5040707@gmail.com> From: =?UTF-8?Q?Vladimir_'=cf=86-coder/phcoder'_Serbinenko?= Message-ID: <56586384.1030504@gmail.com> Date: Fri, 27 Nov 2015 15:07:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 MIME-Version: 1.0 In-Reply-To: <5646B275.5040707@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8cKOOTMc3JckqtIHkoNhMbtxg0OU1Klg4" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c09::22e X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 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: Fri, 27 Nov 2015 14:07:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8cKOOTMc3JckqtIHkoNhMbtxg0OU1Klg4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 14.11.2015 05:03, Andrei Borzenkov wrote: > 13.11.2015 22:42, Ignat Korchagin =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>>> +static enum efi_var_type >>>>> +parse_efi_var_type (const char *type) >>>>> +{ >>>>> + if (!grub_strncmp (type, "string", sizeof("string"))) >>>>> + return EFI_VAR_STRING; >>>>> + >>>> >>>> >>>> I think this should be "ascii" or "utf8". "string" is too ambiguous >>>> in UEFI >>>> environment, it can also mean sequence of UCS-2 characters. >>> I'm still not sure how exactly GRUB + UEFI interprets "raw buffers" >>> when printing. Maybe, to avoid confusion, it might be better to >>> completely remove this option. Basically, you do not want to interpre= t >>> raw buffers as strings. For best compatibility "hex" mode should be >>> promoted, I guess. What do you think? >> Checked again the UEFI spec. For globally defined variables which are >> strings they specify ASCII. So if we leave this option, ascii is the >> best name. >> >=20 > What about >=20 > - ascii - print ASCII characters verbatim, escape non-ASCII in usual > way (similar to "od -c") >=20 > - raw - simply put raw variable without any interpretation. >=20 I would add: * hex. To print and store in hex form * utf16. Decode utf16 into utf8. utf16 is a common encoding in EFI land. I would also skip on raw, at least until we have a real need for it as we currently are not equiped to handle raw strings in variable contents, including but not limited to \0 being considered a terminator > This is better aligned with argument describing output formatting rathe= r > than attempting to "type" variable. >=20 > Alternative (or in addition to) ascii - dump which prints usual pretty > hex dump of content (hexdump -C). This is handy to interactively look a= t > variable content. >=20 > Or, and change name from --type to --format :) >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel --8cKOOTMc3JckqtIHkoNhMbtxg0OU1Klg4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlZYY4QACgkQmBXlbbo5nOvf6gD+KrMI5//UeEY1OdT1ZjwTkvjR wq1tzHb+8gsn+2DBxMkA/RF78G9XrO5MIu/kbTa0kISclYqfZ+fNmtT14C+zPABk =kvi2 -----END PGP SIGNATURE----- --8cKOOTMc3JckqtIHkoNhMbtxg0OU1Klg4--