From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a2JxZ-0007v0-FD for mharc-grub-devel@gnu.org; Fri, 27 Nov 2015 09:25:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2JxW-0007sL-5p for grub-devel@gnu.org; Fri, 27 Nov 2015 09:25:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2JxR-0008PD-Ro for grub-devel@gnu.org; Fri, 27 Nov 2015 09:25:10 -0500 Received: from mail-yk0-x235.google.com ([2607:f8b0:4002:c07::235]:36068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2JxR-0008Oz-OB for grub-devel@gnu.org; Fri, 27 Nov 2015 09:25:05 -0500 Received: by ykdr82 with SMTP id r82so119144887ykd.3 for ; Fri, 27 Nov 2015 06:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=WXVg5n/U2cCgZxXWshvQB8svMYM5Yp8zJVAwNMUQop0=; b=sbW4nf4PBGLQ0DmqzY0XubTknmI1O3S8m9Gv1IXmJuNrtm4P1I1fJYzU7HXdljhOL4 Yk25atZq1WrrLR1Pk9MD+qnILh4C64rGNmOUd7f0+EDGQuyJzJLXCWny1dtITLFQY+rO bmhDzw7TxXstbEee46ziMP9OlRGq9AJfpjAH8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=WXVg5n/U2cCgZxXWshvQB8svMYM5Yp8zJVAwNMUQop0=; b=gZvn6/+l0RlFKGJa+ViD/uxx0kIDVrmjGGRJHIUcds3GN9M6cRwtOheE7VQnsUxYgi M/Z7hD5Tcb5YStSwtARUcB4fBrXFFWHSgEvmkrHVrpNiaKUfkq12Nrsj81yl13Xrn/Bw eyVDNE/NMtmZE+aPieQK3PSpfyhRnlkKUsssIXLYL+MEHW3Q0m+3Fhf+n8djscSg8ivh Qk4tT8ERZazeUg1/QD1aBlvC0oAHCZMAEIGz40KoK6kPBXcGcPAzdp5CS+r8aAnqO3ey 3RdnIHMxzlMbhrf2LZXKYETUK4DwdY16M7e4tMq5CpIGbtTjjY3hoZ8bsxJgi8Tqzp6o qClw== X-Gm-Message-State: ALoCoQnaLoRCeQ7mdnxFiXzbDfGfNG3y93xTrWsJSKzJ8bQrX3TOTVBE0uj8F52Xz7HQ6uc52CDX MIME-Version: 1.0 X-Received: by 10.129.74.6 with SMTP id x6mr38531448ywa.46.1448634305084; Fri, 27 Nov 2015 06:25:05 -0800 (PST) Received: by 10.129.27.14 with HTTP; Fri, 27 Nov 2015 06:25:04 -0800 (PST) In-Reply-To: <56586384.1030504@gmail.com> References: <563999B9.7020108@gmail.com> <5643845E.9060204@gmail.com> <5646B275.5040707@gmail.com> <56586384.1030504@gmail.com> Date: Fri, 27 Nov 2015 14:25:04 +0000 Message-ID: Subject: Re: Grub get and set efi variables From: Ignat Korchagin To: The development of GNU GRUB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::235 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:25:11 -0000 > I would add: > * hex. To print and store in hex form > * utf16. Decode utf16 into utf8. utf16 is a common encoding in EFI land. hex is already part of the latest proposed patch: >> + case EFI_VAR_HEX: I'm not sure whether utf16 will be useful, as all standard UEFI variables now are using ASCII for string data. On Fri, Nov 27, 2015 at 2:07 PM, Vladimir '=CF=86-coder/phcoder' Serbinenko wrote: > 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 interpret >>>> 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. >>> >> >> What about >> >> - ascii - print ASCII characters verbatim, escape non-ASCII in usual >> way (similar to "od -c") >> >> - raw - simply put raw variable without any interpretation. >> > 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 rather >> than attempting to "type" variable. >> >> Alternative (or in addition to) ascii - dump which prints usual pretty >> hex dump of content (hexdump -C). This is handy to interactively look at >> variable content. >> >> Or, and change name from --type to --format :) >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> https://lists.gnu.org/mailman/listinfo/grub-devel > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >