confused about use of "INITRD_COMPRESS" lines in top-level Makefile

Robert P. J. Day rpjday at crashcourse.ca
Mon Jun 20 08:01:12 EDT 2016


  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
========================================================================




More information about the Kernelnewbies mailing list