From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Jonas Bonn <jonas@southpole.se>, linux-kbuild@vger.kernel.org
Cc: linux@openrisc.net, linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] [RFC] initramfs: Prefix simple paths with $(srctree)
Date: Thu, 14 Nov 2013 23:14:43 +0100 [thread overview]
Message-ID: <1384467283-14806-1-git-send-email-geert@linux-m68k.org> (raw)
If CONFIG_INITRAMFS_SOURCE contains relative paths inside the source tree
(e.g. in a defconfig pointing to arch-specific files), the corresponding
file system entries are not found when building outside the source tree.
Prefix all simple paths (paths not starting with "/", "../", or "./") with
$(srctree) to fix this.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
This issue happens when building an OpenRISC defconfig from
git://openrisc.net/jonas/linux. Mainline doesn't have the OpenRISC
initramfs.
Questions:
1. Is this an acceptable solution for mainline?
2. My make-foo is limited. is there a better way to accomplish this, than
by prefixing all paths and removing the prefixes again where they're
not wanted?
usr/Makefile | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/usr/Makefile b/usr/Makefile
index e767f019accf..2170c38936ce 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -41,6 +41,12 @@ hostprogs-y := gen_init_cpio
initramfs := $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs_list.sh
ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
$(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
+ifneq ("$(ramfs-input)", "-d")
+ramfs-input := $(patsubst %, $(srctree)/%, $(ramfs-input))
+ramfs-input := $(patsubst $(srctree)//%, /%, $(ramfs-input))
+ramfs-input := $(patsubst $(srctree)/../%, ../%, $(ramfs-input))
+ramfs-input := $(patsubst $(srctree)/./%, ./%, $(ramfs-input))
+endif
ramfs-args := \
$(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
$(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
--
1.7.9.5
next reply other threads:[~2013-11-14 22:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 22:14 Geert Uytterhoeven [this message]
2013-11-15 5:55 ` [PATCH] [RFC] initramfs: Prefix simple paths with $(srctree) Vineet Gupta
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=1384467283-14806-1-git-send-email-geert@linux-m68k.org \
--to=geert@linux-m68k.org \
--cc=jonas@southpole.se \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@openrisc.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;
as well as URLs for NNTP newsgroup(s).