[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using compressed memdisk
From: |
Glenn Washburn |
Subject: |
Re: Using compressed memdisk |
Date: |
Sat, 31 Aug 2013 01:06:17 -0500 |
On Sat, 31 Aug 2013 09:24:43 +0400
Andrey Borzenkov <address@hidden> wrote:
> В Wed, 28 Aug 2013 19:43:08 -0500
> Glenn Washburn <address@hidden> пишет:
>
> > Hola,
> >
> > I'm trying to get grub to read an xz-compressed memdisk, but grub
> > does not automatically decode it. Apparently there is a
> > transparent file decompressor for xz, but that won't work on
> > devices.
> >
> > What would be a better way to implement this: some sort of device
> > filter, or something specific to mkimage that compresses the memdisk
> > when -C is used?
> >
>
> Filter would need decompress the whole device every time single bit is
> accessed (or implement intricate caching) so it makes really no sense.
>
> Is it possible to reliably detect compressed memdisk? If yes, just add
> detection to memdisk.c.
Thanks for the reply Andrey. I've done quite a bit more research on
this and burying my head in the grub code, since I posted this.
You're right that a filter is a pretty bad idea. I verified this
experimentally by having a compressed memdisk as a file inside an
uncompressed on. So I could use loopback to make the file a device and
have the transparent file decompression work. Its insanely slow,
because as you pointed out every access a read has to start from the
beginning of the device each time.
I finally realized that what I wanted didn't even matter because
(whether you want it or not) the memdisk is compressed on i386-pc if
grub is compiled with lzma support. So it was already compressed.
However, that is a special case, and I'd like to also have the
x86_64-efi memdisk compressed (which is currently not possible to do).
This is a known problem[1]. I'll have to use the work around for now
of compressing the files individually.
[1]
https://savannah.gnu.org/bugs/?func=detailitem&item_id=36770#discussion