Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/9 v2] fs/initramfs: cleanup and enhance comments
Date: Mon, 28 Mar 2016 23:36:54 +0200	[thread overview]
Message-ID: <20160328213654.GE3608@free.fr> (raw)
In-Reply-To: <56F9727C.2050703@gmail.com>

Romain, All,

On 2016-03-28 20:05 +0200, Romain Naour spake thusly:
> Le 11/03/2016 19:41, Yann E. MORIN a ?crit :
> > rootfs-initramfs is not using the generic fs infrastructure, because
> > there is virtually nothing to do to build the initramfs image: there is
> > no actual image to be built to begin with.
> > 
> > The only purpose of rootfs-initramfs is to ensure the rootfs.cpio image
> > is built and then that the Linux kernel is rebuilt with that rootfs.cpio
> > as initramfs source.
> > 
> > Using variables of the fs infra like if it were used is misleading. It
> > looked nice as long as there was the possibility that rootfs-initramfs
> > would one day use the fs infra. But there's no way that will happen any
> > time soon.
> > 
> > Furthermore, the linux' rule linux-rebuild-with-initramfs now already
> > depends on rootfs-cpio by itself, so we need not duplicate this
> > dependency in rootfs-initramfs.
> > LINUX_DIR
> > Still, we want to advertise that the dependency is on rootfs-cpio, so
> > we get nice dependency graphs (and not expose the internal
> > linux-rebuild-with-initramfs rule to the users).
> > 
> > So, remove the variables and directly define the rules.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > ---
> >  fs/initramfs/initramfs.mk | 22 +++++++++++++++-------
> >  1 file changed, 15 insertions(+), 7 deletions(-)
> > 
> > diff --git a/fs/initramfs/initramfs.mk b/fs/initramfs/initramfs.mk
> > index db50812..9aca9c8 100644
> > --- a/fs/initramfs/initramfs.mk
> > +++ b/fs/initramfs/initramfs.mk
> > @@ -5,17 +5,25 @@
> >  #
> >  ################################################################################
> >  
> > -ROOTFS_INITRAMFS_DEPENDENCIES += rootfs-cpio
> > -
> > -ROOTFS_INITRAMFS_POST_TARGETS += linux-rebuild-with-initramfs
> > -
> > -
> >  # The generic fs infrastructure isn't very useful here.
> > +#
> > +# The initramfs image does not actually build an image; its only purpose is:
> > +# 1- to ensure rootfs.cpio is generated,
> > +# 2- to then rebuild the kernel with rootfs.cpio as initramfs
> > +#
> > +# Note: ordering of the dependencies is not guaranteed here, but in
> > +# linux/linux.mk, via the .stamp_initramfs_rebuilt stamp file, which depends
> > +# on the rootfs-cpio filesystem rule.
> 
> As said previously, there is no more .stamp_initramfs_rebuilt file.

Fixed.

> Otherwise
> Reviewed-by: Romain Naour <romain.naour@gmail.com>

Thanks! :-)

Regards,
Yann E. MORIN.

> Best regards,
> Romain
> 
> > +#
> > +# Note: the trick here is that we directly depend on rebuilding the Linux
> > +# kernel image (which itself depends on the rootfs-cpio rule), while we
> > +# advertise that our dependency is on the rootfs-cpio rule, which is
> > +# cleaner in the dependency graph.
> >  
> > -rootfs-initramfs: $(ROOTFS_INITRAMFS_DEPENDENCIES) $(ROOTFS_INITRAMFS_POST_TARGETS)
> > +rootfs-initramfs: linux-rebuild-with-initramfs
> >  
> >  rootfs-initramfs-show-depends:
> > -	@echo $(ROOTFS_INITRAMFS_DEPENDENCIES)
> > +	@echo rootfs-cpio
> >  
> >  .PHONY: rootfs-initramfs rootfs-initramfs-show-depends
> >  
> > 
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2016-03-28 21:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11 18:41 [Buildroot] [PATCH 0/9 v2] fs: cleanups and enhancements (branch yem/fs) Yann E. MORIN
2016-03-11 18:41 ` [Buildroot] [PATCH 1/9 v2] core: sort packages and eliminate duplicates before building Yann E. MORIN
2016-03-28 16:29   ` Romain Naour
2016-03-11 18:41 ` [Buildroot] [PATCH 2/9 v2] linux: split overly-long dependency line for readability Yann E. MORIN
2016-03-28 16:31   ` Romain Naour
2016-03-11 18:41 ` [Buildroot] [PATCH 3/9 v2] linux: meddle not in the affairs of filesystems, for you are tasty with bacon Yann E. MORIN
2016-03-28 17:36   ` Romain Naour
2016-03-28 17:47     ` Romain Naour
2016-03-28 21:02       ` Yann E. MORIN
2016-03-28 21:05     ` Yann E. MORIN
2016-03-11 18:41 ` [Buildroot] [PATCH 4/9 v2] fs/initramfs: cleanup and enhance comments Yann E. MORIN
2016-03-28 18:05   ` Romain Naour
2016-03-28 21:36     ` Yann E. MORIN [this message]
2016-03-11 18:41 ` [Buildroot] [PATCH 5/9 v2] fs/ext2: use a post-gen hook rather than a post-target rule Yann E. MORIN
2016-03-28 18:13   ` Romain Naour
2016-03-11 18:41 ` [Buildroot] [PATCH 6/9 v2] fs/cpio: " Yann E. MORIN
2016-03-28 18:22   ` Romain Naour
2016-03-11 18:41 ` [Buildroot] [PATCH 7/9 v2] fs/common: get rid of post-target rules Yann E. MORIN
2016-03-28 18:26   ` Romain Naour
2016-03-11 18:41 ` [Buildroot] [PATCH 8/9 v2] fs/common: move actions common to all filesystems to their own rule Yann E. MORIN
2016-03-28 21:12   ` Romain Naour
2016-03-28 21:43     ` Yann E. MORIN
2016-03-11 18:41 ` [Buildroot] [PATCH 9/9 v2] [RFC] core: finalise target in its own location Yann E. MORIN

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=20160328213654.GE3608@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox