From patchwork Sat Sep 30 01:10:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9978931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 096A260311 for ; Sat, 30 Sep 2017 01:11:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F05452989F for ; Sat, 30 Sep 2017 01:11:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E56E8298B7; Sat, 30 Sep 2017 01:11:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88D482989F for ; Sat, 30 Sep 2017 01:11:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752748AbdI3BKh (ORCPT ); Fri, 29 Sep 2017 21:10:37 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:25310 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbdI3BKf (ORCPT ); Fri, 29 Sep 2017 21:10:35 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-07.nifty.com with ESMTP id v8U1AOKA030198; Sat, 30 Sep 2017 10:10:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v8U1AOKA030198 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1506733827; bh=i2wQS+g12a/T7NVHhGPfvOTrGJ7qr6tT2ife5JUIK2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MK3Av2CHCfzt/OhEnUaf7A5PgtTIOsz4cr2j8kYrIHZO3WS5ffVtgXxC9jMwk/bkJ Yz6vviDnk12FWmXTz0C7KI2K7hbJt10TUHT6fE815LJKrUxCf644WofbfTbVCCVc6a WQUVBjDGPUnBEbkbXSl9QzrHEvhET06ypd/Jf5Boex4fPyJji8YnLzEk4lMwFdZkMB tu2CdmTfL7Yh3MQzRcw5Vq623GGFUeRY4AjRTfIr+RM7UJxx0MWBS1t7o93f6lM9Z7 aElVx0ohWGeuVqG571rPcgIZTSj/dHOF82CgS7tHIx3J6ZOqkTegFdVBQdS57zLmqL bpw1qLfWXSQiw== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 6/9] kbuild: rpm-pkg: replace $RPM_BUILD_ROOT with %{buildroot} Date: Sat, 30 Sep 2017 10:10:08 +0900 Message-Id: <1506733811-24636-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1506733811-24636-1-git-send-email-yamada.masahiro@socionext.com> References: <1506733811-24636-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP $RPM_BUILD_ROOT must be escaped to prevent shell from expanding it when generating the spec file. %{build_root} is more readable than \$RPM_BUILD_ROOT. Signed-off-by: Masahiro Yamada --- scripts/package/mkspec | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/package/mkspec b/scripts/package/mkspec index 8a9ab85..11e07b5 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec @@ -81,30 +81,30 @@ $S %build $S make %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} $S %install - mkdir -p \$RPM_BUILD_ROOT/boot + mkdir -p %{buildroot}/boot %ifarch ia64 - mkdir -p \$RPM_BUILD_ROOT/boot/efi - cp \$(make image_name) \$RPM_BUILD_ROOT/boot/efi/vmlinuz-$KERNELRELEASE - ln -s efi/vmlinuz-$KERNELRELEASE \$RPM_BUILD_ROOT/boot/ + mkdir -p %{buildroot}/boot/efi + cp \$(make image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE + ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/ %else - cp \$(make image_name) \$RPM_BUILD_ROOT/boot/vmlinuz-$KERNELRELEASE + cp \$(make image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE %endif -$M make %{?_smp_mflags} INSTALL_MOD_PATH=\$RPM_BUILD_ROOT KBUILD_SRC= modules_install - make %{?_smp_mflags} INSTALL_HDR_PATH=\$RPM_BUILD_ROOT/usr KBUILD_SRC= headers_install - cp System.map \$RPM_BUILD_ROOT/boot/System.map-$KERNELRELEASE - cp .config \$RPM_BUILD_ROOT/boot/config-$KERNELRELEASE +$M make %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} KBUILD_SRC= modules_install + make %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr KBUILD_SRC= headers_install + cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE + cp .config %{buildroot}/boot/config-$KERNELRELEASE bzip2 -9 --keep vmlinux - mv vmlinux.bz2 \$RPM_BUILD_ROOT/boot/vmlinux-$KERNELRELEASE.bz2 -$S$M rm -f \$RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/build -$S$M rm -f \$RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE/source -$S$M mkdir -p \$RPM_BUILD_ROOT/usr/src/kernels/$KERNELRELEASE -$S$M tar cf - . $EXCLUDES | tar xf - -C \$RPM_BUILD_ROOT/usr/src/kernels/$KERNELRELEASE -$S$M cd \$RPM_BUILD_ROOT/lib/modules/$KERNELRELEASE + mv vmlinux.bz2 %{buildroot}/boot/vmlinux-$KERNELRELEASE.bz2 +$S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/build +$S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/source +$S$M mkdir -p %{buildroot}/usr/src/kernels/$KERNELRELEASE +$S$M tar cf - . $EXCLUDES | tar xf - -C %{buildroot}/usr/src/kernels/$KERNELRELEASE +$S$M cd %{buildroot}/lib/modules/$KERNELRELEASE $S$M ln -sf /usr/src/kernels/$KERNELRELEASE build $S$M ln -sf /usr/src/kernels/$KERNELRELEASE source %clean - rm -rf \$RPM_BUILD_ROOT + rm -rf %{buildroot} %post if [ -x /sbin/installkernel -a -r /boot/vmlinuz-$KERNELRELEASE -a -r /boot/System.map-$KERNELRELEASE ]; then