All of lore.kernel.org
 help / color / mirror / Atom feed
* confused about use of "INITRD_COMPRESS" lines in top-level Makefile
@ 2016-06-20 12:01 Robert P. J. Day
  2016-06-22 16:28 ` Ghitulete Razvan
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2016-06-20 12:01 UTC (permalink / raw)
  To: kernelnewbies


  currently poring over the initramfs code, and i'm a bit curious
about the following.

  in usr/Kconfig, all the possible compression protocols can be
selected, and by default are:

config RD_GZIP
        bool "Support initial ramdisks compressed using gzip"
        default y
        select DECOMPRESS_GZIP
        help
          Support loading of a gzip-encoded initial ramdisk or cpio buffer.
          If unsure, say Y.

config RD_BZIP2
        bool "Support initial ramdisks compressed using bzip2"
        default y
        select DECOMPRESS_BZIP2
        help
          Support loading of a bzip2-encoded initial ramdisk or cpio buffer.
          If unsure, say N.

... etc etc ...

but in the top-level Makefile, here are the lines that ostensibly
select which compression to actually use:

  # Select initial ramdisk compression format, default is gzip(1).
  # This shall be used by the dracut(8) tool while creating an initramfs image.
  #
  INITRD_COMPRESS-y                  := gzip
  INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2
  INITRD_COMPRESS-$(CONFIG_RD_LZMA)  := lzma
  INITRD_COMPRESS-$(CONFIG_RD_XZ)    := xz
  INITRD_COMPRESS-$(CONFIG_RD_LZO)   := lzo
  INITRD_COMPRESS-$(CONFIG_RD_LZ4)   := lz4
  # do not export INITRD_COMPRESS, since we didn't actually
  # choose a sane default compression above.
  # export INITRD_COMPRESS := $(INITRD_COMPRESS-y)

so as i read this, the single compression protocol selected will be
the last one configured in that list, but where is that variable
eventually used? where is the build code or utility that examines the
value eventually set and invokes dracut, as the comment suggests?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

* confused about use of "INITRD_COMPRESS" lines in top-level Makefile
  2016-06-20 12:01 confused about use of "INITRD_COMPRESS" lines in top-level Makefile Robert P. J. Day
@ 2016-06-22 16:28 ` Ghitulete Razvan
  0 siblings, 0 replies; 2+ messages in thread
From: Ghitulete Razvan @ 2016-06-22 16:28 UTC (permalink / raw)
  To: kernelnewbies

If you look at the commit introducing that code you can see that it is
meant to actually replace what was a series of if-else if-.... code.
As such, the patch that introduced that snipped did not alter previous
behavior in any way and that is intended behavior.

The reason that is actually the right behavior to start with, is
because you can obviously only have one compression scheme for the
same initrd (obvious reasons, I guess). As such if you select multiple
configuration options, the build system will pick the one it considers
best.

On Mon, Jun 20, 2016 at 2:01 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
>   currently poring over the initramfs code, and i'm a bit curious
> about the following.
>
>   in usr/Kconfig, all the possible compression protocols can be
> selected, and by default are:
>
> config RD_GZIP
>         bool "Support initial ramdisks compressed using gzip"
>         default y
>         select DECOMPRESS_GZIP
>         help
>           Support loading of a gzip-encoded initial ramdisk or cpio buffer.
>           If unsure, say Y.
>
> config RD_BZIP2
>         bool "Support initial ramdisks compressed using bzip2"
>         default y
>         select DECOMPRESS_BZIP2
>         help
>           Support loading of a bzip2-encoded initial ramdisk or cpio buffer.
>           If unsure, say N.
>
> ... etc etc ...
>
> but in the top-level Makefile, here are the lines that ostensibly
> select which compression to actually use:
>
>   # Select initial ramdisk compression format, default is gzip(1).
>   # This shall be used by the dracut(8) tool while creating an initramfs image.
>   #
>   INITRD_COMPRESS-y                  := gzip
>   INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2
>   INITRD_COMPRESS-$(CONFIG_RD_LZMA)  := lzma
>   INITRD_COMPRESS-$(CONFIG_RD_XZ)    := xz
>   INITRD_COMPRESS-$(CONFIG_RD_LZO)   := lzo
>   INITRD_COMPRESS-$(CONFIG_RD_LZ4)   := lz4
>   # do not export INITRD_COMPRESS, since we didn't actually
>   # choose a sane default compression above.
>   # export INITRD_COMPRESS := $(INITRD_COMPRESS-y)
>
> so as i read this, the single compression protocol selected will be
> the last one configured in that list, but where is that variable
> eventually used? where is the build code or utility that examines the
> value eventually set and invokes dracut, as the comment suggests?
>
> rday
>
> --
>
> ========================================================================
> Robert P. J. Day                                 Ottawa, Ontario, CANADA
>                         http://crashcourse.ca
>
> Twitter:                                       http://twitter.com/rpjday
> LinkedIn:                               http://ca.linkedin.com/in/rpjday
> ========================================================================
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
Sincerely,
Razvan Ghitulete

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

end of thread, other threads:[~2016-06-22 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-20 12:01 confused about use of "INITRD_COMPRESS" lines in top-level Makefile Robert P. J. Day
2016-06-22 16:28 ` Ghitulete Razvan

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.