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 3/9] linux: meddle not in the affairs of filesystems, for you are tasty with bacon
Date: Thu, 1 Oct 2015 18:41:14 +0200	[thread overview]
Message-ID: <20151001164114.GB3686@free.fr> (raw)
In-Reply-To: <20151001082025.30cdb5ce@free-electrons.com>

Thomas, All,

On 2015-10-01 08:20 +0200, Thomas Petazzoni spake thusly:
> On Wed, 30 Sep 2015 23:54:46 +0200, Yann E. MORIN wrote:
> > Currently, the rule to rebuild the Linux kernel with an initramfs
> > directly depends on the filesystem image filename.
> > 
> > This is inherently "bad" from a purity point of view. linux.mk should
> > not have to delve into the fs internals.
> > 
> > Rather, make it directly depend on the "frontal" rule that generates the
> > cpio image.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > Cc: Arnout Vandecappelle <arnout@mind.be>
> > 
> > ---
> > This, too, will be useful for the initramfs patch coming next.
> > ---
> >  linux/linux.mk | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/linux/linux.mk b/linux/linux.mk
> > index 316f973..864ccbf 100644
> > --- a/linux/linux.mk
> > +++ b/linux/linux.mk
> > @@ -392,7 +392,7 @@ $(eval $(kconfig-package))
> >  # been generated in $(BINARIES_DIR)/rootfs.cpio.
> >  $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_target_installed
> >  $(LINUX_DIR)/.stamp_initramfs_rebuilt: $(LINUX_DIR)/.stamp_images_installed
> > -$(LINUX_DIR)/.stamp_initramfs_rebuilt: $(BINARIES_DIR)/rootfs.cpio
> > +$(LINUX_DIR)/.stamp_initramfs_rebuilt: rootfs-cpio
> 
> Are you sure this is OK ? It creates a dependency of a "real target" on
> a "phony target", which means that the "real target" will *always* be
> rebuilt, at every invocation of "make". Is this what we want?

Well, that's alredy the behaviour we have: we always rebuild the images
on each make invocation. This patch does not change the current behaviour.

And indeed, that's what we do want. For the simple reason that he user
may manually change the content of target/ and re-run make to update the
images.

And anyway, the filesystem image files are already depending on a PHONY
target, and thus are always rebuilt:

    fs/common.mk:
      73 $$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES)

However, you are right that the dependency of a rule target onto a PHONY
target is not clean. And in fact, there is not reason for the stamp-file
to begin with. We can coalesce the recipe of the stamp-file into the
PHONY linux-rebuild-with-initramfs rule.

I'll update the patch to drop the stamp-file, unless you can come up
with a reason for its existence. ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  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:[~2015-10-01 16:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-30 21:54 [Buildroot] [PATCH 0/9] fs: cleanups and enhancements (branch yem/fs) Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 1/9] core: sort packages and eliminate duplicates before building Yann E. MORIN
2015-10-01  6:19   ` Thomas Petazzoni
2015-10-01 16:32     ` Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 2/9] linux: split overly-long dependency line for readability Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 3/9] linux: meddle not in the affairs of filesystems, for you are tasty with bacon Yann E. MORIN
2015-10-01  6:20   ` Thomas Petazzoni
2015-10-01 16:41     ` Yann E. MORIN [this message]
2015-09-30 21:54 ` [Buildroot] [PATCH 4/9] fs/initramfs: cleanup and enhance comments Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 5/9] fs/ext2: use a post-gen hook rather than a post-target rule Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 6/9] fs/cpio: " Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 7/9] fs/common: get rid of post-target rules Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 8/9] fs/common: move actions common to all filesystems to their own rule Yann E. MORIN
2015-09-30 21:54 ` [Buildroot] [PATCH 9/9] core: finalise target in its own location Yann E. MORIN
2015-10-01 21:44   ` Thomas Petazzoni
2015-10-02  7:46     ` Yann E. MORIN
2015-10-02  8:21       ` Thomas Petazzoni

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=20151001164114.GB3686@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