From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZxS3T-00084s-7s for mharc-grub-devel@gnu.org; Fri, 13 Nov 2015 23:03:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxS3R-00084m-Gw for grub-devel@gnu.org; Fri, 13 Nov 2015 23:03:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxS3M-0008OB-DH for grub-devel@gnu.org; Fri, 13 Nov 2015 23:03:09 -0500 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:36562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxS3M-0008O7-6D for grub-devel@gnu.org; Fri, 13 Nov 2015 23:03:04 -0500 Received: by lfs39 with SMTP id 39so62714549lfs.3 for ; Fri, 13 Nov 2015 20:03:03 -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:content-transfer-encoding; bh=0thehxmpcVZD3o8qX0y50noAmfo2Ci+tx18FOxtWT8A=; b=yiPKmyp/pod6G0LVlCTwxq7DzX6cZ8JbEMGplB0DfJfC0ehREw6sAygdj9Dqxjasxh euigXc6kL+c72X5rowvsFCV+RR+uFIuGD4uXPh4g62pQKyXPknXwmwWRb1gHwIrkoAX+ rhMEAA4gcf0WCHAhR7DErF00BOPnGNtoZGSzTOKZcReKhgFkzHN4ocg/6yhYmUI9ixSf +qgIHH8gdAwWyEdrRf5XX94XF+gO/x812THh+Vq/PGUo8A5W/7Gn4ze/gQTpOQBxDUZz CP5Zz+hO4KxaPb9ix0ZEzYWjS1BgIMvfjHJkgxs8jmyLcm3QxOiL0eBVSTyOdbJSgmaZ Ll7g== X-Received: by 10.25.38.2 with SMTP id m2mr9724818lfm.113.1447473783255; Fri, 13 Nov 2015 20:03:03 -0800 (PST) Received: from [192.168.1.41] (ppp91-76-25-247.pppoe.mtu-net.ru. [91.76.25.247]) by smtp.gmail.com with ESMTPSA id gg8sm3632792lbc.17.2015.11.13.20.03.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Nov 2015 20:03:02 -0800 (PST) Subject: Re: Grub get and set efi variables To: grub-devel@gnu.org References: <563999B9.7020108@gmail.com> <5643845E.9060204@gmail.com> From: Andrei Borzenkov Message-ID: <5646B275.5040707@gmail.com> Date: Sat, 14 Nov 2015 07:03:01 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c07::234 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: Sat, 14 Nov 2015 04:03:10 -0000 13.11.2015 22:42, Ignat Korchagin пишет: >>>> +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. 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 :)