All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Greg Thelen <gthelen@google.com>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 11/12] initramfs: refactor the initramfs build rules
Date: Sat, 4 Jan 2020 12:35:37 +0900	[thread overview]
Message-ID: <CAK7LNAQXx0RGutdOe4JFLTbjm7=cx9aEKQ-823-irED4SyCmMA@mail.gmail.com> (raw)
In-Reply-To: <20200103195205.GC21515@ravnborg.org>

Hi Sam,

On Sat, Jan 4, 2020 at 4:52 AM Sam Ravnborg <sam@ravnborg.org> wrote:
>
> Hi Mashahiro.
>
> I just browsed this fine patchset and noticed...
> >
> > -#####
> > -# Generate the initramfs cpio archive
> > +ramfs-input := $(shell echo $(CONFIG_INITRAMFS_SOURCE))
> > +cpio-data :=
> > +
> > +ifeq ($(words $(ramfs-input)),0)
> > +
> > +# If CONFIG_INITRAMFS_SOURCE is empty, generate a small initramfs with the
> > +# default contents.
> > +ramfs-input := $(srctree)/$(src)/default_cpio_list
> > +
> > +else ifeq ($(words $(ramfs-input)),1)
> > +# If CONFIG_INITRAMFS_SOURCE specifies a single file, and it is suffixed with
> > +# .cpio or .cpio.*, use it directly as an initramfs.
> > +ifneq ($(filter %.cpio,$(ramfs-input)),)
> > +cpio-data := $(ramfs-input)
> > +endif
>
> This part will now work if the file is named foo.cpio.bar.
> $(findstring .cpio, should be used and not $(filter %.cpio
> At least if the comment describes the intended behaviour.


The 'foo.cpio.bar' is taken care of
by ifeq ($(words $(subst .cpio.,$(space),$(ramfs-input))),2)

I admit the comment was confusing.


I will clarify the comments as follows:



# If CONFIG_INITRAMFS_SOURCE specifies a single file, and it is suffixed with
# .cpio, use it directly as an initramfs.
ifneq ($(filter %.cpio,$(ramfs-input)),)
cpio-data := $(ramfs-input)
endif

# If CONFIG_INITRAMFS_SOURCE specifies a single file, and it is suffixed with
# .cpio.*, use it directly as an initramfs, and avoid double compression.
ifeq ($(words $(subst .cpio.,$(space),$(ramfs-input))),2)
cpio-data := $(ramfs-input)
compress-y := shipped
endif






> > +
> > +ifeq ($(words $(subst .cpio.,$(space),$(ramfs-input))),2)
> > +cpio-data := $(ramfs-input)
> > +# If the specified archive is suffixed with .cpio.* (i.e. already compressed),
> > +# we do not double-compress it.
> > +compress-y := shipped
> > +endif
> > +
> > +endif
>
>
>         Sam










--
Best Regards
Masahiro Yamada

  reply	other threads:[~2020-01-04  3:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03 17:59 [PATCH 00/12] initramfs: a lot of cleanups Masahiro Yamada
2020-01-03 17:59 ` [PATCH 01/12] gen_initramfs_list.sh: remove unused variable 'default_list' Masahiro Yamada
2020-01-03 17:59 ` [PATCH 02/12] gen_initramfs_list.sh: fix the tool name in the comment Masahiro Yamada
2020-01-03 17:59 ` [PATCH 03/12] initramfs: rename gen_initramfs_list.sh to gen_initramfs.sh Masahiro Yamada
2020-01-03 17:59 ` [PATCH 04/12] initramfs: remove redundant dependency on BLK_DEV_INITRD Masahiro Yamada
2020-01-03 17:59 ` [PATCH 05/12] initramfs: make compression options not depend on INITRAMFS_SOURCE Masahiro Yamada
2020-01-03 17:59 ` [PATCH 06/12] initramfs: make initramfs compression choice non-optional Masahiro Yamada
2020-01-03 17:59 ` [PATCH 07/12] initramfs: specify $(src)/gen_initramfs.sh as a prerequisite in Makefile Masahiro Yamada
2020-01-03 17:59 ` [PATCH 08/12] initramfs: generate dependency list and cpio at the same time Masahiro Yamada
2020-01-03 17:59 ` [PATCH 09/12] initramfs: add default_cpio_list, and delete -d option support Masahiro Yamada
2020-01-03 17:59 ` [PATCH 10/12] gen_initramfs.sh: always output cpio even without -o option Masahiro Yamada
2020-01-03 17:59 ` [PATCH 11/12] initramfs: refactor the initramfs build rules Masahiro Yamada
2020-01-03 19:52   ` Sam Ravnborg
2020-01-04  3:35     ` Masahiro Yamada [this message]
2020-01-04 14:16       ` Sam Ravnborg
2020-01-03 17:59 ` [PATCH 12/12] gen_initramfs.sh: remove intermediate cpio_list on errors Masahiro Yamada

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='CAK7LNAQXx0RGutdOe4JFLTbjm7=cx9aEKQ-823-irED4SyCmMA@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=gthelen@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=sam@ravnborg.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.