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 8/9 v2] fs/common: move actions common to all filesystems to their own rule
Date: Mon, 28 Mar 2016 23:43:42 +0200	[thread overview]
Message-ID: <20160328214342.GF3608@free.fr> (raw)
In-Reply-To: <56F99E23.8010702@gmail.com>

Romain, All,

On 2016-03-28 23:12 +0200, Romain Naour spake thusly:
> Le 11/03/2016 19:41, Yann E. MORIN a ?crit :
> > A lot of actions are common to generating the various images. Currently,
> > they are all done for each image being generated.
> > 
> > However, we can do them once and for all.
> > 
> > Also add a sha-bang to the fakeroot script, for completeness.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > 
> > ---
> > Note: when I wrote that patch, it was only a preparatory work for something
> > bigger and clever about how images are generated. However, I can't recall
> > what it was... :-(  Yet, I believe that patch to still be valid on its own.
> 
> Maybe this patch was done to remove some $$ in the code :p

Hehe! However, who would complain for having too many $ ? ;-]

[--SNIP--]
> > @@ -66,32 +89,16 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz
> >  ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c
> >  endif
> >  
> > -$$(BINARIES_DIR)/rootfs.$(1): target-finalize $$(ROOTFS_$(2)_DEPENDENCIES)
> > +ROOTFS_$(2)_FAKEROOT_SCRIPT = $$(FS_DIR)/fakeroot.$(1)
> > +
> > +$$(BINARIES_DIR)/rootfs.$(1): rootfs-common $$(ROOTFS_$(2)_DEPENDENCIES)
> >  	@$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
> >  	$$(foreach hook,$$(ROOTFS_$(2)_PRE_GEN_HOOKS),$$(call $$(hook))$$(sep))
> > -	rm -f $$(FAKEROOT_SCRIPT)
> > +	$$(INSTALL) -D -m 0755 $$(FAKEROOT_SCRIPT) $$(ROOTFS_$(2)_FAKEROOT_SCRIPT)
> > +	echo "$$(ROOTFS_$(2)_CMD)" >> $$(ROOTFS_$(2)_FAKEROOT_SCRIPT)
> >  	rm -f $$(TARGET_DIR_WARNING_FILE)
> > -	rm -f $$(USERS_TABLE)
> > -	echo "set -e" >> $$(FAKEROOT_SCRIPT)
> > -	echo "chown -h -R 0:0 $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)
> > -ifneq ($$(ROOTFS_USERS_TABLES),)
> > -	cat $$(ROOTFS_USERS_TABLES) >> $$(USERS_TABLE)
> > -endif
> > -	printf '$$(subst $$(sep),\n,$$(PACKAGES_USERS))' >> $$(USERS_TABLE)
> > -	PATH=$$(BR_PATH) $$(TOPDIR)/support/scripts/mkusers $$(USERS_TABLE) $$(TARGET_DIR) >> $$(FAKEROOT_SCRIPT)
> > -ifneq ($$(ROOTFS_DEVICE_TABLES),)
> > -	cat $$(ROOTFS_DEVICE_TABLES) > $$(FULL_DEVICE_TABLE)
> > -ifeq ($$(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
> > -	printf '$$(subst $$(sep),\n,$$(PACKAGES_DEVICES_TABLE))' >> $$(FULL_DEVICE_TABLE)
> > -endif
> > -	printf '$$(subst $$(sep),\n,$$(PACKAGES_PERMISSIONS_TABLE))' >> $$(FULL_DEVICE_TABLE)
> > -	echo "$$(HOST_DIR)/usr/bin/makedevs -d $$(FULL_DEVICE_TABLE) $$(TARGET_DIR)" >> $$(FAKEROOT_SCRIPT)
> > -endif
> > -	echo "$$(ROOTFS_$(2)_CMD)" >> $$(FAKEROOT_SCRIPT)
> > -	chmod a+x $$(FAKEROOT_SCRIPT)
> > -	PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
> > +	PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(ROOTFS_$(2)_FAKEROOT_SCRIPT)
> >  	$$(INSTALL) -m 0644 support/misc/target-dir-warning.txt $$(TARGET_DIR_WARNING_FILE)
> > -	- at rm -f $$(FAKEROOT_SCRIPT) $$(FULL_DEVICE_TABLE)
> 
> I think it's a good idea to keep all fakeroot.* script used during rootfs images
> build.
> 
> Reviewed-by: Romain Naour <romain.naour@gmail.com>
> 
> It seems that there is no need to add PATH=$(BR_PATH) in ROOTFS_EXT2_CMD since
> it's already present in fakeroot environment ? (see
> 89e16118b45c1bb8d112e8829d34e0883a6450be)

Indeed, but that should be done in a separate patch (since it was not
added in my series). I'll add such a patch to the series.

Thanks! :-)

Regards,
Yann E. MORIN.

> Best regards,
> Romain
> 
> >  ifneq ($$(ROOTFS_$(2)_COMPRESS_CMD),)
> >  	PATH=$$(BR_PATH) $$(ROOTFS_$(2)_COMPRESS_CMD) $$@ > $$@$$(ROOTFS_$(2)_COMPRESS_EXT)
> >  endif
> > 
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  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:43 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
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 [this message]
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=20160328214342.GF3608@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