All of lore.kernel.org
 help / color / mirror / Atom feed
* Using memdisk with grub2 and a gzip-compressed ISO
@ 2015-04-23 14:23 David Shaw
  2015-04-23 16:59 ` Andrei Borzenkov
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: David Shaw @ 2015-04-23 14:23 UTC (permalink / raw)
  To: grub-devel, syslinux; +Cc: Andrei Borzenkov

Hello,

Pardon the cross-post to two lists, but this problem seems to lie in a somewhat gray area between grub2 and memdisk.  Basically, the problem is this: it used to be possible to boot a compressed ISO image via memdisk and grub legacy, but this no longer works with grub2.

Here's the setup: Two machines, both with 4GiB of RAM.  The only difference between the two is that one is using grub legacy (0.97) and the other is using grub2 (2.02).  I am using memdisk from syslinux 4.02 (though for completeness I also tried 4.05 and 6.03, with the same results).  The ISO image itself is 3388047 bytes gzip compressed and 9394176 bytes uncompressed.

The grub legacy configuration:

   title boot ISO image
           kernel /memdisk iso
           initrd /my-image.iso.gz

The grub2 configuration:

   menuentry 'boot ISO image' {
     linux16 /memdisk iso
     initrd16 /my-image.iso.gz
   }

If anyone would like to see it, the sample gzip-compressed ISO image is\x01 at http://www.jabberwocky.com/my-image.iso.gz

Now to the problem: When booting the box with grub 0.97, it works.  The ISO boots and the right things happen.  Here's the output from memdisk:

  Ramdisk at 0x37cb4000, length 0x0033b28f
  gzip image: decompressed addr 0xbf5fa800, len 0x008f5800: ok

When booting the box with grub2 2.02, it does not work.  The error is:

  Ramdisk at 0x37979000, length 0x0033b290
  gzip image: decompressed addr 0xbfff7000, len 0x00008f58: failed
  Decompression error: output buffer overrun

I'm not sure if this is related to the problem, but note the length in the "Ramdisk" line from grub legacy is one byte shorter than the length from grub2.  Also note that the length given in the "gzip image" line is shifted one byte to the left in the grub legacy version (i.e. it's exactly 0x100 times larger).

1) I have tried this with memdisk from syslinux 4.02, 4.05, and 6.03 with the same results each time.
2) Changing the level of compression (i.e. gzip -1 instead of gzip -9) does not make a difference.
3) This works fine with an uncompressed image with grub2.  This also works fine with a zip-compressed image with grub2.  It only seems to fail with a gzip-compressed image with grub2.

Andrei Borzenkov kindly analyzed the image and suggested I contact both the syslinux and grub groups as he has a notion of what went wrong.  Andrei, can you fill in anything I missed?

Thanks,

David



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-05-07 14:23 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-23 14:23 Using memdisk with grub2 and a gzip-compressed ISO David Shaw
2015-04-23 16:59 ` Andrei Borzenkov
2015-04-23 22:17 ` [syslinux] " H. Peter Anvin
2015-04-24  3:14   ` Andrei Borzenkov
2015-04-24  3:30     ` H. Peter Anvin
2015-04-24  3:41       ` Andrei Borzenkov
2015-04-24  4:39         ` H. Peter Anvin
2015-04-24  6:25           ` Andrei Borzenkov
2015-04-27 22:20             ` H. Peter Anvin
2015-04-29 13:55               ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-04-29 16:28                 ` Andrei Borzenkov
2015-04-29 17:45 ` Andrei Borzenkov
2015-04-29 18:35   ` Vladimir 'phcoder' Serbinenko
2015-04-30  3:36     ` Andrei Borzenkov
2015-04-29 18:42   ` David Shaw
2015-05-07 14:23   ` Vladimir 'φ-coder/phcoder' Serbinenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.