From: Sam Ravnborg on
On Fri, May 28, 2010 at 03:53:57PM -0300, Arnaldo Carvalho de Melo wrote:
> Hi Michal, Sam,
>
> Are you OK with with this change?

No - I do not like it :-)

But I like the concept.

We have some minimal infrastructure to support packaging
and this seems like an OK fit for this too.
Only drawback is that you need to configure your kernel
before you can pack the source tarball.

Moving the packaging support to scripts/package/
avoiding any changes to the top-level Makefile.

Appended is my attemt to add it to said file.
But my git did not support the '-o' option so it is untested.

To apply it you need your MANIFEST file (obviously).

Help will say:
$ make help | grep perf
perf-pkg - Build perf-2.6.34.tar.gz source tarball


You may consider to restructure cmd_perf a little so
it exits on error. I just did the quick version here.

Sam



diff --git a/scripts/package/Makefile b/scripts/package/Makefile
index 62fcc3a..475f023 100644
--- a/scripts/package/Makefile
+++ b/scripts/package/Makefile
@@ -111,6 +111,24 @@ tar%pkg: FORCE
clean-dirs += $(objtree)/tar-install/


+# perf-pkg - generate a source tarball with perf source
+# ---------------------------------------------------------------------------
+perf-tar=perf-$(KERNELVERSION)
+
+quiet_cmd_perf = TAR
+ cmd_perf = \
+git archive --prefix=$(perf-tar)/ HEAD^{tree} \
+ $$(cat tools/perf/MANIFEST) -o $(perf-tar).tar; \
+mkdir -p $(perf-tar); \
+git rev-parse HEAD > $(perf-tar)/HEAD; \
+tar rf $(perf-tar).tar $(perf-tar)/HEAD; \
+rm -r $(perf-tar); \
+gzip -f -9 $(perf-tar).tar
+
+
+perf-pkg: FORCE
+ $(call cmd,perf)
+
# Help text displayed when executing 'make help'
# ---------------------------------------------------------------------------
help: FORCE
@@ -120,4 +138,5 @@ help: FORCE
@echo ' tar-pkg - Build the kernel as an uncompressed tarball'
@echo ' targz-pkg - Build the kernel as a gzip compressed tarball'
@echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball'
+ @echo ' perf-pkg - Build $(perf-tar).tar.gz source tarball'

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Arnaldo Carvalho de Melo on
Em Thu, Jun 03, 2010 at 11:02:29AM +0200, Andi Kleen escreveu:
> > Arnaldo Carvalho de Melo <acme(a)infradead.org> writes:
> > Useful for when people want to try some version of the perf tools and don't
> > wants to download the kernel tarball.
>
> Does this also finally allow to build perf in a separate objdir like
> the rest of the kernel?

This is how I build it:

make O=~/git/build/perf -j9 -C tools/perf install

was done a few months ago, in:

commit c29ede615fd35a640e771fbbb1778e915fac43a7
Author: Arnaldo Carvalho de Melo <acme(a)redhat.com>
Date: Sat Mar 27 14:30:45 2010 -0300

perf tools: Allow specifying O= to build files in a separate directory

Avoiding polluting the source tree with build files.

Reported-by: Steven Rostedt <rostedt(a)goodmis.org>
Cc: Steven Rostedt <rostedt(a)goodmis.org>
Cc: Fr�d�ric Weisbecker <fweisbec(a)gmail.com>
Cc: Mike Galbraith <efault(a)gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra(a)chello.nl>
Cc: Paul Mackerras <paulus(a)samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme(a)redhat.com>

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Andi Kleen on
Thanks. That indeed solves it.
-Andi
--
ak(a)linux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/