From patchwork Fri Jun 7 16:25:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Marciniszyn, Mike" X-Patchwork-Id: 2688181 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5F36540077 for ; Fri, 7 Jun 2013 16:25:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756550Ab3FGQZo (ORCPT ); Fri, 7 Jun 2013 12:25:44 -0400 Received: from mga03.intel.com ([143.182.124.21]:64240 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756549Ab3FGQZo (ORCPT ); Fri, 7 Jun 2013 12:25:44 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 07 Jun 2013 09:25:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.87,823,1363158000"; d="scan'208";a="313803586" Received: from sedona.ch.intel.com ([143.182.228.65]) by azsmga001.ch.intel.com with ESMTP; 07 Jun 2013 09:25:37 -0700 Received: from phlsvsles11.ph.intel.com (phlsvsles11.ph.intel.com [10.228.195.43]) by sedona.ch.intel.com (8.13.6/8.14.3/Standard MailSET/Hub) with ESMTP id r57GPXFE022657; Fri, 7 Jun 2013 09:25:37 -0700 Received: from phlsvslse11.ph.intel.com (localhost [127.0.0.1]) by phlsvsles11.ph.intel.com with ESMTP id r57GPXW8019179; Fri, 7 Jun 2013 12:25:33 -0400 Subject: [PATCH v6] kbuild: fix error when building from src rpm To: mmarek@suse.cz From: Mike Marciniszyn Cc: linux-kbuild@vger.kernel.org, mmarcini@yahoo.com Date: Fri, 07 Jun 2013 12:25:33 -0400 Message-ID: <20130607162533.19157.25779.stgit@phlsvslse11.ph.intel.com> User-Agent: StGit/0.16 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org The following issue can be reproduced with Linus' tree on and x86_64 server. >+ cp /home/user/rpmbuild-test/BUILDROOT/kernel-3.9.2.x86_64/boot/vmlinuz-3.9.2 >cp: missing destination file operand after >/home/user/rpmbuild-test/BUILDROOT/kernel-3.9.2-1.x86_64/boot/vmlinuz-3.9.2' >Try `cp --help' for more information. >error: Bad exit status from /var/tmp/rpm-tmp.R4o0iI (%install) Here are the commands to reproduce: make defconfig make rpm-pkg Use the resulting src rpm to build as follows: mkdir ~/rpmbuild-test cd ~/rpmbuild-test rpmbuild --rebuild --define "_topdir `pwd`" -vv ~/rpmbuild/SRPMS/kernel-3.10.0_rc1+-1.src.rpm The issue is because the %install script uses $KBUILD_IMAGE and it hasn't been set since it is only available in the kbuild system and not in the %install script. This patch adds a Makefile target to emit the image_name that can be used and modifies the mkspec to use the dynamic name in %install. Signed-off-by: Mike Marciniszyn --- Makefile | 6 ++++++ scripts/package/mkspec | 1 + 2 files changed, 7 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Makefile b/Makefile index cd11e88..5b2217c 100644 --- a/Makefile +++ b/Makefile @@ -1275,6 +1275,12 @@ clean: $(clean-dirs) -o -name modules.builtin -o -name '.tmp_*.o.*' \ -o -name '*.gcno' \) -type f -print | xargs rm -f +# For probing for image name +# --------------------------------------------------------------------------- +.PHONY += image_name +image_name: FORCE + @echo $(KBUILD_IMAGE) + # Generate tags for editors # --------------------------------------------------------------------------- quiet_cmd_tags = GEN $@ diff --git a/scripts/package/mkspec b/scripts/package/mkspec index fbbfd08..fdd3fbf 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -74,6 +74,7 @@ echo "" fi echo "%install" +echo 'KBUILD_IMAGE=$(make image_name)' echo "%ifarch ia64" echo 'mkdir -p $RPM_BUILD_ROOT/boot/efi $RPM_BUILD_ROOT/lib/modules' echo 'mkdir -p $RPM_BUILD_ROOT/lib/firmware'