From: Carlos Santos <casantos@datacom.com.br>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] fs: allow filesystems to set the name of their output file
Date: Wed, 24 Oct 2018 21:20:43 -0300 [thread overview]
Message-ID: <20181025002043.2235-1-casantos@datacom.com.br> (raw)
In-Reply-To: <20181024143616.GA31663@scaer>
Some filesystems may want to tweak their output names, rather than using
the fixed "rootfs.foo" scheme. Add a ROOTFS_FOO_IMAGE_NAME variable for
this purpose.
Signed-off-by: Carlos Santos <casantos@datacom.com.br>
---
Supersedes: https://patchwork.ozlabs.org/patch/988446/
Changes v1->v2:
- Prevent leading space when the filesystem gets 'imaginative', as
pointed by Yann Morin.
NOTE: https://patchwork.ozlabs.org/patch/927116/ must be upated to
document this.
---
fs/common.mk | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/fs/common.mk b/fs/common.mk
index 453da6010a..9c2f9c6dd4 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -106,6 +106,8 @@ rootfs-common-show-depends:
# all variable references except the arguments must be $$-quoted.
define inner-rootfs
+ROOTFS_$(2)_IMAGE_NAME ?= rootfs.$(1)
+ROOTFS_$(2)_FINAL_IMAGE_NAME = $$(call qstrip,$$(ROOTFS_$()_IMAGE_NAME))
ROOTFS_$(2)_DIR = $$(FS_DIR)/$(1)
ROOTFS_$(2)_TARGET_DIR = $$(ROOTFS_$(2)_DIR)/target
@@ -140,10 +142,10 @@ ROOTFS_$(2)_COMPRESS_EXT = .xz
ROOTFS_$(2)_COMPRESS_CMD = xz -9 -C crc32 -c
endif
-$$(BINARIES_DIR)/rootfs.$(1): ROOTFS=$(2)
-$$(BINARIES_DIR)/rootfs.$(1): FAKEROOT_SCRIPT=$$(ROOTFS_$(2)_DIR)/fakeroot
-$$(BINARIES_DIR)/rootfs.$(1): $$(ROOTFS_$(2)_DEPENDENCIES)
- @$$(call MESSAGE,"Generating root filesystem image rootfs.$(1)")
+$$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): ROOTFS=$(2)
+$$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): FAKEROOT_SCRIPT=$$(ROOTFS_$(2)_DIR)/fakeroot
+$$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME): $$(ROOTFS_$(2)_DEPENDENCIES)
+ @$$(call MESSAGE,"Generating filesystem image $$(ROOTFS_$(2)_FINAL_IMAGE_NAME)")
rm -rf $$(ROOTFS_$(2)_DIR)
mkdir -p $$(ROOTFS_$(2)_DIR)
echo '#!/bin/sh' > $$(FAKEROOT_SCRIPT)
@@ -164,7 +166,7 @@ endif
rootfs-$(1)-show-depends:
@echo $$(ROOTFS_$(2)_DEPENDENCIES)
-rootfs-$(1): $$(BINARIES_DIR)/rootfs.$(1)
+rootfs-$(1): $$(BINARIES_DIR)/$$(ROOTFS_$(2)_FINAL_IMAGE_NAME)
.PHONY: rootfs-$(1) rootfs-$(1)-show-depends
--
2.17.1
next prev parent reply other threads:[~2018-10-25 0:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 2:31 [Buildroot] [RFC] fs: allow passing the image file name to inner-rootfs Carlos Santos
2018-10-21 13:26 ` Yann E. MORIN
2018-10-24 1:01 ` [Buildroot] [PATCH] fs: allow filesystems to set the name of their output file Carlos Santos
2018-10-24 14:36 ` Yann E. MORIN
2018-10-25 0:20 ` Carlos Santos [this message]
2018-11-01 21:01 ` [Buildroot] [PATCH v2] " Yann E. MORIN
2018-11-03 2:20 ` Carlos Santos
2018-11-03 22:25 ` Carlos Santos
2018-11-03 22:13 ` Carlos Santos
2018-11-03 10:37 ` [Buildroot] [PATCH] " Arnout Vandecappelle
2018-11-03 13:34 ` Yann E. MORIN
2018-11-03 22:09 ` Carlos Santos
2018-11-30 18:18 ` Yann E. MORIN
2018-10-25 0:23 ` Carlos Santos
2018-10-24 1:04 ` [Buildroot] [RFC] fs: allow passing the image file name to inner-rootfs Carlos Santos
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=20181025002043.2235-1-casantos@datacom.com.br \
--to=casantos@datacom.com.br \
--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