Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K8QXZ-0006MH-Gr for mharc-grub-devel@gnu.org; Mon, 16 Jun 2008 22:03:21 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K8QXY-0006KQ-4U for grub-devel@gnu.org; Mon, 16 Jun 2008 22:03:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K8QXX-0006Jc-LO for grub-devel@gnu.org; Mon, 16 Jun 2008 22:03:19 -0400 Received: from [199.232.76.173] (port=41723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K8QXX-0006JV-IO for grub-devel@gnu.org; Mon, 16 Jun 2008 22:03:19 -0400 Received: from ag-out-0708.google.com ([72.14.246.242]:22790) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K8QXX-0000lG-6X for grub-devel@gnu.org; Mon, 16 Jun 2008 22:03:19 -0400 Received: by ag-out-0708.google.com with SMTP id 31so26922agc.10 for ; Mon, 16 Jun 2008 19:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Uqkn0lGTrmNUpHUWL4RaR1ekgwZi4oEno+i4bzdyf3E=; b=sbEBOrJosvE7fkrjg/iuhGTthftZ9D0SmlQj9bUBDW6TByxkpmpZSczof/N1nHHJNI 0wZ+solkVv3xMZZaBTrKZQzN6nJvgPnpRsPtwoU7Yu8IDjdKXZeBGNVKjoCvUozVyhjU lS9YgPk7UgaoBNJD1w6eAzCGodOU80cmLoBqk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=FonCKRxPeP0IZiVIbEWCjQ1sUf15aYKh9qvDl1ztIbpJtGL21Dxw72lS4lI5iEG+Xp p++Yg5WiFvbBHfFCbGk65Ur4mS/hgQBAr/ge310OD2bFRRGLzBuACg5I9QoTfxgHF0vB 63BZB9x4A9FsvMoa9MaTARnUOSXEYY4bk3GMw= Received: by 10.110.70.5 with SMTP id s5mr4925801tia.21.1213668195428; Mon, 16 Jun 2008 19:03:15 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Mon, 16 Jun 2008 19:03:15 -0700 (PDT) Message-ID: Date: Tue, 17 Jun 2008 10:03:15 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080616213116.GC6108@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080615174819.GA3506@thorin> <1213576320.12833.3.camel@dv> <20080616091535.GA17206@thorin> <1213615227.6330.3.camel@localhost> <1213618146.6330.6.camel@localhost> <20080616213116.GC6108@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [RFC] split floppy support off biosdisk X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2008 02:03:20 -0000 On Tue, Jun 17, 2008 at 5:31 AM, Robert Millan wrote: > On Mon, Jun 16, 2008 at 08:37:43PM +0800, Bean wrote: >> >> But do we really need those space ? > > The typical use case where space is a PITA is boot an LVM system without a > separate /boot partition. There we don't have the ressort of using a > blocklist (which is already bad), so embedding core.img is mandatory, but > at the same time, we have to load lvm.mod in (possibly raid.mod as well), > and then you see where I'm going... > > For example, with current CVS: > > $ ./grub-mkimage -d . biosdisk pc ext2 lvm -o /tmp/core.img && du -b /tmp/core.img > 30511 /tmp/core.img > > $ ./grub-mkimage -d . biosdisk pc ext2 lvm raid -o /tmp/core.img && du -b /tmp/core.img > 32940 /tmp/core.img > > The first is close to the limit (32256 B) and the second surpasses it, so > boot from LVM on RAID with DOS label and ext2 is a use case we can't support > right now. I run some tests on the your situation: Current CVS: /grub-mkimage -d . biosdisk pc ext2 lvm raid -o c1.img && du -b c1.img 32735 c1.img Then I comment out the lzo compression in grub-mkimage with this patch: diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 189ec4e..cb069ec 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -59,9 +59,11 @@ compress_kernel (char *kernel_img, size_t kernel_size, *core_img = xmalloc (kernel_size + kernel_size / 64 + 16 + 3); wrkmem = xmalloc (LZO1X_999_MEM_COMPRESS); - memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE); + //memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE); + memcpy (*core_img, kernel_img, kernel_size); grub_util_info ("compressing the core image"); +/* if (lzo1x_999_compress ((const lzo_byte *) (kernel_img + GRUB_KERNEL_MACHINE_RAW_SIZE), kernel_size - GRUB_KERNEL_MACHINE_RAW_SIZE, @@ -70,10 +72,12 @@ compress_kernel (char *kernel_img, size_t kernel_size, &size, wrkmem) != LZO_E_OK) grub_util_error ("cannot compress the kernel image"); - +*/ free (wrkmem); - *core_size = (size_t) size + GRUB_KERNEL_MACHINE_RAW_SIZE; + //*core_size = (size_t) size + GRUB_KERNEL_MACHINE_RAW_SIZE; + + *core_size = kernel_size; } static void /grub-mkimage -d . biosdisk pc ext2 lvm raid -o c2.img && du -b c2.img 55572 c2.img Finally, I use lzma to compress it: lzma c2.img && du -b c2.img.lzma 26737 c2.img.lzma The decompresser is about 2K, we should also exclude the uncompressed part at the beginning of kernel, but there is still plenty room left. > >> I think lzo is working fine, we >> should avoid switching unless there is a good reason to do so. > > ISTR Okuji didn't like it; can't remember why. He is concerned about compression ratio, but doesn't mind in the end: http://lists.gnu.org/archive/html/grub-devel/2007-12/msg00120.html -- Bean