From 584fc5abe4ea08a92eff691af42300b5a26d2755 Mon Sep 17 00:00:00 2001 From: Kang Kai Date: Wed, 19 Dec 2012 14:51:56 +0800 Subject: oprofile: use dynamic root home directory Use stub "ROOTHOME" to replace "/home/root" in oprofile-root.patch, then we can substitute it with configured root home directory. Signed-off-by: Kang Kai Signed-off-by: Saul Wold --- meta/recipes-kernel/oprofile/oprofile.inc | 1 + .../oprofile/oprofile/oprofile-root.patch | 23 +++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'meta/recipes-kernel') diff --git a/meta/recipes-kernel/oprofile/oprofile.inc b/meta/recipes-kernel/oprofile/oprofile.inc index b3ce852bba..23ddb14f38 100644 --- a/meta/recipes-kernel/oprofile/oprofile.inc +++ b/meta/recipes-kernel/oprofile/oprofile.inc @@ -31,6 +31,7 @@ inherit autotools EXTRA_OECONF = "--with-kernel-support --without-x" do_configure () { + find . -type f | xargs sed -i 's#ROOTHOME#${ROOT_HOME}#' cp ${WORKDIR}/acinclude.m4 ${S}/ autotools_do_configure } diff --git a/meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch b/meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch index db63a8e8da..f3fe4c9cb3 100644 --- a/meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch +++ b/meta/recipes-kernel/oprofile/oprofile/oprofile-root.patch @@ -4,6 +4,11 @@ Upstream-Status: inappropriate [OE specific] Signed-off-by: Mark Hatle +Replace "/home/root" with stub "ROOTHOME", then substitute it with +real root home directory which is configured dymanically. + +Signed-off-by: Kang Kai + diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.in --- oprofile-0.9.7.orig/doc/opcontrol.1.in 2011-07-04 21:25:04.000000000 -0500 +++ oprofile-0.9.7/doc/opcontrol.1.in 2012-07-02 14:02:16.358865420 -0500 @@ -12,7 +17,7 @@ diff -ur oprofile-0.9.7.orig/doc/opcontrol.1.in oprofile-0.9.7/doc/opcontrol.1.i .SH FILES .TP -.I /root/.oprofile/daemonrc -+.I /home/root/.oprofile/daemonrc ++.I ROOTHOME/.oprofile/daemonrc Configuration file for opcontrol .TP .I /var/lib/oprofile/samples/ @@ -24,7 +29,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1 oprofile-0.9.7/doc/oprofile.1 Configuration files .TP -.I /root/.oprofile/daemonrc -+.I /home/root/.oprofile/daemonrc ++.I ROOTHOME/.oprofile/daemonrc Configuration file for opcontrol .TP .I /opt/oprofile-0.9.7-rc3/share/oprofile/ @@ -36,7 +41,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.1.in oprofile-0.9.7/doc/oprofile.1.in Configuration files .TP -.I /root/.oprofile/daemonrc -+.I /home/root/.oprofile/daemonrc ++.I ROOTHOME/.oprofile/daemonrc Configuration file for opcontrol .TP .I @prefix@/share/oprofile/ @@ -48,7 +53,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html

Followed by list arguments for profiling set up. List of arguments - saved in /root/.oprofile/daemonrc. -+ saved in /home/root/.oprofile/daemonrc. ++ saved in ROOTHOME/.oprofile/daemonrc. Giving this option is not necessary; you can just directly pass one of the setup options, e.g. opcontrol --no-vmlinux.

@@ -57,7 +62,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.html oprofile-0.9.7/doc/oprofile.html

Start data collection with either arguments provided by --setup - or information saved in /root/.oprofile/daemonrc. Specifying -+ or information saved in /home/root/.oprofile/daemonrc. Specifying ++ or information saved in ROOTHOME/.oprofile/daemonrc. Specifying the addition --verbose makes the daemon generate lots of debug data whilst it is running.

@@ -69,7 +74,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml Followed by list arguments for profiling set up. List of arguments - saved in /root/.oprofile/daemonrc. -+ saved in /home/root/.oprofile/daemonrc. ++ saved in ROOTHOME/.oprofile/daemonrc. Giving this option is not necessary; you can just directly pass one of the setup options, e.g. opcontrol --no-vmlinux. @@ -78,7 +83,7 @@ diff -ur oprofile-0.9.7.orig/doc/oprofile.xml oprofile-0.9.7/doc/oprofile.xml Start data collection with either arguments provided by - or information saved in /root/.oprofile/daemonrc. Specifying -+ or information saved in /home/root/.oprofile/daemonrc. Specifying ++ or information saved in ROOTHOME/.oprofile/daemonrc. Specifying the addition makes the daemon generate lots of debug data whilst it is running. @@ -90,7 +95,7 @@ diff -ur oprofile-0.9.7.orig/gui/oprof_start_util.cpp oprofile-0.9.7/gui/oprof_s string const get_config_dir() { - return "/root"; -+ return "/home/root"; ++ return "ROOTHOME"; } string daemon_pid; @@ -102,7 +107,7 @@ diff -ur oprofile-0.9.7.orig/utils/opcontrol oprofile-0.9.7/utils/opcontrol # location for daemon setup information - SETUP_DIR="/root/.oprofile" -+ SETUP_DIR="/home/root/.oprofile" ++ SETUP_DIR="ROOTHOME/.oprofile" SETUP_FILE="$SETUP_DIR/daemonrc" SEC_SETUP_FILE="$SETUP_DIR/daemonrc_new" -- cgit 1.2.3-korg