xref: /OK3568_Linux_fs/kernel/tools/perf/tests/perf-targz-src-pkg (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun#!/bin/sh
2*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0
3*4882a593Smuzhiyun# Test one of the main kernel Makefile targets to generate a perf sources tarball
4*4882a593Smuzhiyun# suitable for build outside the full kernel sources.
5*4882a593Smuzhiyun#
6*4882a593Smuzhiyun# This is to test that the tools/perf/MANIFEST file lists all the files needed to
7*4882a593Smuzhiyun# be in such tarball, which sometimes gets broken when we move files around,
8*4882a593Smuzhiyun# like when we made some files that were in tools/perf/ available to other tools/
9*4882a593Smuzhiyun# codebases by moving it to tools/include/, etc.
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunPERF=$1
12*4882a593Smuzhiyuncd ${PERF}/../..
13*4882a593Smuzhiyunmake perf-targz-src-pkg > /dev/null
14*4882a593SmuzhiyunTARBALL=$(ls -rt perf-*.tar.gz)
15*4882a593SmuzhiyunTMP_DEST=$(mktemp -d)
16*4882a593Smuzhiyuntar xf ${TARBALL} -C $TMP_DEST
17*4882a593Smuzhiyunrm -f ${TARBALL}
18*4882a593Smuzhiyuncd - > /dev/null
19*4882a593Smuzhiyunmake -C $TMP_DEST/perf*/tools/perf > /dev/null
20*4882a593SmuzhiyunRC=$?
21*4882a593Smuzhiyunrm -rf ${TMP_DEST}
22*4882a593Smuzhiyunexit $RC
23