From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iVC9o-0000N6-3g for mharc-grub-devel@gnu.org; Thu, 14 Nov 2019 05:15:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44946) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iVC9l-0000Mm-NJ for grub-devel@gnu.org; Thu, 14 Nov 2019 05:15:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iVC9k-0003lt-CI for grub-devel@gnu.org; Thu, 14 Nov 2019 05:15:17 -0500 Received: from dibed.net-space.pl ([84.10.22.86]:44273) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.71) (envelope-from ) id 1iVC9j-0003k1-R0 for grub-devel@gnu.org; Thu, 14 Nov 2019 05:15:16 -0500 Received: from router-fw.i.net-space.pl ([192.168.52.1]:39144 "EHLO tomti.i.net-space.pl") by router-fw-old.i.net-space.pl with ESMTP id S1928560AbfKNKPF (ORCPT ); Thu, 14 Nov 2019 11:15:05 +0100 X-Comment: RFC 2476 MSA function at dibed.net-space.pl logged sender identity as: dkiper Date: Thu, 14 Nov 2019 11:15:00 +0100 From: Daniel Kiper To: Patrick Steinhardt Cc: grub-devel@gnu.org, Max Tottenham Subject: Re: [PATCH v3 1/6] json: Import upstream jsmn-1.1.0 Message-ID: <20191114101500.rrcydferfabers6i@tomti.i.net-space.pl> References: <7bd619827efedbf0d633d1d3ed941ee25980078e.1573651222.git.ps@pks.im> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7bd619827efedbf0d633d1d3ed941ee25980078e.1573651222.git.ps@pks.im> User-Agent: NeoMutt/20170113 (1.7.2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 84.10.22.86 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2019 10:15:19 -0000 On Wed, Nov 13, 2019 at 02:22:33PM +0100, Patrick Steinhardt wrote: > The upcoming support for LUKS2 encryption will require a JSON parser to > decode all parameters required for decryption of a drive. As there is > currently no other tool that requires JSON, and as gnulib does not > provide a parser, we need to introduce a new one into the code base. The > backend for the JSON implementation is going to be the jsmn library [1]. > It has several benefits that make it a very good fit for inclusion in > GRUB: > > - It is licensed under MIT. > - It is written in C89. > - It has no dependencies, not even libc. > - It is small with only about 500 lines of code. > - It doesn't do any dynamic memory allocation. > - It is testen on x86, amd64, ARM and AVR. > > The library itself comes as a single header, only, that contains both > declarations and definitions. The exposed interface is kind of > simplistic, though, and does not provide any convenience features > whatsoever. Thus there will be a separate interface provided by GRUB > around this parser that is going to be implemented in the following > commit. This change only imports "jsmn.h" from tag v1.1.0 and adds it > unmodified to a new "json" module with the following command: > > ``` > curl -L https://raw.githubusercontent.com/zserge/jsmn/v1.1.0/jsmn.h \ > -o grub-core/lib/json/jsmn.h > ``` > > Upstream jsmn commit hash: fdcef3ebf886fa210d14956d3c068a653e76a24e > Upstream jsmn commit name: Modernize (#149), 2019-04-20 > > [1]: https://github.com/zserge/jsmn > > Signed-off-by: Patrick Steinhardt Reviewed-by: Daniel Kiper Daniel