All of lore.kernel.org
 help / color / mirror / Atom feed
From: razvan.ghitulete@gmail.com (Ghitulete Razvan)
To: kernelnewbies@lists.kernelnewbies.org
Subject: confused about use of "INITRD_COMPRESS" lines in top-level Makefile
Date: Wed, 22 Jun 2016 18:28:20 +0200	[thread overview]
Message-ID: <CAMHygWLAeHbEVEQ-eWwiWQ7P79_7hrd+k1Qtz45-csGON5h+3Q@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1606200741270.17104@localhost.localdomain>

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

      reply	other threads:[~2016-06-22 16:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMHygWLAeHbEVEQ-eWwiWQ7P79_7hrd+k1Qtz45-csGON5h+3Q@mail.gmail.com \
    --to=razvan.ghitulete@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.