blob: f7fbc90bc1c0f31610e000d31080dbf3d98a8b1e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
From: Riku Voipio <riku.voipio@linaro.org>
Perf is shipped in debian in linux-tools-$version package. Extend
the existing to builddeb script to build perf if BUILD_TOOLS=y
is added the make deb-pkg line
Some features of this patch I'm uncomfortable with:
1. Relative paths are resoved to absolute ones
Especially with separate O= buildd, perf build from tools/perf dir
fail.
2. Unsetting LDFLAGS
make -> shell (builddeb) -> make expands variables. The LDFLAGS as
set by toplevel makefile are for kernel, so we just unset the flag
here.
3. Replaces ubuntu/debian packages instead attempting to fit to
the linux-base/linux-tools-common frameworks. I think people who
want to run "make deb-pkg" for their kernels would rather keep this
simple.
4. More tools than just perf could be built - unfortunately most
tools fail to have a working "install" target and/or else have
build process inconsistent with other tools. A topic for another
patch series.
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
---
scripts/package/builddeb | 31 ++++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 6df3c9f8b2da..a38cfc984134 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -102,8 +102,10 @@ deploy_libc_headers () {
version=$KERNELRELEASE
tmpdir=debian/linux-image
dbg_dir=debian/linux-image-dbg
+tools_dir="$objtree/debian/toolstmp"
packagename=linux-image-$version
dbg_packagename=$packagename-dbg
+tools_packagename=linux-tools-$version
if [ "$ARCH" = "um" ] ; then
packagename=user-mode-linux-$version
@@ -126,7 +128,7 @@ esac
BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)
# Setup the directory structure
-rm -rf "$tmpdir" "$dbg_dir" debian/files
+rm -rf "$tmpdir" "$dbg_dir" "$tools_dir" debian/files
mkdir -m 755 -p "$tmpdir/DEBIAN"
mkdir -p "$tmpdir/lib" "$tmpdir/boot"
@@ -225,4 +227,31 @@ if [ -n "$BUILD_DEBUG" ] ; then
create_package "$dbg_packagename" "$dbg_dir"
fi
+if [ -n "$BUILD_TOOLS" ]
+then
+ # HACK - change output dir from relative to absolute
+ mkdir -p $tools_dir
+ tools_dest=`readlink -f $tools_dir`
+ if [ -n "$O" ]
+ then
+ output=`readlink -f $objtree`
+ mkdir -p $output/tools/perf
+ output="O=$output/tools/perf"
+ fi
+ $MAKE -C $srctree/tools/perf $output LDFLAGS= srctree=$KBUILD_SRC prefix=$tools_dest/usr install
+ cat <<EOF >> debian/control
+
+Package: $tools_packagename
+Architecture: any
+Replaces: linux-base, linux-tools-common
+Depends: \${shlibs:Depends}
+Description: Performance analysis tools for Linux $version
+ This package contains the 'perf' performance analysis tools for Linux
+ kernel version $version .
+EOF
+
+ dpkg-shlibdeps $tools_dest/usr/bin/* $tools_dest/usr/lib*/traceevent/plugins/*
+ create_package "$tools_packagename" "$tools_dir"
+fi
+
exit 0
--
2.20.1
|