From patchwork Thu Nov 14 22:14:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 3185631 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 619409F3AE for ; Thu, 14 Nov 2013 22:14:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8968420897 for ; Thu, 14 Nov 2013 22:14:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64E5320942 for ; Thu, 14 Nov 2013 22:14:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755593Ab3KNWOu (ORCPT ); Thu, 14 Nov 2013 17:14:50 -0500 Received: from georges.telenet-ops.be ([195.130.137.68]:48001 "EHLO georges.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755391Ab3KNWOt (ORCPT ); Thu, 14 Nov 2013 17:14:49 -0500 Received: from ayla.of.borg ([84.193.72.141]) by georges.telenet-ops.be with bizsmtp id paEn1m01v32ts5g06aEnwf; Thu, 14 Nov 2013 23:14:47 +0100 Received: from geert by ayla.of.borg with local (Exim 4.76) (envelope-from ) id 1Vh5BX-0003rK-Ld; Thu, 14 Nov 2013 23:14:47 +0100 From: Geert Uytterhoeven To: Jonas Bonn , linux-kbuild@vger.kernel.org Cc: linux@lists.openrisc.net, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] [RFC] initramfs: Prefix simple paths with $(srctree) Date: Thu, 14 Nov 2013 23:14:43 +0100 Message-Id: <1384467283-14806-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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))