grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [syslinux] Using memdisk with grub2 and a gzip-compressed ISO


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [syslinux] Using memdisk with grub2 and a gzip-compressed ISO
Date: Wed, 29 Apr 2015 15:55:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.6.0

On 28.04.2015 00:20, H. Peter Anvin wrote:
> On 04/23/2015 11:25 PM, Andrei Borzenkov via Syslinux wrote:
>> On Fri, Apr 24, 2015 at 7:39 AM, H. Peter Anvin <address@hidden> wrote:
>>> On 04/23/2015 08:41 PM, Andrei Borzenkov wrote:
>>>>
>>>> CRC+length (in case of gzip) are located immediately after compressed
>>>> stream. After stream is decompressed you get location where it ends and
>>>> automatically where length is located.
>>>>
>>>
>>> I know.  One could decompress it twice,
>>
>> Cannot you incrementally reallocate uncompressed buffer?
>>
> 
> That is very hard because of how memory is managed in MEMDISK.
> 
It's fine to skip padding if only one file is supplied on command line.
What about:
diff --git a/grub-core/loader/linux.c b/grub-core/loader/linux.c
index 117232f..a63a11a 100644
--- a/grub-core/loader/linux.c
+++ b/grub-core/loader/linux.c
@@ -205,7 +205,8 @@ grub_initrd_init (int argc, char *argv[],
       initrd_ctx->nfiles++;
       initrd_ctx->components[i].size
        = grub_file_size (initrd_ctx->components[i].file);
-      initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4);
+      if (argc != 1)
+       initrd_ctx->size += ALIGN_UP (initrd_ctx->components[i].size, 4);
     }

   if (newc)


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]