summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2015-06-25 15:42:07 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2015-06-29 14:12:32 +0300
commitb87d680d27da8199f2fed818897b6451612b1373 (patch)
treeb119e47cb04363585a2d11d3806b0f55ff245de4
parent6d190cb41e9b10dbe6c3857666c2271f9e98754c (diff)
buildperfdsc: add perf source package
Add a matching perf source package. depends on http://www.spinics.net/lists/linux-kbuild/msg11337.html Change-Id: I033887c404d19504958f96857067dd5c220b0fa9 Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
-rwxr-xr-xbuild-scripts/buildperfdsc128
-rwxr-xr-xjenkins_common_lib6
-rwxr-xr-xjenkins_kernel_build_inst6
3 files changed, 140 insertions, 0 deletions
diff --git a/build-scripts/buildperfdsc b/build-scripts/buildperfdsc
new file mode 100755
index 0000000..4f5578b
--- /dev/null
+++ b/build-scripts/buildperfdsc
@@ -0,0 +1,128 @@
+#!/bin/sh
+#
+# Simple script to generate a deb package for perf. This simply
+# replaces any distro provided linux-tools package.
+
+set -e
+
+version=$KERNELRELEASE
+revision=$(cat .version)
+if [ -n "$KDEB_PKGVERSION" ]; then
+ packageversion=$KDEB_PKGVERSION
+else
+ packageversion=$version-$revision
+fi
+if [ -n "$KDEB_PERFNAME" ]; then
+ packagename=$KDEB_PERFNAME
+else
+ packagename=perf
+fi
+
+# Try to determine maintainer and email values
+if [ -n "$DEBEMAIL" ]; then
+ email=$DEBEMAIL
+elif [ -n "$EMAIL" ]; then
+ email=$EMAIL
+else
+ email=$(id -nu)@$(hostname -f)
+fi
+if [ -n "$DEBFULLNAME" ]; then
+ name=$DEBFULLNAME
+elif [ -n "$NAME" ]; then
+ name=$NAME
+else
+ name="Anonymous"
+fi
+maintainer="$name <$email>"
+
+# Try to determine distribution
+if [ -n "$KDEB_CHANGELOG_DIST" ]; then
+ distribution=$KDEB_CHANGELOG_DIST
+elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ]; then
+ : # nothing to do in this case
+else
+ distribution="unstable"
+ echo >&2 "Using default distribution of 'unstable' in the changelog"
+ echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly"
+fi
+
+mkdir -p debian
+
+# Generate a simple changelog template
+cat <<EOF > debian/changelog
+$packagename ($packageversion) $distribution; urgency=low
+
+ * Perf built for Linux version $version.
+
+ -- $maintainer $(date -R)
+EOF
+
+# Generate copyright file
+cat <<EOF > debian/copyright
+This is a packacked upstream version of the Linux kernel.
+
+The sources may be found at most Linux ftp sites, including:
+ftp://ftp.kernel.org/pub/linux/kernel
+
+Copyright: 1991 - 2015 Linus Torvalds and others.
+
+The git repository for mainline kernel development is at:
+git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 dated June, 1991.
+
+On Debian GNU/Linux systems, the complete text of the GNU General Public
+License version 2 can be found in \`/usr/share/common-licenses/GPL-2'.
+EOF
+
+build_depends="debhelper, python-dev, libperl-dev, bison, flex, \
+libaudit-dev, libdw-dev, libelf-dev, libiberty-dev, libnewt-dev, autoconf, \
+automake, libtool, libglib2.0-dev, libgtk2.0-dev, libudev-dev, libwrap0-dev, \
+libiberty-dev, libunwind8-dev [amd64 arm64 i386], binutils-dev, liblzma-dev, \
+libnuma-dev [amd64 arm64 i386 powerpc ppc64 ppc64el], asciidoc, xmlto"
+
+# Generate a control file
+cat <<EOF > debian/control
+Source: $packagename
+Section: kernel
+Priority: optional
+Maintainer: $maintainer
+Build-Depends: $build_depends
+Standards-Version: 3.8.4
+Homepage: http://www.kernel.org/
+
+Package: $packagename
+Replaces: linux-base, linux-tools, linux-tools-common
+Depends: \${shlibs:Depends}, \${perl:Depends}
+Architecture: any
+Description: Performance analysis tools for Linux $version
+ This package contains the Linux kernel, modules and corresponding other
+ files, version: $version.
+EOF
+
+echo 9 > debian/compat
+
+cat <<EOF > debian/rules
+#!/usr/bin/make -f
+%:
+ dh \$@
+
+override_dh_auto_install:
+ \$(MAKE) -C tools/perf prefix=\$(shell pwd)/debian/perf/usr install
+
+override_dh_auto_clean:
+ dh_clean
+ \$(MAKE) -C tools/perf clean
+
+EOF
+
+mv ${packagename}-${KERNELVERSION}.tar.xz ../${packagename}_${version}.orig.tar.xz
+tar caf ../${packagename}_${packageversion}.debian.tar.xz debian/{compat,copyright,rules,changelog,control}
+dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
+ -b / ../${packagename}_${version}.orig.tar.xz ../${packagename}_${packageversion}.debian.tar.xz
+mv ${packagename}_${packageversion}*dsc ..
+dpkg-genchanges -S > ../${packagename}_${packageversion}_source.changes
+
+exit 0
diff --git a/jenkins_common_lib b/jenkins_common_lib
index 650fd3b..0a9f7c0 100755
--- a/jenkins_common_lib
+++ b/jenkins_common_lib
@@ -159,6 +159,12 @@ build_instructions()
if [ "${make_deb}" = "true" ]; then
[ "${ARCH}" = "arm64" ] && kernel_image_arg="KBUILD_IMAGE=arch/arm64/boot/Image"
eval 'make O=${pkg_dir} KERNELRELEASE=${kernel_release} KBUILD_DEBARCH=${kernel_debarch} ${kernel_image_arg} V=1 deb-pkg'${redirect_output}
+ if [ "${make_perf}" = "true" ]; then
+ make O=${pkg_dir} KERNELRELEASE=${kernel_release} perf-tarxz-src-pkg
+ cd ${pkg_dir}
+ ../lci-build-tools/build-scripts/buildperfdsc
+ cd -
+ fi
fi
if [ "${make_install}" = "true" ]; then
install -D -p -m0644 ${pkg_dir}/.config out/kernel.config
diff --git a/jenkins_kernel_build_inst b/jenkins_kernel_build_inst
index c1e6846..b0986f3 100755
--- a/jenkins_kernel_build_inst
+++ b/jenkins_kernel_build_inst
@@ -91,6 +91,10 @@ if test -z "$make_silent"; then
make_silent=false
fi
+if test -z "$make_perf"; then
+ make_perf=false
+fi
+
install_custom_toolchain
if [ "${use_ccache}" = "true" ]; then
@@ -104,6 +108,7 @@ fi
export make_silent
export make_deb
+export make_perf
export make_bootwrapper
export make_install
export conf_git
@@ -130,6 +135,7 @@ export kernel_release=${kernel_version}-linaro-${kernel_flavour}
export KERNELVERSION=${kernel_version}
export KERNELRELEASE=${kernel_release}
export KDEB_SOURCENAME=linux-${kernel_release}
+export KDEB_PERFNAME=perf-${kernel_release}
# Below is the list of values that will be used in the json files
export KERNEL_GIT=`git config remote.origin.url`