lkml.org 
[lkml]   [2020]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 11/12] initramfs: refactor the initramfs build rules
Hi Masahiro.

> > > +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)
Clever, I only now realized how this worked.
>
> 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

Looks good.

Sam

\
 
 \ /
  Last update: 2020-01-04 15:17    [W:0.061 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site