^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #!/bin/sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # Test one of the main kernel Makefile targets to generate a perf sources tarball
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) # suitable for build outside the full kernel sources.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # This is to test that the tools/perf/MANIFEST file lists all the files needed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) # be in such tarball, which sometimes gets broken when we move files around,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) # like when we made some files that were in tools/perf/ available to other tools/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) # codebases by moving it to tools/include/, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) PERF=$1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) cd ${PERF}/../..
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) make perf-targz-src-pkg > /dev/null
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) TARBALL=$(ls -rt perf-*.tar.gz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) TMP_DEST=$(mktemp -d)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) tar xf ${TARBALL} -C $TMP_DEST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) rm -f ${TARBALL}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) cd - > /dev/null
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) make -C $TMP_DEST/perf*/tools/perf > /dev/null
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) RC=$?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) rm -rf ${TMP_DEST}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) exit $RC