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: 114523 Delivered-To: patch@linaro.org Received: by 10.140.104.133 with SMTP id a5csp1414444qgf; Fri, 29 Sep 2017 18:10:42 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDvr0lMfLtpqS5PNuZ/khcisLeupzSB0L9wbh3Css5bYyTvQb1WZX+X/I6DED9AIbUyoEI1 X-Received: by 10.84.131.69 with SMTP id 63mr8890171pld.364.1506733842455; Fri, 29 Sep 2017 18:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506733842; cv=none; d=google.com; s=arc-20160816; b=hbj5FMboqbf+q++pez9Xn4FRvQkf53/3JggDMm1uzDTkTj1fUKDT9zKItFzawUqIqe TpHWTRJ35UIF3LQVHs2uFg/WGTCEvUCQ9YeSKo4nhRYXhwjD+EUhNJxKQBOxkg2GcWCR c076oPXr+gWCTw9QRr/UkRNTmxFOsXbV7ghA7+F93Al3CelGm64Tpzk8v0Rt6kMUw3l4 OICNxwA8FRNDwtmueSAk3aQHa0arcgxwBJeH9Gdbsb3YP/OsAjq5Hd7z93Rz226euh4z Te3/gEuBMUlJZwB2TR1rqQ4GSscGmjeJWJ/BbgNrWkEdjqYmNFMrDahAKRwUVgcv9Nsr yV4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=i2wQS+g12a/T7NVHhGPfvOTrGJ7qr6tT2ife5JUIK2s=; b=D/rcQLPjmpzPk/3wwm6gvXsZZteB1cUaBXiOr+XGWw8z+le8ut4E0VI4A1KwJVKsVT 6HCDG/C+Beq3YKwQcV1xyhbAVw4BmrdoOFRSO2PrW/TS6G9Dahu3g24KjjBaVUeMnCbV gcmiHbeThlAMI8qGndJj/3ScktsA8+26SYFZSHRFVkPaXPiip115B4KjQRvfiGE3Cou0 oi5L5CTAzsZUTIrRgSmKpAY8U4wn5cqq2qj7pzoZ2X0I/IU/CpiB2Tuyt9stJ6eGZ6bz rnxFEnJ2qzTbLKqg+uV7oHpBcgAqIPxWgtBMGhc1c4swDUXs6gKFThjJ6mrkpxrVaXGR EFcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=MK3Av2CH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si4096601pgn.726.2017.09.29.18.10.42; Fri, 29 Sep 2017 18:10:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=MK3Av2CH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752792AbdI3BKj (ORCPT + 26 others); Fri, 29 Sep 2017 21:10:39 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org $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(-) -- 2.7.4 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