Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3437088imu; Sun, 11 Nov 2018 15:04:54 -0800 (PST) X-Google-Smtp-Source: AJdET5fi3PERpL9c3w3eUTn654neW7WBz5RQtbLXOoLy1pip3FmuvC4CRKhggEdzBEwfy/CRc3GH X-Received: by 2002:a17:902:443:: with SMTP id 61-v6mr17318940ple.216.1541977494169; Sun, 11 Nov 2018 15:04:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977494; cv=none; d=google.com; s=arc-20160816; b=ceS8hDNT2lOCZ62NBTAeYxXyFePZ8CQFofd7EP41SUhyErO4NuVv+XLmGkdd35sVWn dQcAgw+7RFeUKznUFinVrdLVI2iY4Fl3K9lfHMgoPF9NaMg/w1JP5tAt8TpW219etKWT 6HIOv3tAZqEcbB0lYyVTpPqDoKQJFlOAlihHRi3pAkS6834MnxaxA9kmVk7J12QrB9F6 eXnhw4f8Qse0PtgEoKNw8elV7wajsdQr57JCXsoKLU6EQkmdQebxHxzJf3gwXNss+z8A NM8a8cHmiEAicecnN/VMm34GDSkihzQxTD9VTwKJ1347cnRW54bPHGIwxARGko726ott rjFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wyqHmNkjVaoKbItTHvMV5YLGi1XwItoUgKqe8DhnK3E=; b=W3RJXVe3GvuURSwXyTuoBWDuQePtErUnq8r61m5XsLDxPcRG0jcBq7Yl1U8QR2Aifa tDr6oV9KBvXXhRezRSEmlAy5CkehERMGvvTN3N1JpLoGhOOYrakfpQpsV0MUZl7GexiT qrlRdG/k+RYr8x2OWg71q1K7h8s44lF7UsnwCAQ0yQB7vOCq9J9pjP6pX2I/EG9+b3i3 Ji3NWAdv11WXBfwgBzzwo96J/CDQHWGqM8INZ4fQnx+o5Mx/0AJSi+wufUCH14cK4jgb mL4BUcRnPLkOkln/dhrtb0E7iMXCS3pada9C8zRkNIWzdBdcAtkTxCVnx8zKDKNw9DI9 uF7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wsS0W0Nr; 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 v30si8096683pga.45.2018.11.11.15.04.39; Sun, 11 Nov 2018 15:04:54 -0800 (PST) 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=@kernel.org header.s=default header.b=wsS0W0Nr; 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 S2390522AbeKLIWV (ORCPT + 99 others); Mon, 12 Nov 2018 03:22:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387738AbeKLIWT (ORCPT ); Mon, 12 Nov 2018 03:22:19 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 61CAD2243E; Sun, 11 Nov 2018 22:32:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975542; bh=kPgZS0N1MPZmzcJlzMEIlszJYMepyKJ/jMYUgYUTM4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wsS0W0NrVMs9aYLKkZ6iMmINOcNEyr8NhU0JeLthmhjZmeqjXJsSRd3AAmkjsbCXj DYvFgVYe+DuAxlCOWIjLU57itN2CqR/bIyJnr6E5KPyzSv6yLH2XwvM0BQvz7DitSd D3K9hAF6cKZnjqWKt+EJJlFgXdC1DAQqdqus+tgg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jarod Wilson , Jiri Olsa , Alexander Shishkin , Namhyung Kim , Peter Zijlstra , Stephane Eranian , William Cohen , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 4.14 033/222] perf tools: Fix use of alternatives to find JDIR Date: Sun, 11 Nov 2018 14:22:10 -0800 Message-Id: <20181111221651.178916444@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jarod Wilson [ Upstream commit 36b8d4628d3cc8f5a748e508cce8673bc00fc63c ] When a build is run from something like a cron job, the user's $PATH is rather minimal, of note, not including /usr/sbin in my own case. Because of that, an automated rpm package build ultimately fails to find libperf-jvmti.so, because somewhere within the build, this happens... /bin/sh: alternatives: command not found /bin/sh: alternatives: command not found Makefile.config:849: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel ...and while the build continues, libperf-jvmti.so isn't built, and things fall down when rpm tries to find all the %files specified. Exact same system builds everything just fine when the job is launched from a login shell instead of a cron job, since alternatives is in $PATH, so openjdk is actually found. The test required to get into this section of code actually specifies the full path, as does a block just above it, so let's do that here too. Signed-off-by: Jarod Wilson Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: William Cohen Fixes: d4dfdf00d43e ("perf jvmti: Plug compilation into perf build") Link: http://lkml.kernel.org/r/20180906221812.11167-1-jarod@redhat.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -795,7 +795,7 @@ ifndef NO_JVMTI JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$3}') else ifneq (,$(wildcard /usr/sbin/alternatives)) - JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') + JDIR=$(shell /usr/sbin/alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') endif endif ifndef JDIR