From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NZunV-0006DN-7p for mharc-grub-devel@gnu.org; Tue, 26 Jan 2010 18:26:13 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZunT-0006CI-3R for grub-devel@gnu.org; Tue, 26 Jan 2010 18:26:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZunO-0006A1-4P for grub-devel@gnu.org; Tue, 26 Jan 2010 18:26:10 -0500 Received: from [199.232.76.173] (port=60247 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZunN-00069s-TF for grub-devel@gnu.org; Tue, 26 Jan 2010 18:26:05 -0500 Received: from mail-bw0-f215.google.com ([209.85.218.215]:45992) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NZunN-0000v7-He for grub-devel@gnu.org; Tue, 26 Jan 2010 18:26:05 -0500 Received: by bwz7 with SMTP id 7so1979233bwz.26 for ; Tue, 26 Jan 2010 15:26:04 -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=Uiq4WbPfoiIFizuin+8gmSONU8xIYbd8nkstOwJWIkw=; b=rU42S/MVB11rRIQwXJiTmqskhAO6rjHNQm/MapTHmOc3U/gT4XMhog71DcxZpbtmYT lN9DyHYX9u5AbhvSyCR8NSzQ7oYxwVo1i5nBCVQkeqU+dlcb0bzWhyD+xxRrXEwzMeRx RbigA8t4AqV9jZC+7WNDdVFQPOV8RHas9Jjz0= 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=vQVc1UGE4E4fFOH8+z4y2bAJUeNysrj1otD8CrgJTuqFf8zExEMxkuPOQGGzNVy4jn tWERtBF8XjDSUDTVIejIVSOOa9ETr1XQWfmBDJdVAuSEb2CEg3Kawihja+9wjM1W/Q5n rRLGamSaADIZrbuzZOgT+YAdkb4ul51YnSrk8= Received: by 10.204.154.216 with SMTP id p24mr2441923bkw.16.1264548363924; Tue, 26 Jan 2010 15:26:03 -0800 (PST) Received: from debian.bg45.phnet (gprs23.swisscom-mobile.ch [193.247.250.23]) by mx.google.com with ESMTPS id 13sm2893177bwz.10.2010.01.26.15.26.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 26 Jan 2010 15:26:02 -0800 (PST) Message-ID: <4B5F7A02.2020206@gmail.com> Date: Wed, 27 Jan 2010 00:25:54 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) MIME-Version: 1.0 To: The development of GNU GRUB References: <201001262355.55728.szymon@janc.net.pl> In-Reply-To: <201001262355.55728.szymon@janc.net.pl> X-Enigmail-Version: 0.95.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigCFE59F0E3D9C0B625A08EB91" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] support for xz compression format 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: Tue, 26 Jan 2010 23:26:11 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigCFE59F0E3D9C0B625A08EB91 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Szymon Janc wrote: > Hello, > > Attached patch adds support for xz compressed files. Interface is simil= ar to=20 > gzio: grub_xzio_open() and grub_xzfile_open(). Files: xzio.h and xzio.c= > > Decompression algorithm is imported (no source code changes) from=20 > http://tukaani.org/xz/embedded.html and is located in lib/xzembed direc= tory > (files xz_* except xz_wrap.h which is a glue header) > > XZ embedded supports only crc32 integration check so if You want to tes= t it > use `xz --check=3Dcrc32` to compress, It also supports BCJ filters (n= ot enabled=20 > with this patch) so it is possible to get extra few % compression ratio= with=20 > executables. > =20 How does xz with and without BCJ performs for i386 code? Perhaps we would want to replace lzma with xz for core.img compression. > known issues: > - decoder dictionary size is hardcoded, discovery at runtime would be b= etter > (it's on my TODO list) > =20 Can't grub_realloc be used for this? > - grub_file_seek() will break reading (not a big deal, xz streams are n= ot > seekable afterall, if needed should be possible to implement but will = cause=20 > read performance penatly) > =20 I see no reason to have xzembed.mod separate from xzio.mod. It should be all in xzio.mod and use common.rmk and not xzembed.rmk. + static grub_uint8_t inbuf[XZBUFSIZ]; + static grub_uint8_t outbuf[XZBUFSIZ]; Will break if 2 files are opened in the same time. + grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory"); No need for this (already done by grub_malloc) + if (transparent) + return io; + else + return 0; You need to discard or pass any pending errors + grub_free (xzio); + file->device =3D 0; + Why do you set device to 0? --- grub2-1.98~experimental.20100120/lib/xzembed/xz_crc32.c =20 2010-01-20 21:42 :33.000000000 +0100 We already have 2 CRC32 implementations: one in libgcrypt import and one in crc32.mod. This code duplication is undesirable. I have plans to remove crc32.mod in favor of libgcrypt implementation. Can you make xz use libgcrypt import too? + #include I think gnulib-wrap has to be splitted into gnulib-wrap and posix-wrap + #define uint8_t grub_uint8_t + #define uint16_t grub_uint16_t + #define uint32_t grub_uint32_t + #define uint64_t grub_uint64_t typedef is more appropriate > > Suggestions and comments are welcome :-) > > > =20 > -----------------------------------------------------------------------= - > > _______________________________________________ > 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 --------------enigCFE59F0E3D9C0B625A08EB91 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 iF4EAREKAAYFAktfeggACgkQNak7dOguQgmOUgD/XDygZKf6H2je1dlPgZPHu5i3 eCRpfIxAcYUNJ4uUv6cBAJrGhynmvLsOFRtx/Co4itP2hk534OovGsFBqS+bGaPQ =c007 -----END PGP SIGNATURE----- --------------enigCFE59F0E3D9C0B625A08EB91--