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 <[email protected]> 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

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to